diff --git a/src/OneWare.Essentials/LanguageService/TypeAssistanceLanguageService.cs b/src/OneWare.Essentials/LanguageService/TypeAssistanceLanguageService.cs index 7547424f..02d72a11 100644 --- a/src/OneWare.Essentials/LanguageService/TypeAssistanceLanguageService.cs +++ b/src/OneWare.Essentials/LanguageService/TypeAssistanceLanguageService.cs @@ -14,6 +14,7 @@ using CommunityToolkit.Mvvm.Input; using DynamicData; using DynamicData.Binding; +using ImTools; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OneWare.Essentials.EditorExtensions; using OneWare.Essentials.Extensions; @@ -461,8 +462,10 @@ protected virtual async Task UpdateSemanticTokensAsync() protected virtual async Task UpdateInlayHintsAsync() { + if (CodeBox.Document.LineCount == 0) return; + var inlayHintContainer = - await Service.RequestInlayHintsAsync(CurrentFile.FullPath, new Range(0, 0, CodeBox.Document.LineCount, 0)); + await Service.RequestInlayHintsAsync(CurrentFile.FullPath, new Range(0, 0, CodeBox.Document.LineCount, CodeBox.Document.GetLineByNumber(CodeBox.Document.LineCount).Length)); if (inlayHintContainer is not null) Editor.Editor.InlayHintGenerator.SetInlineHints(inlayHintContainer.Select(x => new InlayHint