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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.

}

private String stringValue(PreferenceMetadata<?> meta) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ LspEditorPreferencePage_pretty_print=Pretty-print JSON output
LspEditorPreferencePage_drivers=Drivers
LspEditorPreferencePage_drivers_description=Comma separated list of globs for white-listing gcc-compatible drivers that are safe to execute
LspEditorPreferencePage_additional=Additional
LspEditorPreferencePage_additional_description=Newline or space separated list of additional options for clangd
LspEditorPreferencePage_additional_description=Newline separated list of additional options for clangd
LspEditorPreferencePage_browse_button=Browse...
LspEditorPreferencePage_clangd_options_label=clangd options
LspEditorPreferencePage_enable_project_specific=Enable project-specific settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<unit id="org.eclipse.license.feature.group" version="0.0.0" />
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/eclipse/updates/4.34-I-builds/" />
<repository location="https://download.eclipse.org/eclipse/updates/4.33/" />
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0" />
<unit id="org.eclipse.jdt.annotation" version="0.0.0" />
<unit id="org.eclipse.sdk.feature.group" version="0.0.0" />
Expand Down
Loading