Ejemplo n.º 1
0
        public async Task <LSP.VSCodeAction[]> HandleRequestAsync(
            LSP.CodeActionParams request,
            RequestContext context,
            CancellationToken cancellationToken
            )
        {
            var document = context.Document;

            if (document == null)
            {
                return(Array.Empty <VSCodeAction>());
            }

            var codeActions = await CodeActionHelpers
                              .GetVSCodeActionsAsync(
                request,
                _codeActionsCache,
                document,
                _codeFixService,
                _codeRefactoringService,
                cancellationToken
                )
                              .ConfigureAwait(false);

            return(codeActions);
        }
Ejemplo n.º 2
0
        public async Task <LSP.CodeAction[]> HandleRequestAsync(LSP.CodeActionParams request, RequestContext context, CancellationToken cancellationToken)
        {
            var document = context.Document;

            Contract.ThrowIfNull(document);

            var codeActions = await CodeActionHelpers.GetVSCodeActionsAsync(
                request, _codeActionsCache, document, _codeFixService, _codeRefactoringService, cancellationToken).ConfigureAwait(false);

            return(codeActions);
        }
Ejemplo n.º 3
0
        public override async Task <LSP.VSCodeAction[]> HandleRequestAsync(LSP.CodeActionParams request, RequestContext context, CancellationToken cancellationToken)
        {
            var document = SolutionProvider.GetDocument(request.TextDocument, context.ClientName);

            if (document == null)
            {
                return(Array.Empty <VSCodeAction>());
            }

            var codeActions = await CodeActionHelpers.GetVSCodeActionsAsync(
                request, document, _codeFixService, _codeRefactoringService, _threadingContext,
                request.Range, cancellationToken).ConfigureAwait(false);

            return(codeActions);
        }