Apply suggestions from code review

This commit is contained in:
David Wengier 2024-09-02 15:34:32 +10:00 коммит произвёл GitHub
Родитель a336b7fe2b
Коммит 55c51a3a9d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 3 добавлений и 8 удалений

Просмотреть файл

@ -199,21 +199,16 @@ internal class RazorFormattingService : IRazorFormattingService
public bool TryGetOnTypeFormattingTriggerKind(RazorCodeDocument codeDocument, int hostDocumentIndex, string triggerCharacter, out RazorLanguageKind triggerCharacterKind)
{
triggerCharacterKind = _documentMappingService.GetLanguageKind(codeDocument, hostDocumentIndex, rightAssociative: false);
if (triggerCharacterKind is not (RazorLanguageKind.CSharp or RazorLanguageKind.Html))
{
return false;
}
if (triggerCharacterKind == RazorLanguageKind.CSharp)
if (triggerCharacterKind is RazorLanguageKind.CSharp)
{
return s_csharpTriggerCharacterSet.Contains(triggerCharacter);
}
else if (triggerCharacterKind == RazorLanguageKind.Html)
else if (triggerCharacterKind is RazorLanguageKind.Html)
{
return s_htmlTriggerCharacterSet.Contains(triggerCharacter);
}
return true;
return false;
}
private async Task<TextEdit[]> ApplyFormattedEditsAsync(