-
Notifications
You must be signed in to change notification settings - Fork 13
Enable search-based intelligence for Objective C. #197
Conversation
2a7e019
to
559e89f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
I merged #175 into this PR (with distinct commits) and cleaned up the history. CI is happy again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✨
Any objections to me merging this with the affiliated (but not directly related) formatting changes? |
Not at all, that's fine, especially because the formatting is isolated to one commit. |
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.