Changes required should be located within the LSP server. This may only require a proper setting of the includeDeclaration in (custom/internal) ReferenceParams.
The TypeScript extension does not count declarations.
I also see that the definition in the DATA DIVISION is counted as a reference itself. Do we want to keep that?
I think this is the typical behavior in VSCode (to be checked), where a definition also counts as a "reference" to a symbol.
We don't want it for the definition itself - if that is the "single" reference then we want to have a linter option showing an info/warning/error (or none - preferably configurable) that this variable is unused (similar for section references).
If the LSP returns it with the definition, then just subtract the number by 1.
Originally posted by @GitMensch in #429 (comment)
Changes required should be located within the LSP server. This may only require a proper setting of the
includeDeclarationin (custom/internal)ReferenceParams.The TypeScript extension does not count declarations.
We don't want it for the definition itself - if that is the "single" reference then we want to have a linter option showing an info/warning/error (or none - preferably configurable) that this variable is unused (similar for section references).
If the LSP returns it with the definition, then just subtract the number by 1.
Originally posted by @GitMensch in #429 (comment)