The code fix provider reads CompletionOptions from Solution snapshot. These options are not configurable via .editorconfig, only in the IDE. Therefore this code fix provider will behave differently when executed from build vs IDE.
|
private async Task CreateSpellCheckCodeIssueAsync( |
|
CodeFixContext context, SyntaxToken nameToken, bool isGeneric, CancellationToken cancellationToken) |
|
{ |
|
var document = context.Document; |
|
var service = CompletionService.GetService(document); |
|
|
|
// Disable snippets and unimported types from ever appearing in the completion items. |
|
// - It's very unlikely the user would ever misspell a snippet, then use spell-checking to fix it, |
|
// then try to invoke the snippet. |
|
// - We believe spell-check should only compare what you have typed to what symbol would be offered here. |
|
var options = CompletionOptions.From(document.Project.Solution.Options, document.Project.Language) with |
|
{ |
|
SnippetsBehavior = SnippetsRule.NeverInclude, |
|
ShowItemsFromUnimportedNamespaces = false, |
|
IsExpandedCompletion = false, |
|
TargetTypedCompletionFilter = false |
|
}; |
The code fix provider reads CompletionOptions from Solution snapshot. These options are not configurable via .editorconfig, only in the IDE. Therefore this code fix provider will behave differently when executed from build vs IDE.
roslyn/src/Features/Core/Portable/SpellCheck/AbstractSpellCheckCodeFixProvider.cs
Lines 106 to 122 in f36574c