-
Notifications
You must be signed in to change notification settings - Fork 68
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
Introduce tokenizing options for full and partial mode #1669
Introduce tokenizing options for full and partial mode #1669
Conversation
@aabounegm @msujew FYI |
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.
Can you add a completion test to this as well? Just to confirm that it really fixes the completion issue :)
Add tokenizing mode to tokenizing method - Full: We get the full text to tokenize - Partial: We get only a portion of the text to tokenize In indentation lexing, we do not auto-complete dedents for partial mode
@martin-fleck-at By the way, after this change do you consider this feature to be "complete", at least for most common use cases? I would like to perform the release soon (ideally today, since I'm on a team event next week). |
@msujew Yes, if that is working, I think we can consider this complete. I'd still love to try it out on our use case first though but I'll try to get this done today. Unfortunately, I am a bit struggling with creating the completion test case. Somehow, the tokens do not appear as I hoped they would but maybe it has something to do with the test function. |
- Adapt a few method names - Add missing parameter JSDoc - Fix wrong whitespace in Lexer constructor - Introduce specific types for unions - Add completion test - Do not use token names if there is no match as the text length is important for offset calculation
1db8a98
to
14abdc4
Compare
@martin-fleck-at Looking into this, this seems like a more complicated issue. Essentially, in the position with index |
@msujew Yeah, I also had a feeling that something was off. Curiously, when I try that code (I published it locally to a verdaccio npm registry to consume it correctly without copying code), the completion provider I have in my project works. Without this code, it does not. That is why I was not sure whether it was something in the test code or not. Not sure if we can merge this as it does at least not make things worse it seems. But I am still a bit baffled by the difference in behavior between my use case in the test case. |
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.
We can probably fix the outstanding completion issue later. See below. I think we can merge this.
Perfect, will push an update in a second. Actually, found another minor issue in the indentation token builder where I used a 0-based column index instead of a 1-based (chevrotain). |
- Ensure column-index is 1-based to avoid error - Make properties of optional options also optional - Mark test case as failing
ccb701f
to
a4d2cb3
Compare
Note that in our case, the completion provider fails because it's being triggered right after a |
This is based on a discussion that started in #1653 where it was discussed that auto-completing the dedent tokens in the indentation-aware lexer messes with the auto-completion in the editor.
Add tokenizing mode to tokenizing method
In indentation lexing, we do not auto-complete dedents for partial mode
Please note this PR is based on #1664 which was already approved but has yet to be merged.