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

VS Code extension: ${workspaceFolder} prefixed with '/' on Windows #327

Open
marthinsen opened this issue Aug 9, 2023 · 0 comments · May be fixed by #328
Open

VS Code extension: ${workspaceFolder} prefixed with '/' on Windows #327

marthinsen opened this issue Aug 9, 2023 · 0 comments · May be fixed by #328

Comments

@marthinsen
Copy link

Using the current settings.json in VS Code on Windows:

{
    "cmakeFormat.args": [
        "--config-file",
        "${workspaceFolder}/CMake/cmake-format.yaml"
    ]
}

the ${workspaceFolder} will be prepended with a leading slash which cmake-format is not able to understand and fail with the error message:
CRITICAL __main__.py:635: Desired config file does not exist: /c:/path/to/workspace/CMake/cmake-format.yaml

The error seems to be that path is used here instead of fsPath:
https://github.com/cheshirekow/cmake_format/blob/eff5df1f41c665ea7cac799396042e4f406ef09a/cmakelang/vscode_extension/src/extension.ts#L39C5-L39C5
Difference between path and fsPath: https://code.visualstudio.com/api/references/vscode-api#Uri.fsPath

marthinsen added a commit to marthinsen/cmake_format that referenced this issue Aug 9, 2023
Use the filesystem path fsPath and not just path when substituting
${workspaceFolder}.

Closes cheshirekow#327
@marthinsen marthinsen linked a pull request Aug 9, 2023 that will close this issue
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 a pull request may close this issue.

1 participant