-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/enum completion #485
Feat/enum completion #485
Conversation
1bcd137
to
8a11418
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed some commits to clean up formatting and a few other small issues. I have one question, but other than that, looks great so far!
f90c784
to
73a626b
Compare
6d208c5
to
bf76c71
Compare
somethings gone a bit weird here, @TwitchBronBron - I accidentally did the validation work onthis branch, so I dropped that commit and force pushed. hayyylp :) |
I reverted that code because it wasn't helpful and didn't solve what we needed. Stick with the walker for now...I'll come up with a more efficient approach later. |
@TwitchBronBron updated to use the walker; but it no longer runs. I think it might be a circular reference, issue; but this ts error is beyond me.
|
Check all your newly added import statements in .ts files and make sure none of them are coming from ".." or "../../". (Without a file name). Those regularly cause circular ref issues. Always import from an exact files. |
* Enum support in Lexer * Basic enum parsing support * Parser support for enums. * Baseline enum implementation. * Enum declaration validations * Fix lint issues. * include parent namespace name in enum statements. * Add EnumStatement to findReferences * vscode formatting setting. * Add primaryDottedGetExpressions to _references * Fix primaryDottedGetExpressions * Undo `primaryDottedGetExpressions` * Fix parse errors when enum is at top of file with other content * Adds plugin hooks for file validation * Undo space in settings file * Feat/enum completion (#485) * adds completions for enum types * add tests to prove there are no enum member collisions * Formatting fixes * small var naming tweaks * remove unnecessary eslint disable. * clean up test a little * adds validation for enums * adds completions for enum types * add tests to prove there are no enum member collisions * Formatting fixes * small var naming tweaks * remove unnecessary eslint disable. * clean up test a little * changes namespace.enumStatements to map * changes namespace.enumStatements to map * fixes broken imports * uses visitor to ascertain dotted get statements * fix circular ref issues. * clean up some tests Co-authored-by: Bronley Plumb <bronley@gmail.com> * Feat/enum validation (#486) * adds completions for enum types * add tests to prove there are no enum member collisions * Formatting fixes * small var naming tweaks * remove unnecessary eslint disable. * clean up test a little * adds validation for enums * adds completions for enum types * add tests to prove there are no enum member collisions * Formatting fixes * small var naming tweaks * remove unnecessary eslint disable. * clean up test a little * changes namespace.enumStatements to map * changes namespace.enumStatements to map * fixes broken imports * uses visitor to ascertain dotted get statements * fix circular ref issues. * Expression tracking during parse. * Partial support for re-calculating `references.expressions` * Capture rest of missing expressions. * Fix lint issues. * integrate with `parser.references.expressions` * Remove unnecessary eslint disable comment * Clean up enum tests * clean up some tests Co-authored-by: Bronley Plumb <bronley@gmail.com> * Fire plugin events for getTranspiledFile. Add new event properties * fix lint issues. * Tests for enum transpile. * Don't clear parser._references during enum validate * Fix reflection func for EnumStatement * Add generics support to Cache class. Use map. * Implement enum transpile. * Move file validation into program.validate() * fix lint issues * Fix bug with string enums not transpiling * make test work on node 10 * better validation for unknown enum values * make `getFile` more flexible. * tweaks * Tweaks. * Fix completions case sensitivity but * Fix enum member completions * Fixed some broken enum completions * Fix other broken enum completions * Cache extens map. * Detect duplicate enum declarations * fix lint issues * Remove duplicate tests. Move enum tests into Enum.spec.ts * fix lint issue * Fix unit test indentation bugs * verify all top-level items show in completion * use `setFile` * Fix enum completions * semantic token support for enums * Emit better transpiled enums even with errors * flag non-literal enum values. * Safer enum member access * completions test * Transpile `invalid` for non-literal enums * Add enum docs * remove old launch.json Co-authored-by: George Cook <george@tantawowa.com>
Adds completions for enums and enum statements. Works as follows: