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

Unable to resolve resource cmake-tools-schema:/schemas/CMakePresets-v3-schema.json in trusted workspace #2587

Closed
1100101 opened this issue Jun 9, 2022 · 3 comments · Fixed by #3139
Labels

Comments

@1100101
Copy link

1100101 commented Jun 9, 2022

Brief Issue Summary

I am unable to verify the content of my CMakePresets.json/CMakeUserPresets.json against the JSON schema that comes with the extension, because apparently the extension is not able to open the schema resource:

[{
	"resource": "/d:/CMakePresets.json",
	"owner": "_generated_diagnostic_collection_name_#0",
	"code": "768",
	"severity": 4,
	"message": "Unable to load schema from 'cmake-tools-schema:/schemas/CMakePresets-v3-schema.json': cannot open cmake-tools-schema:/schemas/CMakePresets-v3-schema.json. Detail: Unable to resolve resource cmake-tools-schema:/schemas/CMakePresets-v3-schema.json.",
	"startLineNumber": 1,
	"startColumn": 1,
	"endLineNumber": 1,
	"endColumn": 2
}]

This is a with a cleanly installed version of VS Code, with default configuration (no custom settings whatsoever).

When I Open a CMakePresets.json with the extension installed, at first no error is shown because the application is in "Restricted mode" (the workspace hasn't been trusted yet).
As soon as I trust the workspace, the schema error appears.

Typing silly values for some of the CMake JSON variables has no effet, the file is not validated against the schema.

CMake Tools Diagnostics

`command 'cmake.logDiagnostics' not found`

Debug Log

No CMake build attempted

Additional Information

Machine

Windows 10 Entersprise, v1909 (18363.2212)

VS Code

Version: 1.67.2 (user setup)
Commit: c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5
Date: 2022-05-17T18:15:52.058Z
Electron: 17.4.1
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Windows_NT x64 10.0.18363

CMake Tools Extension

Name: CMake Tools
Id: ms-vscode.cmake-tools
Description: Extended CMake support in Visual Studio Code
Version: 1.10.5
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools

@bobbrow
Copy link
Member

bobbrow commented Jun 9, 2022

We've been seeing spurious reports of schemas not being found (I've experienced it before as well, but not consistently for us to be able to debug it yet). #2135 refers to another case of this, but with a different file (cmake-variants.yaml). What's weird in your report is that you say that cmake.logDiagnostics is not found which might point to a corrupted installation of the extension. Perhaps uninstalling and reinstalling it might help with that.

@bobbrow bobbrow added bug a bug in the product Feature: language services labels Jun 9, 2022
@1100101
Copy link
Author

1100101 commented Jun 9, 2022

Is it possible that the extension only works correctly if I open a folder (with CMakePresets.json) in VS Code?
When I do that, I don't get any errors, and the schema seems to be handled correctly.
If I open just the CMakePresets.json, the error shows up.

@bobbrow
Copy link
Member

bobbrow commented Jun 10, 2022

Yes, the extension does not activate automatically in that case. I'm surprised that VS Code would try to load our schema without loading our extension though. This may be a VS Code issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants