feat: prefer to select the previous token when cursor is before a marker (#1175)

* feat: prefer to select the previous token when cursor is before a marker

* test: update snapshot
This commit is contained in:
Myriad-Dreamin 2025-01-15 14:33:26 +08:00 committed by GitHub
parent 0aafee1d13
commit faf807edb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 26 additions and 13 deletions

View file

@ -42,7 +42,7 @@ impl StatefulRequest for RenameRequest {
doc: Option<VersionedDocument>,
) -> Option<Self::Response> {
let source = ctx.source_by_path(&self.path).ok()?;
let syntax = ctx.classify_pos(&source, self.position, 1)?;
let syntax = ctx.classify_for_decl(&source, self.position)?;
let def = ctx.def_of_syntax(&source, doc.as_ref(), syntax.clone())?;