Repository navigation
Make completion behavior configurable (unimported namespaces, name suggestions) - #425
Draft
razzmatazz wants to merge 7 commits into
Draft
razzmatazz wants to merge 7 commits into
razzmatazz wants to merge 7 commits into
Conversation
…rable, default on Adds `csharp.completionShowItemsFromUnimportedNamespaces` to re-enable Roslyn's "show items from unimported namespaces" completion behavior, which was previously hardcoded off for performance reasons. The setting defaults to `true`; users on large solutions who hit latency issues can opt back out. 🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-sonnet-5) Co-Authored-By: eca-agent <git@eca.dev>
…n.* and add showNameSuggestions Reworks the flat `csharp.completionShowItemsFromUnimportedNamespaces` setting into a hierarchical `CSharpCompletionConfiguration` (mirroring the existing `csharp.debug.*` group), exposed as `csharp.completion.showItemsFromUnimportedNamespaces`. Also adds `csharp.completion.showNameSuggestions` to control Roslyn's "show name suggestions" completion behavior, defaulting to `false` to match the previous hardcoded value. 🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-sonnet-5) Co-Authored-By: eca-agent <git@eca.dev>
…space completion item Renames `csharp.completion.showItemsFromUnimportedNamespaces` to `csharp.completion.completeUnimportedTypes` to reflect that it now controls both aspects together: showing the item in the completion list *and* inserting the missing `using` (as `additionalTextEdits`) when the item is accepted, instead of leaving the import to be added separately via `textDocument/codeAction`. Roslyn already marks such items `IsComplexTextEdit = true`; on `completionItem/resolve` we now call `CompletionService.GetChangeAsync` for those items and forward every resulting `TextChange` other than the item's own in-place replacement as `AdditionalTextEdits`. Plain (non-complex) completion items are unaffected. 🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-sonnet-5) Co-Authored-By: eca-agent <git@eca.dev>
razzmatazz
force-pushed
the
completion-unimported-namespaces-config
branch
from
September 13, 2026 13:07
d22cd7a to
cb1a5b4
Compare
State the `<type>(<scope>): <summary>` scheme directly instead of only linking to CONTRIBUTING.md#code-style, so it isn't missed when committing.
razzmatazz
added a commit
that referenced
this pull request
Sep 13, 2026
Analyses why textDocument/completion responses balloon to multi-megabyte payloads on every keystroke once unimported-namespace suggestions (completion-unimported-namespaces-config, PR #425) are enabled: handle hardcodes IsIncomplete = true, so VS Code re-requests the full unimported symbol universe on every character instead of filtering the existing list locally. Proposes fixing that first, with debouncing/caching only if profiling shows per-call cost (not repetition) is still the bottleneck.
Plans and other persisted docs sometimes draw on a real session against a user's private solution; capture the standing rule to swap in fictional namespaces/types/file names before committing, keeping this project's own public identifiers exempt.
Roslyn's CompletionList has no incompleteness concept of its own (verified by reflecting over the actual Microsoft.CodeAnalysis.Features assembly this project builds against - no member resembling "there's more, ask again") - it always returns its full candidate set for the current cursor context in one call, expecting the client to filter by filterText as the user keeps typing. Hardcoding IsIncomplete = true here instead made editors re-request the full list - including the unimported-namespace scan - via TriggerForIncompleteCompletions on every keystroke, turning one legitimate completion session into a fresh multi-megabyte recomputation per character typed on large solutions. Update CompletionTests.fs's assertion, which previously codified the old (incorrect) behavior.
razzmatazz
force-pushed
the
completion-unimported-namespaces-config
branch
from
September 13, 2026 14:11
79b18d2 to
9ba6135
Compare
razzmatazz
marked this pull request as draft
October 5, 2026 06:25
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.
Summary
csharp.completion.*configuration group for tuning Roslyn completion behavior that was previously hardcoded:csharp.completion.completeUnimportedTypes(defaulttrue) — suggest types from namespaces not yet imported, and insert the missingusing(viaadditionalTextEdits) when one of those items is accepted. Closes Autoimport with code suggestion. #210csharp.completion.showNameSuggestions(defaultfalse) — suggest identifier names (e.g.stringBuilderafter typingStringBuilder)ShowItemsFromUnimportedNamespaces = false,ShowNameSuggestions = false); defaults now restore/preserve prior UX where sensible while making both configurable for users who hit latency issues on large solutionscompletionItem/resolvenow callsCompletionService.GetChangeAsyncfor completion items Roslyn marksIsComplexTextEdit(e.g. unimported-namespace items) and forwards every resultingTextChangeother than the item's own in-place replacement asAdditionalTextEdits, so accepting such an item also adds the requiredusing— previously onlytextDocument/codeActioncould add itgetRoslynCompletionOptionshelper shared by both the.csand.cshtml(Razor) completion code pathsusing-insertion behavior, plus supporting fixturesCloses #210
🤖 Generated with ECA (anthropic/claude-sonnet-5)