mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-06 08:07:49 +00:00
Find Usages mixed reads and writes of a Java field, including Lombok getter and setter calls, because jdtls has no read/write classification in its references. The usages popup and Find window now have Read and Write toggles. Read-write accesses stay visible in either mode and unclassified results are kept. Classification comes from a jdtls extension in `plugins/java-usages`, embedded as a jar and installed beside the other bundles. The checked-in jar was rebuilt from source with ECJ and matches byte for byte. Any extension failure falls back to standard references, so a jdtls upgrade can lose the filter but not Find Usages; rebuilding the jar on an upgrade is manual and described in the plugin README. Older installed jars are removed. Other languages keep their plain result count. Co-authored-by: NingYuanLin <57001533+NingYuanLin@users.noreply.github.com>
21 lines
1.1 KiB
Python
21 lines
1.1 KiB
Python
"""Reproducible bundle build: python3 build.py /path/to/jdtls (JDT LS 1.63.0, Java 25; target Java 21)."""
|
|
import os
|
|
import pathlib
|
|
import subprocess
|
|
import sys
|
|
import tempfile
|
|
import zipfile
|
|
|
|
root = pathlib.Path(__file__).resolve().parent
|
|
plugins = pathlib.Path(sys.argv[1]).resolve() / 'plugins'
|
|
with tempfile.TemporaryDirectory() as out:
|
|
subprocess.run(['java', '-cp', str(plugins / '*'),
|
|
'org.eclipse.jdt.internal.compiler.batch.Main', '-21', '-proc:none',
|
|
'-classpath', os.pathsep.join(str(p) for p in sorted(plugins.glob('*.jar'))),
|
|
'-d', out, *[str(p) for p in sorted((root / 'src').rglob('*.java'))]], check=True)
|
|
with zipfile.ZipFile(root / 'openidea-java-usages.jar', 'w', zipfile.ZIP_DEFLATED) as jar:
|
|
files = {'META-INF/MANIFEST.MF': root / 'MANIFEST.MF', 'plugin.xml': root / 'plugin.xml'}
|
|
files.update({str(p.relative_to(out)): p for p in pathlib.Path(out).rglob('*.class')})
|
|
for name, path in sorted(files.items()):
|
|
jar.writestr(zipfile.ZipInfo(name, (2026, 1, 1, 0, 0, 0)), path.read_bytes())
|