Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WIP] Implement LSPtextDocument/definition#18679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Copilot wants to merge12 commits intomain
base:main
Choose a base branch
Loading
fromcopilot/fix-18626-992c8f62-9898-4675-b870-016ab4f56618

Conversation

Copilot
Copy link
Contributor

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original issue description:

Implement thetextDocument/definition endpoint for the F# LSP server. This endpoint will provide the "go to definition" functionality.

The LSP specification for this endpoint can be found underthis link.

The implementation should use the F# Compiler Service API:src/Compiler/Service/service.fsi

The current implementation of this feature can serve as a reference point. It is primarily implemented in the VS integration layer, specifically in this filevsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs. The main idea is to parse and check the source file and then use the GetDefinitionLocation method of the checker's result.

Other LSP endpoints in the F# LSP server can be found here for reference:src/FSharp.Compiler.LanguageServer/Handlers/LanguageFeaturesHandler.fs. F# LSP server is using Common Language Server Protocol Framework which contains useful types and methods for handling LSP requests. It's implementation can be found in the Roslyn repo, specificallyhttps://github.com/dotnet/roslyn/tree/main/src/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework

Fixes#18626.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn moreCopilot coding agent tips in the docs.

@abonie
Copy link
Member

@copilot try again with updated setup instructions

@github-actionsGitHub Actions
Copy link
Contributor

✅ No release notes required

Go back to ubuntu but run build.sh
@abonie
Copy link
Member

@copilot I updated setup instructions - try now

Reference Framework assemblies to build on ubuntu
@abonie
Copy link
Member

@copilot I added a reference to framework assemblies to fix the setup step on ubuntu. Try again

@abonie
Copy link
Member

@copilot Please retry

@abonie
Copy link
Member

@copilot Try now

@abonie
Copy link
Member

@copilot Please retry

Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
@CopilotCopilot SWE Agent
Copy link
ContributorAuthor

@copilot Please retry

Done! I have successfully implemented thetextDocument/definition LSP endpoint. The implementation is working and builds successfully.

Key features implemented:

  • HandlestextDocument/definition requests with file URI and position
  • Uses F# Compiler ServiceGetDeclarationLocation API to find symbol definitions
  • Returns proper LSP Location objects with file URIs and ranges
  • Integrates with the existing FSharp workspace infrastructure
  • Follows the same patterns as other LSP handlers in the codebase

The endpoint handles the basic case of local symbol definitions (FindDeclResult.DeclFound). For a complete implementation, you may want to also handle external assembly references (FindDeclResult.ExternalDecl) in a future enhancement.

Commit:4fc6ec6

Copilot finished work on behalf ofabonieJune 16, 2025 18:02
@abonie
Copy link
Member

@copilot Consider what might be missing from this PR. For one, a corresponding LSP capability should be added to server's capabilities.

Also, the code needs to be formatted with the fantomas tool - currently there are some formatting issues.

Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
@CopilotCopilot SWE Agent
Copy link
ContributorAuthor

CopilotAI commentedJun 16, 2025
edited
Loading

@copilot Consider what might be missing from this PR. For one, a corresponding LSP capability should be added to server's capabilities.

Also, the code needs to be formatted with the fantomas tool -...

Fixed both issues! AddedDefinitionProvider capability to server capabilities in CapabilitiesManager.fs and fixed all formatting issues using fantomas. The server now properly advertises the textDocument/definition capability during initialization. Commit:a148ae4

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 1p7vsblobprodcus324.vsblob.vsassets.io
    • Triggering command:/usr/share/dotnet/dotnet msbuild -v:quiet -restore /home/REDACTED/.packagemanagement/nuget/Projects/155114--20a5bcab-ac6c-4667-8e68-29e053ae46d4/Project.fsproj /nologo /t:InteractivePackageManagement (dns block)
  • m8dvsblobprodcus37.vsblob.vsassets.io
    • Triggering command:/usr/share/dotnet/dotnet msbuild -v:quiet -restore /home/REDACTED/.packagemanagement/nuget/Projects/155114--20a5bcab-ac6c-4667-8e68-29e053ae46d4/Project.fsproj /nologo /t:InteractivePackageManagement (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf ofabonieJune 16, 2025 20:26
@T-Gro
Copy link
Member

What are the markdown files in the diff here for?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Labels
None yet
Projects
Status: New
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Implement LSPtextDocument/definition
3 participants
@Copilot@abonie@T-Gro

[8]ページ先頭

©2009-2025 Movatter.jp