Eglot + clangd not working for NetHack code base

This page summarizes the projects mentioned and recommended in the original post on /r/emacs

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • NetHack

    Official NetHack Git Repository

  • My configuration of Eglot is simple: (use-package eglot :hook (c-mode . eglot-ensure)). And it works for a single c file. But when I use this setup to read the code of NetHack, it doesn't work for linting and definition finding (M-.), even though eglot connection has no problem. I observed the same problems when reading the code of SQLite. Some specific problems I observed:

  • compiledb

    Tool for generating Clang's JSON Compilation Database files for make-based build systems.

  • An update: I am now able to make everything work by generating `compile_commands.json` using compiledb. I'm aware that there is another tool Bear but for some reason it generates an empty `compile_commands.json` file for me.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • Bear

    Bear is a tool that generates a compilation database for clang tooling.

  • An update: I am now able to make everything work by generating `compile_commands.json` using compiledb. I'm aware that there is another tool Bear but for some reason it generates an empty `compile_commands.json` file for me.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts