-
Notifications
You must be signed in to change notification settings - Fork 463
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
cmake command returns error "Cannot read property 'uri' of undefined" when called via #1150
Comments
Thanks for reporting this. I submitted a PR to fix it. The command is uspposed to work without passing in the folder path, but you might consider updating your extension to support multi-root by passing in the folder when you execute the command. |
I tried the following in the current release 1.3.1. My workspace looks like this:
And then I changed my script to:
That didn't return anything. Then I tried it with: |
We use the |
That's great! I changed my script to the following for now. Awaiting new release of vscode-tools: // relativeTargetPath.js
exports.execute = async (args) => {
const vscode = args.require('vscode');
const workspace = vscode.workspace.workspaceFolders[0];
return vscode.commands.executeCommand('cmake.buildDirectory', workspace);
}; |
CMake Tools 1.4.0 Beta is available on GitHub. Please try it out and let us know if you encounter any issues. |
My scripts indeed work without the workaround now, so when 1.4.0 is released this issue can be closed. |
This fix is available in CMake Tools #1.4.0 which has been released. |
Brief Issue Summary
Since the later updates of cmake tools that support multiroot projects, my scripts seem to be broken that make use of the api and call the cmake commands. As an example I am using the Ego powertools plugin and call the following script:
The
executeCommand
call return the error Cannot read property 'uri' of undefined.Reverting back to version 1.2.3 of cmake tools makes the script work fine.
My project is using a multi root setup.
Most interesting is the fact that calling the same command from within a task with string resolve does work:
Expected:
executeCommand()
should give the same results as"${cmake.buildDirectory}"
.Apparent Behavior:
executeCommand()
returns Cannot read property 'uri' of undefined.Platform and Versions
Other Notes/Information
I first posted the bug in vscode powertools, but I figured out that reverting to 1.2.3 made it work, so I really believe this is a cmake tools issue.
See egodigital/vscode-powertools#35
The text was updated successfully, but these errors were encountered: