ClangD support for Eclipse Che#7516
Conversation
|
@AndrienkoAleksandr should i squash or rewrite your commits to fix the ip validation error? |
|
@hkolvenbach ok. You can do all necessary |
|
Hello. Here is my humble opinions.
It depends. If the latest version provides considerably more functionality then it make sense, otherwise I would prefer the stable version.
We can host them as we host other binaries for language servers.
I would say no.
@evidolob may be could help here. |
I guess, we need to generate that file after project creation/clone. |
|
@hkolvenbach About generation json, we can try workaround. I think we can install cmake with help installation script org.eclipse.che.ls.clangd.sh. And than we can run command for generation json like we do it for csharp-ls: "dotnet restore on start csharp-ls" . For csharp we run command "dotnet restore" to restore dotnet dependencies, without them cshape intellisense doesn't work. For clangD we can run cmake command to generate compilation data-source json. |
|
@AndrienkoAleksandr I don't mind. |
f9a44e4 to
b5c5681
Compare
|
@tolusha @AndrienkoAleksandr @evidolob thanks for your responses, we are now continuing to work on it. just another question: what would be the most appropriate way to add the FYI @thierryk12 |
|
IMHO it is better choice:
|
|
just a quick update: we have a working compile_commands.json integration internally, but noticed that clangd (or the communication from eclipse che to clangd) is crashing regularly after a few minutes. currently investigating if this is a clangd or eclipse che problem. |
|
by the way: am i correct that eclipse che is not restarting a crashed language server? the VSCode plugin for clangd restarts it once it crashes. |
|
@hkolvenbach |
|
Quick update (as already told on the community call yesterday): What is currently working:
clangd very much depends on the compile_commands.json file, but if it is present, the results are generally very good. regarding #4991, a quick comparison to There are some open issues regarding the languageserver implemention of che though, which I would like to discuss before we propose changes that break in other languages:
CC @thierryk12 |
b5c5681 to
307ae28
Compare
|
the PR is updated, to test it you need to enable the clangd language server under installers and use |
| # } | ||
| # | ||
| ## Red Hat Enterprise Linux 6 | ||
| ############################# |
There was a problem hiding this comment.
Ideally we have to support all possible linux distributions
There was a problem hiding this comment.
yes, i will think about a way to install it through the script
|
@hkolvenbach |
Signed-off-by: Hanno Kolvenbach <kolvenbach@silexica.com>
| }; | ||
| private static final String MIME_TYPE = "text/x-cpp"; | ||
|
|
||
| // @Override |
There was a problem hiding this comment.
I just would like to remind that we're trying to avoid having comments of such kind when we do merge to master, do you think this section could be removed?
There was a problem hiding this comment.
good point, i will go through it and remove those
| import org.eclipse.che.plugin.cpp.projecttype.CppProjectType; | ||
| import org.eclipse.plugin.clangd.languageserver.ClangDLanguageServerLauncher; | ||
|
|
||
| /** @author Alexander Andrienko */ |
Signed-off-by: Hanno Kolvenbach <kolvenbach@silexica.com>
|
@DKuleshov I removed the comments. I think the PR is ready to be merged, if there are no more suggestions from you or the Che team. BTW: I picked clang 6 (will be released soon anyway), because clangD 5 was not working properly with the Che language protocol client |
| "description": "Clangd intellisense for C/C++ projects.", | ||
| "dependencies": [], | ||
| "properties": {} | ||
| } No newline at end of file |
There was a problem hiding this comment.
It is supposed to be a new line.
| command -v tar >/dev/null 2>&1 || { PACKAGES=${PACKAGES}" tar"; } | ||
| command -v curl >/dev/null 2>&1 || { PACKAGES=${PACKAGES}" curl"; } | ||
| command -v wget >/dev/null 2>&1 || { PACKAGES=${PACKAGES}" wget"; } | ||
| test "$(id -u)" = 0 || SUDO="sudo -E" |
There was a problem hiding this comment.
The scripts have been modified. For instance
is_current_user_root() {
test "$(id -u)" = 0
}
is_current_user_sudoer() {
sudo -n true > /dev/null 2>&1
}
set_sudo_command() {
if is_current_user_sudoer && ! is_current_user_root; then SUDO="sudo -E"; else unset SUDO; fi
}
have been added to test if user is sudo or isn't
There was a problem hiding this comment.
thanks, i will take a look!
Signed-off-by: Hanno Kolvenbach <kolvenbach@silexica.com>
3e109f5 to
fb9a34d
Compare
Signed-off-by: Hanno Kolvenbach <kolvenbach@silexica.com>
fb9a34d to
35ee27b
Compare
tolusha
left a comment
There was a problem hiding this comment.
Pls, update pom.xml to set 6.1.0-SNAPSHOT version.
Signed-off-by: Hanno Kolvenbach <kolvenbach@silexica.com>
|
done! |
|
@vparfonov What are the next steps here? |
pom.xml
Outdated
| <dependency> | ||
| <groupId>org.eclipse.che.plugin</groupId> | ||
| <artifactId>che-plugin-clangd-lang-server</artifactId> | ||
|
|
Signed-off-by: Hanno Kolvenbach <kolvenbach@silexica.com>
Signed-off-by: Hanno Kolvenbach <kolvenbach@silexica.com>
|
ci-build |
|
Build success. https://ci.codenvycorp.com/job/che-pullrequests-build/4469/ |
|
ci-test |
|
ci-test build report: |
|
The selenium tests passed without regressions |




What does this PR do?
This PR adds initial support for C/C++ Intellisense by using clangd as a language server. It supports starting the language server and connecting to the clangd in a hardcoded path within the docker image
There is still work to do, but I would like to use this PR to discuss how to best continue.
Open Questions:
eclipse/cpp_gccdocker image and should we integrate clangd into it?ToDo:
What issues does this PR fix or reference?
#4991
Release Notes
Docs PR