This repository was archived by the owner on Mar 18, 2024. It is now read-only.
Enable search-based intelligence for Objective C.#197
Merged
creachadair merged 4 commits intomasterfrom Jan 24, 2020
Merged
Conversation
2a7e019 to
559e89f
Compare
chrismwendt
approved these changes
Jan 24, 2020
Contributor
chrismwendt
left a comment
There was a problem hiding this comment.
It needs more thought, but there might be another way to solve this that's more in line with having 1 extension for each language, e.g. by running both the CPP and Objective C extensions and checking the file content to determine which language it is.
96d87cd to
c69266e
Compare
Notably: Upgrade prettier to 1.19.1, to support newer syntax. This also fixes a lifecycle error by running under yarn rather than npm.
Since Objective C shares header file extensions with C and C++, this commit treats Objective C as a dialect of C++ for the purpose of code intelligence. In addition to adding the .m file extension, it extends the import filter to allow #import and @import directives as well as #include. For native C and C++ code, these extensions will have no material effect.
1d2774f to
93145b6
Compare
Author
|
I merged #175 into this PR (with distinct commits) and cleaned up the history. CI is happy again. |
Author
|
Any objections to me merging this with the affiliated (but not directly related) formatting changes? |
61 tasks
Contributor
Not at all, that's fine, especially because the formatting is isolated to one commit. |
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.
Since Objective C shares header file extensions with C and C++, this change treats Objective C as a dialect of C++ for the purpose of basic code intelligence. This is a mild (and arguably reasonable) compromise to the convention that each language has its own extension: We already treat C and C++ as one language, and since Objective C subsumes native C syntax as well, it makes sense to allow them to share filtering logic.
The substance of this change is to add the .m file extension to the C++ extension, and to extend the import filter to allow #import and @import directives as well as #include. For (correct) native C and C++ code, these extensions will have no material effect.
Fixes https://github.com/sourcegraph/sourcegraph/issues/6655.