提交 f7feb40b 编写于 作者: P Peng Lyu

Fix microsoft/monaco-editor#576. Codelens resolver is optional.

上级 7e6868ca
......@@ -295,11 +295,15 @@ export class CodeLensContribution implements editorCommon.IEditorContribution {
const resolvedSymbols = new Array<ICodeLensSymbol>(request.length);
const promises = request.map((request, i) => {
if (typeof request.provider.resolveCodeLens === 'function') {
return asWinJsPromise((token) => {
return request.provider.resolveCodeLens(model, request.symbol, token);
}).then(symbol => {
resolvedSymbols[i] = symbol;
});
}
resolvedSymbols[i] = request.symbol;
return TPromise.as(void 0);
});
return TPromise.join(promises).then(() => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册