Skip to content

Commit

Permalink
Fixes for omnisharp update
Browse files Browse the repository at this point in the history
  • Loading branch information
gfs committed Oct 11, 2023
1 parent ca4f552 commit 20aff92
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal class TextDocumentSyncHandler : TextDocumentSyncHandlerBase
{
private readonly ILogger<TextDocumentSyncHandler> _logger;
private readonly ILanguageServerFacade _facade;
private readonly DocumentSelector _documentSelector = DocumentSelector.ForLanguage(StaticScannerSettings.RuleProcessorOptions.Languages.GetNames());
private readonly TextDocumentSelector _documentSelector = TextDocumentSelector.ForLanguage(StaticScannerSettings.RuleProcessorOptions.Languages.GetNames());
private DevSkimRuleProcessor _processor => StaticScannerSettings.Processor;

public TextDocumentSyncHandler(ILogger<TextDocumentSyncHandler> logger, ILanguageServerFacade facade)
Expand Down Expand Up @@ -190,13 +190,6 @@ public override async Task<Unit> Handle(DidSaveTextDocumentParams request, Cance
return Unit.Value;
}

protected override TextDocumentSyncRegistrationOptions CreateRegistrationOptions(SynchronizationCapability capability, ClientCapabilities clientCapabilities) => new TextDocumentSyncRegistrationOptions()
{
DocumentSelector = _documentSelector,
Change = Change,
Save = new SaveOptions() { IncludeText = true }
};

public override TextDocumentAttributes GetTextDocumentAttributes(DocumentUri uri)
{
if (StaticScannerSettings.RuleProcessorOptions.Languages.FromFileNameOut(uri.GetFileSystemPath(), out LanguageInfo Info))
Expand All @@ -205,5 +198,12 @@ public override TextDocumentAttributes GetTextDocumentAttributes(DocumentUri uri
}
return new TextDocumentAttributes(uri, "unknown");
}

protected override TextDocumentSyncRegistrationOptions CreateRegistrationOptions(TextSynchronizationCapability capability, ClientCapabilities clientCapabilities) => new TextDocumentSyncRegistrationOptions()
{
DocumentSelector = _documentSelector,
Change = Change,
Save = new SaveOptions() { IncludeText = true }
};
}
}

0 comments on commit 20aff92

Please sign in to comment.