This repository was archived by the owner on Aug 30, 2020. It is now read-only.
Detect file language by source file extension#101
Open
dmpetroff wants to merge 2 commits intordnetto:stablefrom
Open
Detect file language by source file extension#101dmpetroff wants to merge 2 commits intordnetto:stablefrom
dmpetroff wants to merge 2 commits intordnetto:stablefrom
Conversation
rdnetto
reviewed
Apr 4, 2017
|
|
||
| generate_conf(["-x", lang] + flags, config_file) | ||
| if force_lang: | ||
| lang += ["-x", force_lang] |
Owner
There was a problem hiding this comment.
lang should be a scalar value, not a list of flags
rdnetto
reviewed
Apr 4, 2017
| if force_lang: | ||
| lang += ["-x", force_lang] | ||
|
|
||
| generate_conf(flags, config_file) |
Owner
There was a problem hiding this comment.
This change will break color-coded config generation (generate_cc_conf()), because it outputs a plain text file without the logic in template.py.
IMO, a better way to handle this would be to add separate parameters to the generate_*_conf functions for force_lang and detected_lang, so they can do the right thing for their outputs.
Owner
|
Can you please target the Also, please make sure that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
I've been using ycm-gen for multilanguage (C/C++) project and had troubles with single language being forced for all project files. So I've made language enforcement not global, but rather "per-file by extension". That may be more convenient better that the current behaviour.
Also it's still possible to globally enforce single language via
--languageoption ofconfig_gen.py