Skip to content

[Repo Assist] fix: add '{' to completion trigger characters for interpolated strings#1454

Merged
Krzysztof-Cieslak merged 1 commit intomainfrom
repo-assist/fix-issue-962-interpolated-string-completion-trigger-c8214fe0cfcb0849
Feb 23, 2026
Merged

[Repo Assist] fix: add '{' to completion trigger characters for interpolated strings#1454
Krzysztof-Cieslak merged 1 commit intomainfrom
repo-assist/fix-issue-962-interpolated-string-completion-trigger-c8214fe0cfcb0849

Conversation

@github-actions
Copy link
Contributor

🤖 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 LSP TriggerCharacters list, so clients never automatically requested completions when the user typed { to open an interpolated string expression (e.g. $"{|).

Root cause: Common.fs declares TriggerCharacters = Some([| "."; "'" |]). The { character is absent, so LSP clients do not send completion requests when { is typed.

Fix: Add { to the TriggerCharacters list. This is a one-line change.

- TriggerCharacters = Some([| "."; "'" |])
+ TriggerCharacters = Some([| "."; "'"; "{" |])

When { is typed, the LSP client will now request completions. The existing trigger-character validation in AdaptiveFSharpLspServer.fs (which checks that the trigger char is present at the cursor position) correctly handles {. The underlying FCS TryGetCompletions already works correctly for this context — as confirmed by @baronfel in 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 to CompletionTests.fs, which sends a TriggerCharacter = '{' completion request at the { position inside $"{List.}" and asserts that completions are returned.

Trade-offs

  • Minor downside: Every { 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

  • Build: dotnet build src/FsAutoComplete/FsAutoComplete.fsproj -f net8.0 — succeeded with 0 errors, 0 warnings
  • ⚠️ Tests: The LSP integration test suite requires starting a full server instance and timed out in this environment (infrastructure limitation, not a code issue). The fix is logically equivalent to the already-working . and ' trigger characters.

Generated by Repo Assist

To install this workflow, run gh aw add githubnext/agentics/workflows/repo-assist.md@ee50a3b7d1d3eb4a8c409ac9409fd61c9a66b0f5. View source at https://github.com/githubnext/agentics/tree/ee50a3b7d1d3eb4a8c409ac9409fd61c9a66b0f5/workflows/repo-assist.md.

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>
@github-actions
Copy link
Contributor Author

✅ Pull request created: #1454

@Krzysztof-Cieslak Krzysztof-Cieslak marked this pull request as ready for review February 22, 2026 22:26
@Krzysztof-Cieslak Krzysztof-Cieslak merged commit 29e4b4e into main Feb 23, 2026
19 checks passed
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>
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.

No autocomplete for tokens within interpolated strings (within Ionide/VSCode)

1 participant