Skip to content

Conversation

watermarkhu
Copy link
Contributor

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.

image

For the wildcard itself there already exists a nested scope variable.language.wildcard.matlab:

Thus the fixes are needed in the main meta.import.matlab scope.

image

@dklilley
Copy link
Member

dklilley commented Aug 1, 2023

Thank you for noticing this and making this change!

Can you add a test which verifies your change?

@dklilley dklilley self-assigned this Aug 3, 2023
@watermarkhu
Copy link
Contributor Author

Do you reckon this is a test that belong in the snap directory?

@dklilley
Copy link
Member

dklilley commented Aug 7, 2023

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).

@nothans nothans added the CLA required Requires the signing of a Contributor License Agreement label Aug 7, 2023
@nothans
Copy link
Member

nothans commented Aug 7, 2023

Thanks for the contribution. Can you contact me to get a CLA signed? Thank you!

@nothans nothans added CLA signed Indicates that the requester has signed the Contributor License Agreement and removed CLA required Requires the signing of a Contributor License Agreement labels Aug 7, 2023
@nothans
Copy link
Member

nothans commented Aug 7, 2023

The CLA has been signed. Feel free to evaluate the PR and determine if you are going to merge. Thanks!

@dklilley dklilley self-requested a review August 7, 2023 21:05
@dklilley dklilley merged commit 4f1c0c8 into mathworks:master Aug 7, 2023
@dklilley
Copy link
Member

dklilley commented Aug 7, 2023

Thank you for making this fix @watermarkhu!

@watermarkhu watermarkhu deleted the import_wildcard branch August 8, 2023 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA signed Indicates that the requester has signed the Contributor License Agreement

3 participants