public override Task <CodeLens> Handle(CodeLens request, CancellationToken cancellationToken)
        {
            // TODO: Catch deserializtion exception on bad object
            CodeLensData codeLensData = request.Data.ToObject <CodeLensData>();

            ICodeLensProvider originalProvider = _symbolsService
                                                 .GetCodeLensProviders()
                                                 .FirstOrDefault(provider => provider.ProviderId.Equals(codeLensData.ProviderId, StringComparison.Ordinal));

            ScriptFile scriptFile = _workspaceService.GetFile(codeLensData.Uri);

            return(originalProvider.ResolveCodeLens(request, scriptFile));
        }
Example #2
0
        public Task <CodeLens> Handle(CodeLens request, CancellationToken cancellationToken)
        {
            // TODO: Catch deserializtion exception on bad object
            CodeLensData codeLensData = request.Data.ToObject <CodeLensData>();

            ICodeLensProvider originalProvider =
                _providers.FirstOrDefault(
                    provider => provider.ProviderId.Equals(codeLensData.ProviderId));

            ScriptFile scriptFile =
                _workspaceService.GetFile(
                    codeLensData.Uri);

            var resolvedCodeLens = originalProvider.ResolveCodeLens(request, scriptFile);

            return(Task.FromResult(resolvedCodeLens));
        }