npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@devpodio/cpp

v0.6.3

Published

Theia - Cpp Extension

Readme

Theia - Cpp Extension

This extension uses Clangd to provide LSP features.

To install Clangd on Ubuntu 18.04:

$ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
$ echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main" | sudo tee /etc/apt/sources.list.d/llvm.list
$ sudo apt-get update && sudo apt-get install -y clang-tools-8
$ sudo ln -s /usr/bin/clangd-8 /usr/bin/clangd

See here for detailed installation instructions.

Getting accurate diagnostics

To get accurate diagnostics, it helps to:

  1. Have the build system of the C/C++ project generate a compile_commands.json file.
  2. Point Clangd to the build directory containing said compile_commands.json.

Step #2 can be done using the cpp.buildConfigurations preference. In your home or your project .theia/settings.json, define one or more build configurations:

{
    "cpp.buildConfigurations": [{
        "name": "Release",
        "directory": "/path/to/my/release/build"
    },{
        "name": "Debug",
        "directory": "/path/to/my/debug/build"
    }]
}

You can then select an active configuration using the C/C++: Change Build Configuration command from the command palette.

Setting clangd executable path and arguments

The path of the clangd executable to use can be specified by either:

  • Setting the CPP_CLANGD_COMMAND environment variable

  • Setting the cpp.clangdExecutable preference in your home or your project .theia/settings.json:

      {
          "cpp.clangdExecutable": "/path/to/my/clangd/executable"
      }
  • Adding clangd to system path. Default value of executable path is set to clangd

Similarly, the command-line arguments passed to clangd can be specified by either:

  • Setting the CPP_CLANGD_ARGS environment variable

  • Setting the cpp.clangdArgs preference in your home or your project .theia/settings.json:

      {
          "cpp.clangdArgs": "list of clangd arguments"
      }

Getting cross-file references to work

You may notice that by default, cross-references across source file boundaries don't work. For example, doing a "Go To Definition" on a function defined in a different source file (different .c or .cpp) doesn't work, instead it sends you to the declaration of the function, typically in a header file.

To get this working, you need to enable clangd's global index using the --background-index command-line argument.

    {
        "cpp.clangdArgs": "--background-index"
    }

Using the clang-tidy linter

Note: This functionality is available when using clangd 9 and later.

You can set the preference 'cpp.clangTidy' to enable the clang-tidy linter included in clangd. When the preference is set, there are two ways to chose which of its built-in checks clang-tidy will use:

  • using the preferences: 'cpp.clangTidyChecks'
  • using the file '.clang-tidy' . The file is located in the same folder of the files or a parent folder.

Note: using the preference checks will supersede the value found in the .clang-tidy file.

The syntax used to fill the checks can be found at http://clang.llvm.org/extra/clang-tidy/

clang-tidy has its own checks and can also run Clang static analyzer checks. Each check has a name (see link above for full list). Clang-tidy takes as input the checks that should run, in the form of a comma-separated list of positive and negative (prefixed with -) globs. Positive globs add subsets of checks, negative globs remove them.

There are two ways to configure clang-tidy's checks: through a Theia preference or using a .clang-tidy config file. Here are examples for both:"

- for the preferences: "cpp.clangTidyChecks": "*,-readability-*"
    - Meaning: enables all list-checks and disable all readability-* checks

- for the .clang-tidy file: Checks: "-*,readability-*"
    - Meaning: disable all list-checks and enable all readability-* checks

License