2 Commits
Author SHA1 Message Date
Dominik Jain d2cf18ddcb Refactoring: Rename Language to LanguageServerId
This resolves a long-standing naming issue in Serena & SolidLSP.
2026-07-22 20:55:36 +02:00
xor c933fd8ec2 SolidLSP: classify missing paths in is_ignored_path instead of raising (#1673)
Language servers can report locations of generated files that are not on
disk. JDTLS does this for Lombok-generated types, reporting e.g.
target/classes/test_repo/LombokModel$LombokModelBuilder.class while
indexing; is_ignored_path then raised FileNotFoundError, turning an
intermittent indexing state into a hard test failure
(test_bare_symbol_names[java]; Tests run #4240, job jvm (macos-latest)).

Changes:
- is_ignored_path classifies missing paths with the usual lexical rules
  instead of raising: ignored-dirname components, the unsupported-extension
  rule, then the configured pathspec. A missing path is treated as a file
  if its name has a suffix and as a directory otherwise (so the leaf of a
  missing suffixless path is also checked against ignored dirnames).
  Behavior for existing paths is unchanged: the checks were reordered
  (ignored-dirname before unsupported-extension), but each check is pure,
  so the outcomes are identical.
- SymbolLocationRequest.convert_location_item skips locations whose
  absolute path does not exist (log + return None), so phantom build
  artifacts never reach consumers regardless of ignore configuration.
- New unit tests (test double, no language server process; they run in
  the catch-all CI batch) pin the missing-path classification — including
  the exact Lombok .class path shape from the CI failure — and the
  skipping of symbol locations that are not on disk.

Notes:
- The removed raise arrived verbatim with the multilspy import (2f607ff2)
  and was never a deliberate guard.
- The Project layer's equivalent check already tolerates missing paths
  (9c19d5f7), but returns False unconditionally. The LS layer instead
  classifies lexically so that LS-reported build artifacts still classify
  as ignored: with #1645 having removed the JDTLS build-dirname ignores,
  it is the unsupported-extension rule that catches *.class paths.
2026-07-12 11:18:27 +02:00