Skip to content

Comments

feat(ls): recognize identifiers declared in with and for statements#560

Merged
plusvic merged 8 commits intoVirusTotal:mainfrom
prosperritty:ls-with-for
Feb 16, 2026
Merged

feat(ls): recognize identifiers declared in with and for statements#560
plusvic merged 8 commits intoVirusTotal:mainfrom
prosperritty:ls-with-for

Conversation

@prosperritty
Copy link
Contributor

@prosperritty prosperritty commented Feb 13, 2026

This PR improves the following LSP language features, that from now can recognize identifiers declared in with and for statements:

  • Code Completion
  • Find references
  • Rename
  • Go to definition
  • Hover
  • Document Highlight

There was also a bug within Find References, Document Highlight and Rename features. When these features were used on the rule identifier, the same identifiers within with and for statements were also affected. This was fixed by doing some code changes in cst_traversal module, which are included in this PR.

Maybe it is the wrong PR to fix it, but I've also noticed that all of the Document Highlight tests were in fact testing nothing, because there were invalid file names(documenthighlightsN.yar instead of highlightsN.yar). I hope now the testing is performed correctly.

Thanks.

@plusvic plusvic merged commit 0c6274d into VirusTotal:main Feb 16, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants