Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikMennen committed Dec 15, 2023
1 parent c9cb9d4 commit 92f0c28
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
2 changes: 2 additions & 0 deletions src/OneWare.ProjectExplorer/Services/FileWatchInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public FileWatchInstance(IFile file, IDockService dockService, ISettingsService
_dockService = dockService;
_windowService = windowService;

if (!File.Exists(file.FullPath)) return;

try
{
_fileSystemWatcher = new FileSystemWatcher(Path.GetDirectoryName(file.FullPath)!)
Expand Down
30 changes: 17 additions & 13 deletions src/OneWare.SDK/LanguageService/TypeAssistanceLanguageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Avalonia.Controls;
using Avalonia.Controls.Primitives.PopupPositioning;
using Avalonia.Input;
using Avalonia.Media;
using Avalonia.Threading;
using AvaloniaEdit;
using AvaloniaEdit.CodeCompletion;
Expand All @@ -20,6 +21,7 @@
using OneWare.SDK.Services;
using OneWare.SDK.ViewModels;
using OneWare.SDK.Extensions;
using OneWare.SDK.Helpers;
using Prism.Ioc;
using CompletionList = OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionList;
using IFile = OneWare.SDK.Models.IFile;
Expand Down Expand Up @@ -509,20 +511,22 @@ protected virtual void TextEnteredAutoFormat(TextInputEventArgs e)
protected virtual async Task UpdateSymbolsAsync()
{
LastDocumentSymbols = await Service.RequestSymbolsAsync(CurrentFile.FullPath);

return;

// if (LastDocumentSymbols is not null)
// {
// var segments = LastDocumentSymbols
// .Where(x => x.IsDocumentSymbolInformation && x.SymbolInformation != null)
// .Select(x => x.SymbolInformation!.Location.Range.GenerateTextModification(Editor.CurrentDocument, Brushes.Chocolate))
// .ToArray();
//
// Editor.Editor.ModificationService.SetModification("symbol", segments);
// }
// else
// {
// Editor.Editor.ModificationService.ClearModification("symbols");
// }
if (LastDocumentSymbols is not null)

Check warning on line 517 in src/OneWare.SDK/LanguageService/TypeAssistanceLanguageService.cs

View workflow job for this annotation

GitHub Actions / build

Unreachable code detected
{
var segments = LastDocumentSymbols
.Where(x => x.IsDocumentSymbolInformation && x.SymbolInformation != null)
.Select(x => x.SymbolInformation!.Location.Range.GenerateTextModification(Editor.CurrentDocument, Brushes.Chocolate))
.ToArray();

Editor.Editor.ModificationService.SetModification("symbol", segments);
}
else
{
Editor.Editor.ModificationService.ClearModification("symbols");
}
}

protected virtual async Task ShowSignatureHelpAsync(SignatureHelpTriggerKind triggerKind, string? triggerChar, bool retrigger, SignatureHelp? activeSignatureHelp)
Expand Down

0 comments on commit 92f0c28

Please sign in to comment.