-
Notifications
You must be signed in to change notification settings - Fork 264
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
Conversation
Signed-off-by: Yevhen Vydolob <[email protected]>
Does not look like you added a test for this. |
Signed-off-by: Yevhen Vydolob <[email protected]>
// ignore | ||
}); | ||
try { | ||
const schemaStore = await this.getSchemaStoreMatchingSchemas(); |
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.
I do not see where you are stubbing this promise in the test.
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.
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
.
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.
I was wondering if that might be the case. Thanks for clearing that up.
Signed-off-by: Yevhen Vydolob <[email protected]>
Signed-off-by: Yevhen Vydolob <[email protected]>
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:
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.