Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Look for clang-format installed on system before defaulting to bundled version#4855

Merged
Colengms merged 2 commits into
mastermicrosoft/vscode-cpptools:masterfrom
coleng/use_clang_format_on_systemmicrosoft/vscode-cpptools:coleng/use_clang_format_on_systemCopy head branch name to clipboard
Jan 16, 2020
Merged

Look for clang-format installed on system before defaulting to bundled version#4855
Colengms merged 2 commits into
mastermicrosoft/vscode-cpptools:masterfrom
coleng/use_clang_format_on_systemmicrosoft/vscode-cpptools:coleng/use_clang_format_on_systemCopy head branch name to clipboard

Conversation

@Colengms

@Colengms Colengms commented Jan 16, 2020

Copy link
Copy Markdown
Contributor

Addresses #3569

Comment thread Extension/src/LanguageServer/settings.ts
@Colengms Colengms changed the title Looking clang-format installed on system before defaulting to bundled version Look for clang-format installed on system before defaulting to bundled version Jan 16, 2020

@sean-mcmanus sean-mcmanus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does it fallback to the shipped clang-format if it's not found on the path? Also, I think we should have a way to specify to "use the clang-format shipped with the C/C++ extension", because a hardcoded path won't work because the version will change every new release. Maybe some {default} or {bundled} variable or the empty string ""? Also, maybe the description of the clang_format_path should be updated?

@Colengms

Copy link
Copy Markdown
Contributor Author

Does it fallback to the shipped clang-format if it's not found on the path? Also, I think we should have a way to specify to "use the clang-format shipped with the C/C++ extension", because a hardcoded path won't work because the version will change every new release. Maybe some {default} or {bundled} variable? Also, maybe the description of the clang_format_path should be updated?

I'm not convinced that falling back to the bundled version if someone has incorrectly configured their path, would be the right thing to do, as it would silently fail to use the setting they provided. IMHO, it would be better to fail. Also, I'm not convinced a new setting to override the behavior makes sense. I think using the version installed on the system should be preferred, and our version only used as a fallback. If the clang-format-path setting is not set, the path to the executable will be queried with which on launch. The only hard-coded path involved would be if the user specified one, which I think should always take precedence.

@Colengms

Colengms commented Jan 16, 2020

Copy link
Copy Markdown
Contributor Author

Does it fallback to the shipped clang-format if it's not found on the path?

Just to make sure I understand your comment correctly; I had assumed you meant if not found on a user-specified path. My understanding is that which would not return a path unless the executable was 'found' on that path.

@sean-mcmanus

sean-mcmanus commented Jan 16, 2020

Copy link
Copy Markdown
Contributor

I'm not convinced that falling back to the bundled version if someone has incorrectly configured their path, would be the right thing to do, as it would silently fail to use the setting they provided. IMHO, it would be better to fail. Also, I'm not convinced a new setting to override the behavior makes sense. I think using the version installed on the system should be preferred, and our version only used as a fallback. If the clang-format-path setting is not set, the path to the executable will be queried with which on launch. The only hard-coded path involved would be if the user specified one, which I think should always take precedence.

If they don't have any clang_format_path set, shouldn't it fall back to the bundled one? I think that's what your code does currently. How does the user overwrite the defaults (PATH version) to get the bundled one if they want it?

@sean-mcmanus

Copy link
Copy Markdown
Contributor

Does it fallback to the shipped clang-format if it's not found on the path?

Just to make sure I understand your comment correctly; I had assumed you meant if not found on a user-specified path. My understanding is that which would not return a path unless the executable was found on that path.

Yeah, I wasn't talking about an explicitly set clang_format_path, I was talking about the PATH found from "which".

@sean-mcmanus sean-mcmanus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you update the description?

@sean-mcmanus

Copy link
Copy Markdown
Contributor

If this is just TypeScript changes can it go into 0.26.3-insiders4?

@Colengms

Copy link
Copy Markdown
Contributor Author

If this is just TypeScript changes can it go into 0.26.3-insiders4?

Yes. I'll update the changelog.

@Colengms Colengms merged commit fe8245f into master Jan 16, 2020
@Colengms Colengms deleted the coleng/use_clang_format_on_system branch January 16, 2020 23:04
Comment thread Extension/src/LanguageServer/settings.ts
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.