fix: launch LS even if path contains escapable characters #694
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unblocks #691
This fixes a long undiscovered bug which would cause the LS to never launch
in situation where there is an escapable character (such as whitespace)
in the default path leading to the LS binary.
The root cause is string concatenation of full commands (and
child_process.exec
API expecteding already escaped string)when checking LS version, instead of passing arguments individually.
This problem would also never be surfaced to the user due to some other
issues with error reporting (that can be addressed in a separate PR).
Users Affected
This affects all v2 versions from what I can tell (based on the codepath).
Reproduction
First time launch after fresh installation (or upgrade) on Windows with account called
Radek Simko
(with whitespace) + empty settings:After restarting VS Code: