Example #1
0
 public CodeActionsHandler(
     CodeActionsCache codeActionsCache,
     ICodeFixService codeFixService,
     ICodeRefactoringService codeRefactoringService)
 {
     _codeActionsCache       = codeActionsCache;
     _codeFixService         = codeFixService;
     _codeRefactoringService = codeRefactoringService;
 }
Example #2
0
        public override ImmutableArray <IRequestHandler> CreateRequestHandlers()
        {
            var codeActionsCache = new CodeActionsCache();

            return(ImmutableArray.Create <IRequestHandler>(
                       new CodeActionsHandler(codeActionsCache, _codeFixService, _codeRefactoringService),
                       new CodeActionResolveHandler(codeActionsCache, _codeFixService, _codeRefactoringService),
                       new RunCodeActionHandler(codeActionsCache, _codeFixService, _codeRefactoringService, _threadingContext)));
        }
        public override ImmutableArray <IRequestHandler> CreateRequestHandlers(WellKnownLspServerKinds serverKind)
        {
            var codeActionsCache = new CodeActionsCache();

            return(ImmutableArray.Create <IRequestHandler>(
                       new CodeActionsHandler(codeActionsCache, _codeFixService, _codeRefactoringService, _globalOptions),
                       new CodeActionResolveHandler(codeActionsCache, _codeFixService, _codeRefactoringService, _globalOptions),
                       new RunCodeActionHandler(codeActionsCache, _codeFixService, _codeRefactoringService, _globalOptions, _threadingContext)));
        }
 public CodeActionsHandler(
     CodeActionsCache codeActionsCache,
     ICodeFixService codeFixService,
     ICodeRefactoringService codeRefactoringService,
     IGlobalOptionService globalOptions)
 {
     _codeActionsCache       = codeActionsCache;
     _codeFixService         = codeFixService;
     _codeRefactoringService = codeRefactoringService;
     _globalOptions          = globalOptions;
 }
Example #5
0
 public RunCodeActionHandler(
     CodeActionsCache codeActionsCache,
     ICodeFixService codeFixService,
     ICodeRefactoringService codeRefactoringService,
     IThreadingContext threadingContext)
 {
     _codeActionsCache       = codeActionsCache;
     _codeFixService         = codeFixService;
     _codeRefactoringService = codeRefactoringService;
     _threadingContext       = threadingContext;
 }
Example #6
0
 public CodeActionResolveHandler(
     CodeActionsCache codeActionsCache,
     ICodeFixService codeFixService,
     ICodeRefactoringService codeRefactoringService,
     ILspSolutionProvider solutionProvider)
     : base(solutionProvider)
 {
     _codeActionsCache       = codeActionsCache;
     _codeFixService         = codeFixService;
     _codeRefactoringService = codeRefactoringService;
 }
Example #7
0
        private static async Task RunCodeActionsAndAssertActionsInCacheAsync(
            Workspace workspace,
            CodeActionsCache cache,
            LSP.Location caretLocation,
            Document document)
        {
            await RunGetCodeActionsAsync(workspace.CurrentSolution, caretLocation);

            var cacheResults = await cache.GetActionSetsAsync(document, caretLocation.Range, CancellationToken.None);

            Assert.NotNull(cacheResults);
        }
Example #8
0
        private static async Task RunCodeActionsAndAssertActionsInCacheAsync(
            TestLspServer testLspServer,
            CodeActionsCache cache,
            LSP.Location caretLocation,
            Document document)
        {
            await RunGetCodeActionsAsync(testLspServer, caretLocation);

            var cacheResults = await cache.GetActionSetsAsync(document, caretLocation.Range, CancellationToken.None);

            Assert.NotNull(cacheResults);
        }
 public RunCodeActionHandler(
     CodeActionsCache codeActionsCache,
     ICodeFixService codeFixService,
     ICodeRefactoringService codeRefactoringService,
     ILspSolutionProvider solutionProvider,
     IThreadingContext threadingContext)
 {
     _codeActionsCache       = codeActionsCache;
     _codeFixService         = codeFixService;
     _codeRefactoringService = codeRefactoringService;
     _solutionProvider       = solutionProvider;
     _threadingContext       = threadingContext;
 }
Example #10
0
 public TestAccessor(CodeActionsCache codeActionsCache) =>