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

[#381] use only system dependent line separator as seprator #382

Merged
merged 2 commits into from
Dec 11, 2024

Conversation

ghentschke
Copy link
Contributor

...for clangd options. And no spaces anymore, because they lead to trouble when file path used in options contains spaces.

fixes #381

...for clangd options. And no spaces anymore, because they lead to
trouble when file path used in options contains spaces.

fixes eclipse-cdt#381
@ghentschke ghentschke merged commit c7f134d into eclipse-cdt:master Dec 11, 2024
3 checks passed
@ghentschke ghentschke deleted the fix-issue-381 branch December 11, 2024 15:39
@@ -72,7 +72,7 @@ public List<String> additionalOptions() {
if (options.isBlank()) {
return new ArrayList<>();
}
return Arrays.asList(options.split("\\s+")); //$NON-NLS-1$
return Arrays.asList(options.split(System.lineSeparator()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor observation is that on Windows this won't split \n separated options anymore. Should this be split on "\r?\n" (not sure if escaping is correct, but I hope you understand my meaning?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. The originally implementation used \R in the regex. This might be the better implementation.

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 this pull request may close these issues.

Clangd Server Hangs When Additional Options Contain Spaces in the Path
2 participants