11 Commits
Author SHA1 Message Date
xor c9f0ab80f1 SolidLSP: admit Struct, Interface and Constant symbols as reference containers (#1831)
find_referencing_symbols degraded to file-level attribution for any
reference located inside a Go struct body, interface body or const
group: request_containing_symbol found no admissible container, so
request_referencing_symbols logged "Could not find containing symbol
... Returning file symbol instead" and fell back to the file symbol,
losing the answer the tool exists to give.

Root cause: the candidate-container filter admitted only Python's
container kinds {Method, Function, Class} (plus Variable via the
one-liner-exempt path). The language server is not at fault:
hierarchicalDocumentSymbolSupport is declared and the DocumentSymbol
tree is complete, but Go structs arrive as SymbolKind.Struct,
interfaces as Interface and const-group members as Constant - none of
which were admitted, so every candidate was rejected.

Fix, mirroring the existing structure of the filter:
- Struct and Interface join the multi-line container whitelist,
- Constant joins Variable on the one-liner-exempt path (const-group
  members are one-liners by nature, exactly like the module-level
  variables that path already serves).

The Python suite shows no attribution change
(test/solidlsp/python/test_symbol_retrieval.py: 80 passed). Languages
whose containers use the added kinds (e.g. Rust and C structs,
TypeScript interfaces) get the same admission; verified for Go and
Python only.

Regression coverage: new Go fixture containment_sample.go with a
const-iota group, a struct field and an interface method all
referencing a named type; four tests assert containing-symbol and
referencing-symbol attribution, and all four fail against the
pre-change ls.py (verified). Full go-marker suite: 21 passed,
1 skipped.
2026-08-09 16:07:20 +02:00
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
Tomi P. Hakala 61cf7c7d38 Fix gopls replace_symbol_body corrupting type/var/const declarations
gopls reports the document-symbol range of single type/var/const
declarations starting at the identifier (after the keyword), unlike func
declarations whose range includes the func keyword. Serena derives both
the displayed body and the replacement range from that range, so the
keyword was dropped from both for these declarations and a
keyword-inclusive edit corrupted the file (type Foo became type type Foo).

Override request_document_symbols in gopls to extend the range start back
to the keyword when only the keyword and indentation precede the
identifier, recomputing the body so it stays consistent with the
replacement range. Funcs, grouped declarations, and selectionRange are
left untouched.

Adds a unit test for the symbol body and range plus an end-to-end
replace_symbol_body round-trip regression test.
2026-07-19 16:12:32 +02:00
Michael Panchenko da59a19c50 Fixes in various LS and in tests to accommodate diagnostics edge behavior
Also minor fix in go test expectations of symbol name
2026-04-29 23:52:26 +02:00
Michael Panchenko c55e0c900e Diagnostics, implementation and definition tools (WIP) 2026-04-29 23:52:26 +02:00
Michael Panchenko d30cdf8474 Fix symbol name resolution in selected LS (#1247)
Adds tests for name resolution for each language and fixes the name resolution where tests have failed.

Also:

Extends python tests to cover ty
Extends skipping conditions for several LS (but only when not in CI)
Better test output in CI
Removed a wrong python test (started failing for ty and should have failed for pyright too)
2026-04-01 16:29:00 +02:00
Michael Panchenko 0bbd9e375e Reformat (minor, after replacing black with ruff)
Black dependency created a dependabot warning and couldn't be bumped since it collided with pathspec dependencies. Since ruff can also format, black is not needed. But we now have these small format changes, mostly in test files
2026-03-23 21:10:41 +01:00
Roman Nikulenkov 1643c14aae refactor(gopls): streamline gopls settings validation and JSON serialization
test(go): add assertions for SolidLanguageServer cache states
2026-01-05 17:00:54 +03:00
Roman Nikulenkov 71d23277da feat(gopls): support gopls_settings via ls_specific_settings
- Forward ls_specific_settings.go.gopls_settings to gopls as LSP initializationOptions (JSON-validated)
- Add cache context fingerprinting so persisted symbol caches are invalidated when Go build context changes (e.g. buildFlags, GOFLAGS, GOOS, GOARCH, CGO_ENABLED)
- Add build-tag fixtures + tests covering tag-dependent symbols and cache invalidation
- Document ls_specific_settings + Go example in configuration docs
2026-01-05 15:58:43 +03:00
Dominik Jain d8cac3aedb Introduce abstraction DocumentSymbols, which is now returned by request_document_symbols 2025-11-12 03:46:18 +01:00
Dominik Jain 719a2c55a8 Update references to multilspy and update READMEs 2025-06-23 20:47:27 +02:00