Hide compiler-generated synthetic fields from autocomplete#111
Open
abanchev wants to merge 1 commit intobobbylight:masterfrom
Open
Hide compiler-generated synthetic fields from autocomplete#111abanchev wants to merge 1 commit intobobbylight:masterfrom
abanchev wants to merge 1 commit intobobbylight:masterfrom
Conversation
Filter out class$0, class$1, etc. fields that Java compilers generate for .class literal expressions when targeting pre-Java 5 bytecode. These are internal compiler implementation details that should not appear in completion results. Added configurable hideSyntheticFields property (default: true) on JavaLanguageSupport with getter/setter API, wired through to SourceCompletionProvider.isAccessible().
15a9380 to
6138121
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
class$0,class$1, etc. fields from Java autocomplete results. These are compiler-generated synthetic fields for.classliteral expressions when targeting pre-Java 5 bytecode (e.g. ECJ with-target 1.4).hideSyntheticFieldsproperty onJavaLanguageSupport(default:true) withgetHideSyntheticFields()/setHideSyntheticFields(boolean)API so users can opt back in if needed.Motivation
When working with class files compiled for Java 1.4 targets, the compiler generates static fields like
class$0,class$1to cacheClassobjects for.classliteral expressions. These internal implementation details appear in autocomplete alongside real fields, cluttering the completion list with entries that are never useful to write directly.Changes
SourceCompletionProvider: addedhideSyntheticFieldsflag (defaulttrue) and a check inisAccessible()that rejectsFieldInfoentries whose name starts withclass$JavaCompletionProvider: exposed package-privategetSourceProvider()accessorJavaLanguageSupport: addedhideSyntheticFieldsfield with public getter/setter, wired through oninstall()