zls
zls copied to clipboard
Only return highlights for symbols in current document
This seems to only occur when highlighting "field access" symbols, e.g.
"bar" in a statement such as foo.bar. This is because the
symbolReferencesInternal function finds the reference to the field in
the container even when the container is not in the current document.
Alternatively I could try modifying symbolReferencesInternal to have it (optionally) only find symbols within the current document. That is probably “better” in the sense that it does not generate references that only get filtered out later, though it is a larger/more complex change.
I think this change is fine as-is, thanks for the contribution!