Skip to content

[Repo Assist] feat: enhance textDocument/implementation for .fsi ↔ .fs navigation#1494

Draft
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/feature-1473-go-to-signature-file-20260308-144fc246c599a377
Draft

[Repo Assist] feat: enhance textDocument/implementation for .fsi ↔ .fs navigation#1494
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/feature-1473-go-to-signature-file-20260308-144fc246c599a377

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Mar 9, 2026

🤖 This PR was created by Repo Assist, an automated AI assistant.

Closes #1473

Summary

This enhances TextDocumentImplementation (textDocument/implementation) to support bi-directional navigation between .fs implementation files and .fsi signature files, using FCS-provided symbol properties.

Behaviour

Current file Symbol has… Result
.fsi ImplementationLocation Navigates to .fs implementation
.fs SignatureLocation pointing to .fsi Navigates to .fsi signature
Either Neither (e.g. abstract/virtual member) Falls back to existing dispatch-slot implementation lookup

The fallback preserves all existing textDocument/implementation behaviour for virtual/abstract member overrides.

Implementation

FCS already exposes two properties on FSharpSymbol:

  • ImplementationLocation: the .fs location for a symbol declared in a .fsi file
  • SignatureLocation: the .fsi location for a symbol defined in a .fs file

The change (in AdaptiveFSharpLspServer.fs, TextDocumentImplementation override):

  1. Resolves the symbol at the cursor position
  2. Checks whether the current file is a .fsi → if so, uses ImplementationLocation
  3. Otherwise checks if SignatureLocation points to a .fsi file → navigates there
  4. Falls back to the existing Commands.symbolImplementationProject path when neither applies

Test Status

Build: ✅ dotnet build src/FsAutoComplete/FsAutoComplete.fsproj -c Release — 0 warnings, 0 errors
Format: ✅ dotnet fantomas applied; re-build passes
Full test suite: deferred to CI (the change is in the LSP handler layer; no existing tests cover this code path directly)

Generated by Repo Assist

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f

…fixes #1473)

TextDocumentImplementation now supports bi-directional navigation between
.fs implementation files and .fsi signature files via FCS-provided properties:

- In a .fsi file: navigating to the .fs implementation uses
  symbol.ImplementationLocation (already available from FCS)
- In a .fs file: navigating to the .fsi signature uses
  symbol.SignatureLocation (filtered to ensure it's actually a .fsi file)

When neither location is available (e.g., no paired signature file, or
the symbol is abstract/virtual), the existing dispatch-slot implementation
lookup runs as a fallback, preserving existing behaviour.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor Author

🤖 Repo Assist here.

The 2 macOS failures are not caused by this PR's changes:

  • This PR only modifies 1 file: AdaptiveFSharpLspServer.fs (the textDocument/implementation handler)
  • The failing tests are all in "Go to definition tests.GoTo Tests" — a completely different code path
  • All failures show the same error: Directory not empty : .../GoToTests/obj/Debug — a macOS filesystem cleanup issue where Directory.Delete(path, recursive: false) fails if the directory has pre-existing build artifacts

This is a known intermittent macOS test infrastructure issue, not related to the .fsi ↔ .fs navigation feature. All Linux and Windows runs pass cleanly.

The PR is ready for review on its merits.

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add go-to implementation that would navigate to signature file

0 participants