private ImmutableArray <ISignatureHelpProviderWrapper> CreateDefaultSignatureHelpProviders() { return(ImmutableArray.CreateRange( RoslynReflectionFast.GetSignatureHelpProvidersSlow(_hostServices) .Where(l => l.Metadata.Language == Name) .Select(l => l.Value) )); }
public async Task <ImmutableArray <Diagnostic> > GetDiagnosticsAsync(CancellationToken cancellationToken) { var compilation = await Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false); var solution = Project.Solution; if (_lastWorkspaceAnalyzerOptionsSolution != solution) { _workspaceAnalyzerOptions = RoslynReflectionFast.NewWorkspaceAnalyzerOptions(EmptyAnalyzerOptions, EmptyOptionSet, solution); _lastWorkspaceAnalyzerOptionsSolution = solution; } return(await compilation.WithAnalyzers(Analyzers, _workspaceAnalyzerOptions, cancellationToken) .GetAllDiagnosticsAsync(cancellationToken) .ConfigureAwait(false)); }
private static void WriteActions(IFastJsonWriter writer, ImmutableArray <CodeAction> actions, WorkSession session) { var roslynSession = session.Roslyn; foreach (var action in actions) { if (action is CodeActionWithOptions) { continue; } if (RoslynReflectionFast.IsInlinable(action)) { WriteActions(writer, RoslynReflectionFast.GetNestedCodeActions(action), session); continue; } var id = roslynSession.CurrentCodeActions.Count; roslynSession.CurrentCodeActions.Add(action); writer.WriteStartObject(); writer.WriteProperty("id", id); writer.WriteProperty("title", action.Title); writer.WriteEndObject(); } }