[Repo Assist] fix: add '{' to completion trigger characters for interpolated strings#1454
Merged
Krzysztof-Cieslak merged 1 commit intomainfrom Feb 23, 2026
Conversation
Closes #962 Auto-complete did not trigger when typing inside an interpolated string expression. The '{' character was not in the LSP completion trigger characters list, so clients never requested completions when the user typed '{' to open an interpolated string expression (e.g. $"{|"). Manual completion (Ctrl+Space) worked correctly because the underlying FCS TryGetCompletions correctly identifies expression context inside interpolated strings. Adding '{' to TriggerCharacters tells LSP clients to request completion when '{' is typed, enabling auto-complete to activate at the start of interpolated string expressions. This also benefits record expressions, computation expressions, and object expressions where '{' opens an expression context. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
✅ Pull request created: #1454 |
4 tasks
github-actions bot
pushed a commit
that referenced
this pull request
Feb 23, 2026
Summarise changes merged since v0.83.0: - Fix SourceLink go-to-def on .NET 10 Linux (#1441) - Add backgroundServiceProgress config option (#1452) - Fix { trigger char for interpolated strings (#1454) - Fix non-ASCII URI encoding (#1455) - Fix spurious get/set rename (#1453) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
github-actions bot
added a commit
that referenced
this pull request
Feb 24, 2026
Include all PRs merged since v0.83.0: - #1441: Fix SourceLink go-to-def failure on .NET 10 on Linux - #1452: Add FSharp.notifications.backgroundServiceProgress config option - #1449: Fix semantic token multiline range uint32 underflow - #1453: Fix spurious get/set rename in TextDocumentRename - #1454: Fix missing { interpolated string completion trigger - #1455: Fix non-ASCII path encoding in file URIs - #1456: Disable inline values by default to restore pipeline hints - #1457: Fix missing parens in function-type segments in AddExplicitTypeAnnotation - #1458: Fix signature help parameter types showing fully-qualified names - #1463: Fix seealso href/langword XML doc rendering Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Closes #962
Summary
Auto-complete does not trigger when typing inside an interpolated string expression. The
{character was missing from the LSPTriggerCharacterslist, so clients never automatically requested completions when the user typed{to open an interpolated string expression (e.g.$"{|).Root cause:
Common.fsdeclaresTriggerCharacters = Some([| "."; "'" |]). The{character is absent, so LSP clients do not send completion requests when{is typed.Fix: Add
{to theTriggerCharacterslist. This is a one-line change.When
{is typed, the LSP client will now request completions. The existing trigger-character validation inAdaptiveFSharpLspServer.fs(which checks that the trigger char is present at the cursor position) correctly handles{. The underlying FCSTryGetCompletionsalready works correctly for this context — as confirmed by@baronfelin the issue: "I can get a completion list when I manually invoke completions inside a{context (via CTRL + Space)".This also benefits other
{-opened expression contexts: record expressions, computation expressions (async {|), and object expressions.Test
Added
"completion triggered by { in interpolated string"test case toCompletionTests.fs, which sends aTriggerCharacter = '{'completion request at the{position inside$"{List.}"and asserts that completions are returned.Trade-offs
{keypress will now trigger a completion request in LSP clients that honour trigger characters. In most cases FCS will return relevant completions (record fields, identifiers, computation keywords), so this should generally be helpful, not noisy. If needed, the server can be enhanced to detect non-expression contexts and return an empty list, but that is out of scope here.Test Status
dotnet build src/FsAutoComplete/FsAutoComplete.fsproj -f net8.0— succeeded with 0 errors, 0 warnings.and'trigger characters.