Skip to content
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

Fix 'fileMatch' pattern to match whole file name #417

Merged
merged 2 commits into from
Mar 2, 2021

Conversation

evidolob
Copy link
Collaborator

@evidolob evidolob commented Mar 1, 2021

What does this PR do?

It add / to file match pattern, if pattern doesn't include it.
The original problem in vscode-json-languageservice, it the way how file match implemented there.
Basically it match only file name end(i.e. arc.yaml and .mocharc.yaml file patterns will match to /some/path/.mocharc.yaml)
This PR is basically, trying to workaround that behaviour, by forcing matching against full file name.

vscode-json-languageservice has similar issues:

Demo:
Screenshot 2021-03-01 at 14 16 14

What issues does this PR fix or reference?

Fix: redhat-developer/vscode-yaml#354
and fix: redhat-developer/vscode-yaml#397

Is it tested? How?

Just create .mocharc.yaml file, open it and make sure that JSON Schema selected properly.

@evidolob evidolob self-assigned this Mar 1, 2021
@coveralls
Copy link

coveralls commented Mar 1, 2021

Coverage Status

Coverage increased (+0.3%) to 77.179% when pulling 3f00fe6 on evidolob:fix-354 into ed266ae on redhat-developer:master.

@joshuawilson
Copy link
Member

Does not look like you added a test for this.

Signed-off-by: Yevhen Vydolob <[email protected]>
// ignore
});
try {
const schemaStore = await this.getSchemaStoreMatchingSchemas();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see where you are stubbing this promise in the test.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I don't stub it, I stub xhr function https://github.com/redhat-developer/yaml-language-server/pull/417/files#diff-9c120b6ffef26acf5a9470c86608e41b18520b4ebdb317aded945ab236739631R40 which used in getSchemaStoreMatchingSchemas as the reasl code which I want to test is inside getSchemaStoreMatchingSchemas.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if that might be the case. Thanks for clearing that up.

@evidolob evidolob added this to the 0.16.0 milestone Mar 2, 2021
@evidolob evidolob merged commit 501d75f into redhat-developer:master Mar 2, 2021
@evidolob evidolob deleted the fix-354 branch March 2, 2021 15:44
evidolob added a commit to evidolob/yaml-language-server that referenced this pull request Mar 25, 2021
evidolob added a commit that referenced this pull request Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uses the wrong schema, even when yaml.schemas is set Bug: Incorrect Matching Against Schema Store
4 participants