Closed watermarkhu closed 1 year ago
Thank you for noticing this and making this change!
Can you add a test which verifies your change?
Do you reckon this is a test that belong in the snap
directory?
I think it would make more sense to be a standalone test under the test/
directory. I believe the snapshot tests are meant to capture much more broad tokenization, rather than specific behaviors, to prevent a change from breaking some core functionality.
Instead, I think it would be better to create a focused test which covers the cases from your above regex101 screenshots.
I believe the number preceding the test (i.e. t##TestPoint
) should correspond to the issue being fixed. If there is no issue for this bug, you can use the number of this pull request (51).
Thanks for the contribution. Can you contact me to get a CLA signed? Thank you!
The CLA has been signed. Feel free to evaluate the PR and determine if you are going to merge. Thanks!
Thank you for making this fix @watermarkhu!
The current regex for the
meta.import.matlab
scope has bugs with regard to import wildcards and trailing whitespaces. The following illustration from regex101 shows the whitespaces better.For the wildcard itself there already exists a nested scope
variable.language.wildcard.matlab
:https://github.com/mathworks/MATLAB-Language-grammar/blob/33f9678cf14662f44f2687e298826feb14015265/Matlab.tmbundle/Syntaxes/MATLAB.tmLanguage#L1783
Thus the fixes are needed in the main
meta.import.matlab
scope.