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

Wrong directory for base.schema.json #346

Closed
whi-tw opened this issue Oct 25, 2023 · 0 comments · Fixed by #352
Closed

Wrong directory for base.schema.json #346

whi-tw opened this issue Oct 25, 2023 · 0 comments · Fixed by #352
Assignees
Labels
bug Something isn't working

Comments

@whi-tw
Copy link

whi-tw commented Oct 25, 2023

It looks like the relative directory used to access base.schema.json is incorrect:

ENOENT: no such file or directory, open '/Users/$USER/.vscode/extensions/schema/base.schema.json'

readFile(
path.join(__dirname, `../../../schema/base.schema.json`),
"utf8",
(err, data) => {
if (err) {
this.connection.console.log(err.message);
}
let schema: JSONSchema;
schema = data as JSONSchema;
this.languageService.addSchema(
"https://aws.amazon.com/cloudformation/template/base",
schema
);
}
);

I'm assuming the assumption is __dirname will be the source directory, but in reality, it's ${extensionRoot}/server/out, so the relative path should be ../schema/base.schema.json

I think this is also the case for other relative paths, but I haven't got that far in testing yet

@kddejong kddejong added the bug Something isn't working label Nov 2, 2023
@kddejong kddejong self-assigned this Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants