Skip to content

Commit

Permalink
Check allowed trigger characters before delegating to other languages…
Browse files Browse the repository at this point in the history
…/servers
  • Loading branch information
alexgav committed Aug 14, 2024
1 parent 601e050 commit 36a3d5a
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,18 @@ private async ValueTask<Response> TryResolveInsertionAsync(
}
else if (languageKind is RazorLanguageKind.Html)
{
return Response.CallHtml;
return AutoInsertService.HtmlAllowedAutoInsertTriggerCharacters.Contains(character)
? Response.CallHtml
: Response.NoFurtherHandling;
}

// C# case

if (!AutoInsertService.CSharpAllowedAutoInsertTriggerCharacters.Contains(character))
{
return Response.NoFurtherHandling;
}

var csharpDocument = codeDocument.GetCSharpDocument();
if (_documentMappingService.TryMapToGeneratedDocumentPosition(csharpDocument, index, out var mappedPosition, out _))
{
Expand Down

0 comments on commit 36a3d5a

Please sign in to comment.