theia-ide / theia-apps

Theia applications examples - docker images, desktop apps, packagings
Apache License 2.0
1.04k stars 345 forks source link

[cpp] is any way to go to definition of sys header file ? #331

Closed Jamlee closed 4 years ago

Jamlee commented 4 years ago

image

vince-fugnitto commented 4 years ago

@Jamlee thank you for the issue, which image are you running in the following example?

Jamlee commented 4 years ago

@vince-fugnitto :smile: i build the app by myself. below is my config:

{
  "private": true,
  "dependencies": {
    "@theia/callhierarchy": "next",
    "@theia/file-search": "next",
    "@theia/git": "next",
    "@theia/json": "next",
    "@theia/markers": "next",
    "@theia/messages": "next",
    "@theia/mini-browser": "next",
    "@theia/navigator": "next",
    "@theia/outline-view": "next",
    "@theia/plugin-ext-vscode": "next",
    "@theia/preferences": "next",
    "@theia/preview": "next",
    "@theia/search-in-workspace": "next",
    "@theia/terminal": "next"
  },
  "devDependencies": {
    "@theia/cli": "next"
  },
  "scripts": {
    "prepare": "yarn run clean && yarn build && yarn run download:plugins",
    "clean": "theia clean",
    "build": "theia build --mode development",
    "start": "theia start --plugins=local-dir:plugins",
    "download:plugins": "theia download:plugins"
  },
  "theiaPluginsDir": "plugins",
  "theiaPlugins": {
    "vscode-builtin-css": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/css-1.39.1-prel.vsix",
    "vscode-builtin-html": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/html-1.39.1-prel.vsix",
    "vscode-builtin-javascript": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/javascript-1.39.1-prel.vsix",
    "vscode-builtin-json": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/json-1.39.1-prel.vsix",
    "vscode-builtin-markdown": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/markdown-1.39.1-prel.vsix",
    "vscode-builtin-npm": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/npm-1.39.1-prel.vsix",
    "vscode-builtin-scss": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/scss-1.39.1-prel.vsix",
    "vscode-builtin-typescript": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/typescript-1.39.1-prel.vsix",

    "vscode-builtin-git": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/git-1.39.1-prel.vsix",
    "vscode-builtin-git-ui": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/git-ui-1.39.1-prel.vsix",

    "vscode-builtin-cpp": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/cpp-1.39.1-prel.vsix",

    "vscode-builtin-typescript-language-features": "http://127.0.0.1:8080/typescript-language-features-1.39.1-prel.vsix"
  }
}
vince-fugnitto commented 4 years ago

@Jamlee I see, in your own config you are missing cpp language support. The vscode-builtin-cpp plugin only contributes textmate-grammars (syntax highlighting), and some snippets but no actual integration with a cpp language server.

In our theia-cpp and theia-full images we also include the @theia/cpp extension which provides language features:

https://github.com/theia-ide/theia-apps/blob/a9eefd93bd9c465d60cb812f1f1c9e8d8cbd43dc/theia-cpp-docker/latest.package.json#L20-L21

You may also include @theia/cpp-debug for debug support if you like :smiley:

Jamlee commented 4 years ago

it worked for me. image

in addtional, i need install clangd:

sudo apt-get install clangd-9

@vince-fugnitto Thanks