Skip to content

fix: parse comma-separated field declarations#108

Open
abanchev wants to merge 3 commits intobobbylight:masterfrom
abanchev:fix/multi-variable-field-declarations
Open

fix: parse comma-separated field declarations#108
abanchev wants to merge 3 commits intobobbylight:masterfrom
abanchev:fix/multi-variable-field-declarations

Conversation

@abanchev
Copy link

@abanchev abanchev commented Mar 7, 2026

Summary

  • The AST parser only recognized the first variable in multi-variable field declarations like Type a, b, c;
  • Subsequent variables after commas were silently ignored, causing autocomplete to fail for those identifiers
  • After parsing the first field, the parser now loops on SEPARATOR_COMMA to create additional Field objects for each subsequent identifier
  • Applied to both class body and interface body parsing paths

Test plan

  • Added multi-variable declaration (public String multiA, multiB, multiC;) to SimpleClass.java test fixture
  • Added assertions in ClassAndLocalVariablesTest verifying all three fields are parsed with correct name, type, and modifiers
  • All existing tests continue to pass

bobbylight and others added 3 commits January 5, 2026 21:37
The parser only recognized the first variable in multi-variable field
declarations. Subsequent variables (after commas) were silently ignored,
causing autocomplete to fail for those identifiers.

After parsing the first field, loop on SEPARATOR_COMMA to create
additional Field objects for each subsequent identifier. Applied to
both class body and interface body parsing paths.

Includes test coverage with a multi-variable declaration in
SimpleClass.java and assertions in ClassAndLocalVariablesTest.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants