Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for C/C++ #13698

Closed
19 of 20 tasks
slemeur opened this issue Jul 4, 2019 · 19 comments
Closed
19 of 20 tasks

Add support for C/C++ #13698

slemeur opened this issue Jul 4, 2019 · 19 comments
Assignees
Labels
area/languages Issues related to Language extensions or plugins integration. kind/enhancement A feature request - must adhere to the feature request template. status/blocked Issue that can’t be moved forward. Must include a comment on the reason for the blockage.

Comments

@slemeur
Copy link
Contributor

slemeur commented Jul 4, 2019

Description

We should have support for C/C++ out of the box in Eclipse Che.

The work would consist in integrating existing C/C++ language server and provide default stack for it.

Reference:
[1] https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools
[2] https://docs.google.com/document/d/182PBN5LBNTlbhsqqsb5QHg9t5HNK3rSLrnIMPSGjyN0/edit#heading=h.tyhhnnuon2rs
[3] https://github.com/eclipse-cdt/cdt-vscode
[4] https://github.com/eclipse-cdt/cdt-gdb-vscode

Screenshot from 2019-08-06 12-40-35

@slemeur slemeur added the kind/enhancement A feature request - must adhere to the feature request template. label Jul 4, 2019
@slemeur slemeur added this to the 7.1.0 milestone Jul 4, 2019
@slemeur slemeur mentioned this issue Jul 4, 2019
@ibuziuk
Copy link
Member

ibuziuk commented Jul 4, 2019

@slemeur one of the getting-started [1] factories is C/C++
Are you ok to replace it with Go for Che 7 GA? Once C/C++ support will be in place we would also add a dedicated devfile to the getting-started page

[1] https://www.eclipse.org/che/getting-started/cloud/

@slemeur
Copy link
Contributor Author

slemeur commented Jul 4, 2019

@ibuziuk yep.

@slemeur
Copy link
Contributor Author

slemeur commented Jul 4, 2019

from @ferdaarikan:
We should also reach out to: https://github.com/eclipse-cdt/cdt-vscode and check if they would be interested to publish the CDT VS Code extension to Che.

@tsmaeder tsmaeder modified the milestones: 7.1.0, 7.x Jul 5, 2019
@tsmaeder
Copy link
Contributor

tsmaeder commented Jul 5, 2019

It's ok to do this after 7.0, but is it something we need to do in the first sprint after 7.0? I imagine we'll have plenty of bugs to fix.

@tolusha tolusha self-assigned this Jul 25, 2019
@tolusha tolusha added area/languages Issues related to Language extensions or plugins integration. status/in-progress This issue has been taken by an engineer and is under active development. labels Jul 25, 2019
@slemeur slemeur modified the milestones: 7.x, 7.1.0 Jul 25, 2019
@tsmaeder tsmaeder mentioned this issue Jul 25, 2019
20 tasks
@tsmaeder
Copy link
Contributor

The C++ VS Code extension has the same license problems as the C# one has: we cannot reuse it. This needs analysis, but we'll probably have to package our own plugin. The language server (clangd) does not have licensing problems.

@tolusha
Copy link
Contributor

tolusha commented Jul 26, 2019

@tsmaeder @slemeur
eclipse-cdt/cdt-vscode [1] provides the same functionality as VS Code extension [2] but it work in conjunction with two other extensions [3] [4]

[1] https://github.com/eclipse-cdt/cdt-vscode
[2] https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools
[3] https://github.com/eclipse-cdt/cdt-gdb-vscode
[4] https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd

@slemeur
Copy link
Contributor Author

slemeur commented Jul 26, 2019 via email

@tolusha
Copy link
Contributor

tolusha commented Jul 26, 2019

I think so.

@tolusha
Copy link
Contributor

tolusha commented Jul 29, 2019

@l0rd
Could you pls create a repository in https://github.com/che-incubator/ to put dockerfiles to build and host vsix packages for [1] [2]

For instance che-incubator/che-cpptools

[1] https://github.com/eclipse-cdt/cdt-vscode
[2] https://github.com/eclipse-cdt/cdt-gdb-vscode

@benoitf
Copy link
Contributor

benoitf commented Jul 29, 2019

@ghost
Copy link

ghost commented Jul 31, 2019

Can I ask some question about this issue?
Is there any plan to support LLVM (Clang) in this C++ environment(dockerfile)?

@tolusha
Copy link
Contributor

tolusha commented Jul 31, 2019

@wonjooncho
Hello.
There will be two docker containers:

  1. custom docker container with tools needed to run C++ plugin: clang g++ gdb
  2. development container with g++, gdb: https://registry.centos.org/centos/devtoolset-7-toolchain-centos7/latest

@tolusha
Copy link
Contributor

tolusha commented Aug 6, 2019

Here is the devfile for the testing purpose to play with c/c++ tools

Screenshot from 2019-08-06 12-40-35

---
apiVersion: 1.0.0
metadata:
  name: cpp
projects:
  -
    name: cpp-hello-world
    source:
      type: git
      location: 'https://github.com/che-samples/cpp-hello-world'
components:
-
  type: chePlugin
  reference: https://raw.githubusercontent.com/tolusha/plugins-registry/master/plugins/tolusha/cpptools/0.1/meta.yaml
  alias: cpp-plugin
  preferences:
    clangd.path: /usr/bin/clangd
    cdt.clangd.binaries.enable: false
-
  type: dockerimage
  alias: cpp-dev
  image: registry.centos.org/centos/devtoolset-7-toolchain-centos7
  command: ['sleep']
  args: ['infinity']
  memoryLimit: 512Mi
  mountSources: true
commands:
  -
    name: build
    actions:
      - type: exec
        component: cpp-dev
        command: g++ -g hello.cpp -o hello.out
        workdir: ${CHE_PROJECTS_ROOT}/cpp-hello-world
  -
    name: debug
    actions:
      - type: vscode-launch
        referenceContent: >
          {
            "version": "0.2.0",
            "configurations": [
                {
                    "type": "gdb",
                    "name": "Debug c++ application",
                    "request": "launch",
                    "program": "/projects/cpp-hello-world/hello.out"
                }
            ]
          }

@kellyhyomin
Copy link
Contributor

@tolusha

When I created a workspace with c/c++ stack I faced the same issue as below screen.
image

Even if I reload, I keep getting a message to reload.
I used the che-theia, plugin-registry and devfile-registry you updated recently.

I would appreciate it if you would help this issue.

@tolusha
Copy link
Contributor

tolusha commented Aug 20, 2019

@kellyhyomin
Unfortunately I can't test the plugin with the latest images due some issues.

  1. Regarding its current state, the error above is expected because @theia/cpp extension isn't disabled in the version of Theia that is used for testing purpose. Despite the error the LS should work. Could you try some LS features to check it?

  2. clang is installed (it is requirement for plugins to work) in a sidecar container and not in a dev container.

@kellyhyomin
Copy link
Contributor

@tolusha
Thank you for your help.
What version of theia can I use with the @ theia/cpp extension?
Other features, such as the hover function, seem to be working, but the code completion does not work properly.

@tolusha
Copy link
Contributor

tolusha commented Aug 27, 2019

It is supposed to use Che c/c++ plugin with the latest version or Eclipse Che (7.1.0-SNAPSHOT) but we have to fix this issue [1] at first
[1] eclipse-theia/theia#5993

@kellyhyomin
Copy link
Contributor

@tolusha
Thank you for your help.
I am using your devfile.yaml(https://github.com/eclipse/che-devfile-registry/blob/ab/cpp/devfiles/cpp/devfile.yaml) in che 7.1.0 version.
Why build g ++ with cpp-dev terminal rather than building with clang in cpp-plugin terminal?
I want to build with clang.

@tolusha
Copy link
Contributor

tolusha commented Sep 11, 2019

@kellyhyomin
I guess that's not a problem.

When you need to create a workspace just add a new component (or replace the existed) in the devfile and set the image with the clang inside. For instance:

-
  type: dockerimage
  alias: cpp-dev-clang
  image: <some image>
  command: ['sleep']
  args: ['infinity']
  memoryLimit: 512Mi
  mountSources: true

@tsmaeder tsmaeder modified the milestones: 7.1.0, Backlog - Languages Sep 23, 2019
@tsmaeder tsmaeder added status/blocked Issue that can’t be moved forward. Must include a comment on the reason for the blockage. and removed status/in-progress This issue has been taken by an engineer and is under active development. labels Sep 25, 2019
@tolusha tolusha closed this as completed Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/languages Issues related to Language extensions or plugins integration. kind/enhancement A feature request - must adhere to the feature request template. status/blocked Issue that can’t be moved forward. Must include a comment on the reason for the blockage.
Projects
None yet
Development

No branches or pull requests

6 participants