Skip to content

When the language server doesn't provide a resolve option, return the original codelens - #46

Merged
akosyakov merged 1 commit into
TypeFox:masterfrom
Lokad:for-pr
Jan 31, 2018
Merged

When the language server doesn't provide a resolve option, return the original codelens#46
akosyakov merged 1 commit into
TypeFox:masterfrom
Lokad:for-pr

Conversation

@Twinside

Copy link
Copy Markdown

In browser test shown that monaco still call the resolver in all cases,
so we can't use undefined here.

Thanks for the library :)

…original code lens

In browser test shown that monaco still call the resolver in all cases,
so we can't use undefined.
Comment thread src/languages.ts
const protocolCodeLens = this.m2p.asCodeLens(codeLens);
return provider.resolveCodeLens!(protocolCodeLens, token).then(result => this.p2m.asCodeLens(result))
} : undefined
} : ((m, codeLens, t) => codeLens)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that it is necessary? resolveCodeLens is optional, I assume monaco does it automatically

@Twinside Twinside Jan 31, 2018

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like their is a bug on their side, but I'm not optimistic about the turnaround time, I'll look after making a pull request for them too, from the compiled editor.main.js (line 90163):

            var promises = toResolve.map(function (request, i) {
                var resolvedSymbols = new Array(request.length);
                var promises = request.map(function (request, i) {
                    return async_1.asWinJsPromise(function (token) {
                        return request.provider.resolveCodeLens(model, request.symbol, token);
                    }).then(function (symbol) {
                        resolvedSymbols[i] = symbol;
                    });
                });
                return winjs_base_1.TPromise.join(promises).then(function () {
                    lenses[i].updateCommands(resolvedSymbols);
                });
            });

No care taken for the optionsal resolveCodeLens

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like you are right, please file an issue for monaco-editor as well

@akosyakov
akosyakov merged commit f0f2c10 into TypeFox:master Jan 31, 2018
@akosyakov

Copy link
Copy Markdown
Contributor

@Twinside thank you

@Twinside

Copy link
Copy Markdown
Author

Oh, you already filled a ticket: microsoft/monaco-editor#576

@Twinside
Twinside deleted the for-pr branch March 15, 2018 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants