public CSharpCodeFixes(ICodeAnalysisServices services) : base(services, CodeFixNames.CSharp.ImplementAbstractClass, CodeFixNames.CSharp.ImplementInterface) // NOTE: should we also add CodeFixNames.All.RemoveUnnecessaryImports? { }
public VisualBasicCodeFixes(ICodeAnalysisServices services) : base(services, CodeFixNames.VisualBasic.ImplementAbstractClass, CodeFixNames.VisualBasic.ImplementInterface, CodeFixNames.VisualBasic.AddOverloads) // NOTE: should we also add CodeFixNames.All.RemoveUnnecessaryImports? { }
public static async Task <Document> ApplyVisitors(Document document, ICodeAnalysisServices services, CancellationToken cancellationToken) { #if DEBUG if (Debugger.IsAttached) { cancellationToken = CancellationToken.None; } #endif var language = document.Project.Language; var prepares = services.GetLanguageServices <IDocumentVisitor>(language, DocumentVisitorLayer.Prepare).ToArray(); foreach (var prepare in prepares) { document = await prepare.VisitAsync(document, cancellationToken); } var scaffolds = services.GetLanguageServices <IDocumentVisitor>(language, DocumentVisitorLayer.Scaffold).ToArray(); foreach (var scaffold in scaffolds) { document = await scaffold.VisitAsync(document, cancellationToken); } var rewriters = services.GetLanguageServices <IDocumentVisitor>(language, DocumentVisitorLayer.Rewrite).ToArray(); foreach (var rewriter in rewriters) { document = await rewriter.VisitAsync(document, cancellationToken); } var fixups = services.GetLanguageServices <IDocumentVisitor>(language, DocumentVisitorLayer.Fixup).ToArray(); foreach (var fixup in fixups) { document = await fixup.VisitAsync(document, cancellationToken); } return(document); }
public CSharpCodeFixes(ICodeAnalysisServices services) => analysisServices = services;
/// <summary> /// Gets the first (or none) language service of the given type that matches the parameters. /// See <see cref="ICodeAnalysisServices.GetLanguageServices{TService}(string, string)"/>. /// </summary> /// <typeparam name="TService">The language service type, which should match the <see cref="ExportLanguageServiceAttribute.ServiceType"/> registration attribute.</typeparam> public static TService GetLanguageService <TService>(this ICodeAnalysisServices services, string language, string layer = ServiceLayer.Default) where TService : ILanguageService => services.GetLanguageServices <TService>(language, layer).FirstOrDefault();
/// <summary> /// Gets the first (or none) language service that matches the given parameters. /// See <see cref="ICodeAnalysisServices.GetLanguageServices(string, string, string)"/>. /// </summary> public static ILanguageService GetLanguageService(this ICodeAnalysisServices services, string language, string serviceType, string layer = ServiceLayer.Default) => services.GetLanguageServices(language, serviceType, layer).FirstOrDefault();
protected OverrideVirtualMembers(ICodeAnalysisServices services) => this.services = services;
public VisualBasicProxy(ICodeAnalysisServices services) => this.services = services;
public VisualBasicOverrideVirtualMembers(ICodeAnalysisServices services) : base(services) { }
public CSharpProxy(ICodeAnalysisServices services) => this.services = services;
public VisualBasicParameterFixup(ICodeAnalysisServices services) => this.services = services;
public UpdateProxyCodeFix([Import(AllowDefault = true)] ICodeAnalysisServices analysisServices) : base(analysisServices, Strings.UpdateProxyCodeFix.Title) { }
public CSharpOverrideVirtualMembers(ICodeAnalysisServices services) : base(services) { }
public VisualBasicCodeFixes(ICodeAnalysisServices services) => codeFixService = services.GetWorkspaceService <ICodeFixService>();
protected CodeFixDocumentVisitor(ICodeAnalysisServices services, params string[] codeFixes) { this.codeFixService = services.GetWorkspaceService <ICodeFixService>(); this.codeFixNames = codeFixes; }