-
Notifications
You must be signed in to change notification settings - Fork 93
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
Keywords with a dot character (punctuation mark) are being incorrectly highlighted in test cases #585
Comments
Agreed, I guess that the analysis really needs to be semantic (analyzing imports) to do the proper coloring (right now it just checks for a Marking as high priority. |
My 2 cents. Three options:
I might be willing to do option 3 |
@weltings For this specific case it shouldn't be costly to verify available imports (since everything is local there's no need to do an actual find definition, just checking the import/resource names / WITH NAME declarations and build a cache with what's valid before the dots should be straightforward and can cover all the cases). I think it's closer to 8 hours work (although reviews back and forth can potentiality raise it). If you'd like to tackle with that approach let me know (otherwise I'll check it as this is currently high priority). |
@fabioz When you say all imports are local, do you mean that all imports are defined in the Settings of the .robot or .resource file that is currently being processed? Because that is not always true. I have seen many teams in enterprises or large projects that combine " standard" or " default" imports into separate files so they are always available. Nested imports. So File_1.robot imports File_2.resource, and File_2.resource imports 10+ other files |
But, if the scope for implementing this is decided to be local, and you promise to cut down on the nit-pickiness about 20% so I have some artistic freedom, then I can look into this ;-) |
Seems good to me. At some point in the future we'll need to have some better caches (to handle the TODO in semantic tokens regarding the 'catenate') and then we can tackle imports from other files too. |
Any suggestions on where to get the imports? At first I was hoping they could be built whilst iterating inside _tokenize_tokens in semantic_tokens. Since that is the only function I'm currently familiar with. I'd suspect the imports might already be lying around somewhere, waiting to be retrieved. I see the following:
Any advice? |
You're right, it's already available through:
(for the imported libraries you want to check the Note that There was a version that didn't receive the completion context and received just the AST, but as just the AST isn't enough in the current scenario, I've just removed that version (i.e.: 744afc4). |
This is now fixed. As a note, it's available in a pre-release if you want to check it (see: https://code.visualstudio.com/updates/v1_63#_pre-release-extensions on how to use pre-releases). |
Thanks you. Your last few messages ended up in my spam, though for some reason this one was ok. |
I was really wondering why you turned silent ;) So, I ended up implementing the last things related to highlighting for the next release (including the caching of the imports considering dependencies / keyword calls with variables) and provided a new pre-release for it (which I hope to release Monday if no blocker is found until then). |
Describe the bug
Keywords that have a dot character (punctuation mark) in its name are being incorrectly highlighted in test cases.
Please, take a look at line 13 in the screenshot below.
This highlighting problem is probably related to the fact that one can use a keyword using its full reference to the library that implements it, eg.:
SeleniumLibrary.Open Browser
Please, take a look at line 7 in the screenshot below.
In this case (full keyword library reference) the keyword highlighting is adequate.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would expect that a keyword with a dot character in its name to be highlighted as any other keyword in a test case.
Screenshots
Already provided it in the bug description (better for contextualization).
Versions:
Logs
I don't think it is really needed for this specific case.
The text was updated successfully, but these errors were encountered: