Skip to content

Use safer clangd defaults for enrichment#227

Open
darthghandi wants to merge 6 commits into
zzet:mainfrom
darthghandi:fix/issue-220-clangd-tidy-high-cpu
Open

Use safer clangd defaults for enrichment#227
darthghandi wants to merge 6 commits into
zzet:mainfrom
darthghandi:fix/issue-220-clangd-tidy-high-cpu

Conversation

@darthghandi

Copy link
Copy Markdown

Summary

  • Change the built-in clangd enrichment defaults to disable background indexing and clang-tidy, keep header insertion disabled, and limit clangd to one worker.
  • Add a regression test that pins the default clangd argument list.
  • Document the new defaults and how users can override them with semantic.providers[].args.

Test Plan

  • GOCACHE=/tmp/gortex-go-cache GOMODCACHE=/tmp/gortex-gomod-cache go test ./internal/semantic/lsp -count=1
  • Manual llama.cpp diagnostic run confirmed gortex launched clangd with --background-index=false --clang-tidy=false --header-insertion=never -j=1.
  • go test ./... currently fails on both this branch and main in internal/parser/forest due to github.com/alexaandru/go-sitter-forest/perl C compilation error: bsearch.h:72:7: error: expected identifier or ‘(’ before ‘_Generic’.

Related: #220

// or crash-loop the enrichment subprocess. Users can opt back in via
// a semantic.providers override in .gortex.yaml.
Args: []string{
"--background-index=false",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@darthghandi --background-index=false has caveats:

It can impact the C/C++ cross-file graph fidelity:

  • find_usages / get_callers on a C/C++ function -> only same-TU callers; call sites in other .cpp files are not found. Ambiguous call edges never get confirmed to the lsp_resolved tier, so min_tier filtering drops them → missing caller edges.
  • find_implementations -> misses implementers in other files.
  • Type hierarchy -> misses subtypes defined elsewhere.

I want to benchmark it before accepting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants