Col-E / Recaf

The modern Java bytecode editor
https://recaf.coley.software
MIT License
6.02k stars 465 forks source link

More intelligent tab-completion for assembler #725

Open Col-E opened 3 years ago

Col-E commented 3 years ago

The assembler did a simple String.startsWith(...) and showed the first N results. If a user is referencing a function more often than others push that item up in the list using some basic weight scheme. I think this is similar to how IntelliJ's suggestions work too.

Col-E commented 8 months ago

Some investigation:

Investigating if some third party library could be used

Most "Java code completion" libraries are implemented over LSP or are old and target javac internal classes that are hidden within internal modules in JDK 9+.

What about JShell?

Works great for vanilla Java snippets and completions in that context, but in Recaf we'd like to be able to complete things like tha names of declared fields/members in the current class, or referenced classes. JShell could be given a classpath to operate off of, but given that we do NOT want to load the contents of stuff being looked at in Recaf this is not an option. Additionally, there seems to be no good way of completing for arbitrary offsets in full source texts, as the system is designed to only work off of single line snippets at a time.

What do some other applications do if they don't use either of these options?

I've seen some completely re-create their own Java parser model with custom lexers and AST models. I don't have that kind of time.