Skip to content

Commit 5b86499

Browse files
Merge pull request #64622 from CyrusNajmabadi/spellCheckingSnippet
Workaround crash in spellchecking in snippet layer
2 parents e4667d4 + ad4b0f8 commit 5b86499

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/EditorFeatures/CSharpTest/Diagnostics/SpellCheck/SpellCheckTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,5 +681,17 @@ void IInterface.this
681681

682682
await TestInRegularAndScriptAsync(text, expected);
683683
}
684+
685+
[Fact, WorkItem(1640728, "https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1640728")]
686+
public async Task TestMisspelledWordThatIsAlsoSnippetName()
687+
{
688+
await TestInRegularAndScriptAsync(
689+
@"public [|interfacce|] IWhatever
690+
{
691+
}",
692+
@"public interface IWhatever
693+
{
694+
}");
695+
}
684696
}
685697
}

src/Features/Core/Portable/Completion/Providers/Snippets/AbstractSnippetCompletionProvider.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ namespace Microsoft.CodeAnalysis.Completion.Providers.Snippets
2020
{
2121
internal abstract class AbstractSnippetCompletionProvider : CompletionProvider
2222
{
23+
internal override bool IsSnippetProvider => true;
24+
2325
public override async Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey = null, CancellationToken cancellationToken = default)
2426
{
2527
// This retrieves the document without the text used to invoke completion

0 commit comments

Comments
 (0)