[Repo Assist] Guard Ionide-specific fsharp/ notifications with client capability check#1515
Draft
github-actions[bot] wants to merge 2 commits intomainfrom
Conversation
Only send Ionide-specific fsharp/ notifications (notifyWorkspace, notifyWorkspacePeek, fileParsed, documentAnalyzed, testDetected, etc.) when the client has sent Ionide configuration in InitializationOptions. Other LSP clients (Emacs, Helix, etc.) do not expect these custom fsharp/ notifications and may crash or behave unexpectedly when they receive them. Using the presence of Ionide InitializationOptions as the signal that the client is Ionide-compatible is reliable since Ionide always sends its FSharpConfigDto there. Fixes #1032 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
29 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Fixes #1032 — prevents FSAC from sending Ionide-specific
fsharp/custom notifications to non-Ionide LSP clients (Emacs, Helix, etc.) that don't know how to handle them.Root Cause
FSharpLspClientsends several Ionide-specific custom notifications unconditionally to all clients:fsharp/notifyWorkspacefsharp/notifyWorkspacePeekfsharp/notifyCancelfsharp/fileParsedfsharp/documentAnalyzedfsharp/testDetectedWhen non-Ionide clients (e.g., Emacs
lsp-mode, Helix) receive these unexpected notifications, they may crash or behave erratically since they're not expecting these server-to-client notifications.Fix
Added
SupportsCustomFSharpNotificationsflag toFSharpLspClient. Each of the above notification methods now checks this flag before sending.The flag is set to
trueduringInitializeonly when the client sends Ionide configuration inInitializationOptions. This is a reliable signal for Ionide clients since Ionide always sends itsFSharpConfigDtothere; other LSP clients typically don't.This pattern is already used for
CodeLensRefreshandWindowWorkDoneProgressCreatewhich checkClientCapabilitiesbefore sending.Trade-offs
InitializationOptions.HasValuesas the Ionide detection heuristic: this is the simplest reliable signal available; alternative approaches (checkingClientInfo.Name) could be added in future if neededTest Status
✅ Build succeeded (
dotnet build src/FsAutoComplete/FsAutoComplete.fsproj -f net8.0)✅ General unit tests passed (
FSAC.general.Utilssuite)Full test suite was not run locally (too resource-intensive for this environment) — CI will validate.