perf(java): count usage lenses in the project sources only (#2244)

* perf(java): count usage lenses in the project sources only

Usage lenses asked JDT LS for a full references search per declaration,
which also scans every dependency jar and the JDK. In a library class such
as java.lang.String that kept JDT LS busy for tens of seconds per pass,
and failed counts were asked again on every scroll.

- Scoped Java searches without libraries pass the "sources" scope.
- Lenses count declarations near the viewport (10 lines instead of 60).
- Incomplete counts are remembered per document version and asked again
  once the server settles, instead of on every pass.

* perf(java): turn off the language server's own reference lenses

JDT LS shows a references lens above each declaration by default and the
editor resolved them all at once, a references search per declaration on
every open and edit. The editor's usage lenses already count usages.

* style(editor): keep the usage lens's unrelated lines as they were
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-09 14:34:05 +08:00
1 джерело 89b178f9aa
коміт 89c7ae7d4c
5 files changed
+47 -11

No files matched your search

+3
Переглянути файл
@@ -43,6 +43,9 @@ contentProvider = { preferred = "fernflowerContentProvider" }
maven = { downloadSources = true, updateSnapshots = false }
eclipse = { downloadSources = true }
references = { includeDecompiledSources = true }
# The editor's usage lenses count usages; the server's own lenses would search every
# declaration of the file again, all at once (on by default in JDT LS).
referencesCodeLens = { enabled = false }
signatureHelp = { enabled = true }
symbols = { includeGeneratedCode = true }
configuration = { updateBuildConfiguration = "automatic" }