Skip to content

Map internal symbols to correct LSP kinds - #4968

Merged
Widthdom merged 7 commits into
mainfrom
fix-issue4870
Jul 29, 2026
Merged

Map internal symbols to correct LSP kinds#4968
Widthdom merged 7 commits into
mainfrom
fix-issue4870

Conversation

@Widthdom

Copy link
Copy Markdown
Owner

Summary

  • Add one exhaustive ordinal mapping from every registered internal symbol kind to LSP SymbolKind and CompletionItemKind, including module-shaped imports and conservative unknown/plugin fallbacks.
  • Route document symbols, workspace symbols, and completion items through the same full-symbol mapping.
  • Refine persisted callable and enum shapes into constructors and enum members only when their language metadata supports that interpretation, including compact/named constructors and escaped identifiers while rejecting same-name methods and ordinary constructor functions.
  • Add decoded protocol-response coverage plus real extractor fixtures across TypeScript, Kotlin, Solidity, Java, Swift, Dart, Visual Basic, Pascal, C#, and Shell.

Root cause and impact

The three LSP surfaces projected broad persisted kinds through incomplete or separate mappings, and some paths did not retain the semantic metadata needed to distinguish constructors and enum members. This caused imports to appear as variables, constructors as functions, and language-specific enum entries to use inconsistent kinds. The shared mapping now keeps all three surfaces aligned.

Validation

  • dotnet build CodeIndex.sln --no-restore — passed with 0 warnings and 0 errors.
  • Issue-specific mapping test — passed on net8.0 and net9.0.
  • Full LspServerTests class — 120/120 passed on both net8.0 and net9.0.
  • dotnet format CodeIndex.sln --no-restore --verify-no-changes — passed.
  • dotnet run --project tools/CodeIndex.Changelog -- check — validated all 41 fragments.
  • git diff --check — passed.
  • Full solution test run completed with only the pre-existing unrelated watcher timing failure RunCore_SubprojectObservesAncestorIgnoreFileChanges_Issue4592: net9.0 had 10,300 passed / 420 skipped / 1 failed; net8.0 had 10,774 passed / 7 skipped / 1 failed. The Issue Map internal symbols to correct LSP symbol and completion kinds #4870 tests and complete LSP test class pass independently on both targets.

Adversarial review

  • Round 1 identified constructor metadata and cross-language enum-entry shape gaps; all findings were addressed with extractor-backed regressions.
  • Round 2 identified over-broad constructor keyword handling, Java return-typed same-name methods, and C# verbatim constructor/enum identifiers; all four findings were addressed and validated.
  • The repository workflow limit of two adversarial review rounds was observed.

Documentation and changelog

  • Updated the English and Japanese LSP mapping contract in DEVELOPER_GUIDE.md.
  • Updated the English and Japanese test contract in TESTING_GUIDE.md.
  • Added bilingual fragment changelog.d/unreleased/4870.fixed.md.

Follow-ups

None within the requested issue scope.

Fixes #4870

@Widthdom
Widthdom marked this pull request as ready for review July 29, 2026 03:41
@Widthdom
Widthdom merged commit 32b8a23 into main Jul 29, 2026
12 checks passed
@Widthdom
Widthdom deleted the fix-issue4870 branch July 29, 2026 03:41
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.

Map internal symbols to correct LSP symbol and completion kinds

1 participant