All Projects → clangd → vscode-clangd

clangd / vscode-clangd

Licence: MIT License
Visual Studio Code extension for clangd

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to vscode-clangd

Vscode Jupyter
VS Code Jupyter extension
Stars: ✭ 216 (-12.9%)
Mutual labels:  vscode
Swdc Vscode Musictime
A VS Code extension to discover the most productive music to listen to as you code
Stars: ✭ 242 (-2.42%)
Mutual labels:  vscode
vscode-less
🔌 Less intellisense for Variables and Mixins in all Less files.
Stars: ✭ 21 (-91.53%)
Mutual labels:  vscode
Vshaxe
Haxe Support for Visual Studio Code
Stars: ✭ 234 (-5.65%)
Mutual labels:  vscode
Vscode Paste Image
paste image from clipboard to markdown/asciidoc directly!
Stars: ✭ 236 (-4.84%)
Mutual labels:  vscode
Vscode Deno
[Deprecated] Move to https://github.com/denoland/vscode_deno
Stars: ✭ 249 (+0.4%)
Mutual labels:  vscode
Typescript Hero
VSCode extension that assists you with your everyday work around typescript
Stars: ✭ 222 (-10.48%)
Mutual labels:  vscode
vscode-save-and-run
Visual Studio Code extension to run commands whenever a file is saved https://marketplace.visualstudio.com/items?itemName=wk-j.save-and-run
Stars: ✭ 31 (-87.5%)
Mutual labels:  vscode
Vscode Live Server
Launch a development local Server with live reload feature for static & dynamic pages.
Stars: ✭ 3,275 (+1220.56%)
Mutual labels:  vscode
atom-ide-cpp
C/C++ language support for Atom-IDE
Stars: ✭ 34 (-86.29%)
Mutual labels:  clangd
Code Debug
Native debugging for VSCode
Stars: ✭ 232 (-6.45%)
Mutual labels:  vscode
Vscode Comment Translate
vscode 注释翻译插件, 不干扰正常代码,方便快速阅读源码。
Stars: ✭ 235 (-5.24%)
Mutual labels:  vscode
Remote Vscode
A package that implements the Textmate's 'rmate' feature for Visual Studio Code.
Stars: ✭ 251 (+1.21%)
Mutual labels:  vscode
Vscode Coverage Gutters
Display test coverage generated by lcov and xml - works with many languages
Stars: ✭ 226 (-8.87%)
Mutual labels:  vscode
vscode-snazzy-theme
🎨 VS Code theme based on hyper-snazzy with bright colors
Stars: ✭ 16 (-93.55%)
Mutual labels:  vscode
Vscode Frida
Unofficial frida extension for VSCode
Stars: ✭ 221 (-10.89%)
Mutual labels:  vscode
Vscode Data Preview
Data Preview 🈸 extension for importing 📤 viewing 🔎 slicing 🔪 dicing 🎲 charting 📊 & exporting 📥 large JSON array/config, YAML, Apache Arrow, Avro, Parquet & Excel data files
Stars: ✭ 245 (-1.21%)
Mutual labels:  vscode
vscode-note
a simple note-taking extension for vscode.
Stars: ✭ 29 (-88.31%)
Mutual labels:  vscode
vscode-leetcode-cpp-debug
Debug support for LeetCode with C++
Stars: ✭ 14 (-94.35%)
Mutual labels:  vscode
bazel-compile-commands-extractor
Goal: Enable awesome tooling for Bazel users of the C language family.
Stars: ✭ 295 (+18.95%)
Mutual labels:  clangd

clangd

clangd helps developers write, understand and improve C/C++ code by providing:

  • code completion
  • compile errors and warnings
  • go-to-definition and cross references
  • hover information and inlay hints
  • include management
  • code formatting
  • simple refactorings

Full documentation for clangd is at clangd.llvm.org.

Setup

clangd server

The extension requires the clangd language server. You will be prompted to download it if it's not found on your PATH. (Automatic installation is possible on x86-64 Linux, Windows, and Mac).

If you have an old version of clangd installed on your system already, you can run "Check for clangd language server update" from the command palette.

Project setup

clangd is based on the clang C++ compiler, and understands even complex C++ code. However, you must tell clangd how your project is built (compile flags). A compile_commands.json file can usually be generated by your build system (e.g. with CMake, by setting -DCMAKE_EXPORT_COMPILE_COMMANDS=1).

See Project Setup in the clangd documentation for details and alternatives.

Features

Code completion

Suggestions will appear as you type names, or after . or ->. Because clangd uses a full C++ parser, code completion has access to precise type information.

Code completion

Errors, warnings, and clang-tidy

Code errors are shown as you type (both as red squiggle underlines, and in the "Problems" panel). These are the same as produced by the clang compiler, and suggested fixes can automatically be applied.

Error with fix

Most clang-tidy checks are supported (these can be enabled using a .clang-tidy file).

Cross-references

Go-to-definition and find-references work across your code, using a project-wide index.

Cross-reference list

Press Ctrl-P # to quickly navigate to a symbol by name.

Include management

Code completion works across your codebase and adds #include directives where needed. The shows includes that will be inserted.

clangd can also suggest inserting missing #includes, where they cause errors.

Fix inserts include

Formatting

clangd uses the clang-format engine. You can format a file or the selection. When "Format on Type" is enabled in the settings, pressing enter will cause clangd to format the old line and semantically reindent.

Format-on-type

The style used for formatting (and certain other operations) is controlled by the .clang-format file is controlled by the project's .clang-format file.

Refactoring

clangd supports some local refactorings. When you select an expression or declaration, the lightbulb menu appears and you can choose a code action.

Extract variable code action

Current refactorings include:

  • extract variable/function
  • expand auto types and macros
  • use raw strings
  • rename (bound to <F2>, rather than a contextual code action)

Bugs/contributing

clangd is part of the LLVM project.

If you'd like to help out, reach out to [email protected].

If you've found a bug in this extension, please file it at https://github.com/clangd/vscode-clangd/issues. If you've found a bug in clangd, please file at https://github.com/clangd/clangd/issues.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].