-
Notifications
You must be signed in to change notification settings - Fork 115
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
Restore VsCode 1.91 behavior of allowing scripts as executable #730
Conversation
…t was possible to execute cmd/bat scripts as executable. After this update this was suddenly broken. Our use-case for using such a script has to do with the consistency of our clang-tooling. We build clang-format, clang-tidy, clangd ... all together and put this in a package manager. In the script, we first download these executables (when needed) and than start the downloaded clangd. As such, when fixing an issue in clang-tidy, the same issue will get fixed in the clangd exe. Without this script, it is impossible to automatically trigger this download and it introduces the risk that we do not update all the tooling to the latest version. Fixes clangd#683 In this reapply, we quote both the command line and the arguments, such that both can contain spaces. We also introduce the option useScriptAsExecutable, such that this is only enabled when the user wants it.
@HighCommander4 The issue with the space was clear and should be resolved. However, I had the impression that there were other reasons why it failed which we don't know about. |
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.
Do you not also need shell: useScriptAsExectuable
in clangd.options
?
src/clangd-context.ts
Outdated
@@ -68,13 +68,23 @@ export class ClangdContext implements vscode.Disposable { | |||
if (!clangdPath) | |||
return null; | |||
|
|||
const useScriptAsExecutable = | |||
await config.get<boolean>('useScriptAsExecutable'); |
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 simplified this a bit in #731 (config.get
isn't actually async and doesn't need to be awaited), would you mind rebasing on top of that and querying the config value directly in the constructor?
src/clangd-context.ts
Outdated
let quote = (str: string) => { return `"${str}"`; }; | ||
clangdPath = quote(clangdPath) | ||
for (var i = 0; i < clangdArguments.length; i++) | ||
clangdArguments[i] = quote(clangdArguments[i]); |
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.
nit: indent statement inside loop
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.
Completely agree, will look at it
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.
LGTM
This reverts commit ea588aa.
In VsCode 1.72 Node was updated to version 20, before this upgrade, it was possible to execute cmd/bat scripts as executable.After this update this was suddenly broken.
Our use-case for using such a script has to do with the consistency of our clang-tooling.
We build clang-format, clang-tidy, clangd ... all together and put this in a package manager.
In the script, we first download these executables (when needed) and than start the downloaded clangd.
As such, when fixing an issue in clang-tidy, the same issue will get fixed in the clangd exe.
Without this script, it is impossible to automatically trigger this download and it introduces the risk that we do not update all the tooling to the latest version.
Fixes #683
In this reapply, we quote both the command line and the arguments, such that both can contain spaces.
We also introduce the option useScriptAsExecutable, such that this is only enabled when the user wants it.