本文整理汇总了TypeScript中vscode-languageserver.SymbolInformation.create方法的典型用法代码示例。如果您正苦于以下问题:TypeScript SymbolInformation.create方法的具体用法?TypeScript SymbolInformation.create怎么用?TypeScript SymbolInformation.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vscode-languageserver.SymbolInformation
的用法示例。
在下文中一共展示了SymbolInformation.create方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: createLineReferenceFromSourceMap
return lodash.flatten(queryResults.map((queryResult) => {
const lineReference = createLineReferenceFromSourceMap(
lodash.get(queryResult, refractSymbol.sourceMapPath, []),
document,
documentLines
);
let results = {};
const description = lodash.get(queryResult, refractSymbol.descriptionPath, '');
const lodashChain =
lodash
.chain(refractSymbol.childs)
.map((child) => {
return extractSymbols(queryResult, document, documentLines, child, description);
})
.flatten()
if (!lodash.isEmpty(lineReference)) {
results = SymbolInformation.create(
description,
refractSymbol.symbol,
Range.create(lineReference.startRow, lineReference.startIndex, lineReference.endRow, lineReference.endIndex),
null,
containerName);
return lodashChain.concat(results).value();
}
return lodashChain.value();
}));
示例2: query
return lodash.transform(queryResults, (result, queryResult) => {
/*
WARNING: This might be your reaction when you'll look into this code: 😱
Thing is there is no really source map here and I do not want to solve this
thing in this release. The long term idea would be to wait till the underlying
parser will be updated to generate sourcemaps on generated content as well
and everybody will be happy; till that moment, please bear with me.
*/
let sourceMap;
['meta.title.attributes.sourceMap',
'attributes.href.attributes.sourceMap',
(qs) => query(qs, [{ query: { attributes: { method: {} } }, symbolKind: 0 }]),
].some((path: string | Function): boolean => {
if (typeof (path) === 'function') {
sourceMap = lodash.get((path as Function)(queryResult)[0], 'attributes.method.attributes.sourceMap');
return true;
} else {
if (lodash.has(queryResult, path)) {
sourceMap = lodash.get(queryResult, path);
return true;
}
}
});
const lineReference = createLineReferenceFromSourceMap(
sourceMap,
document,
documentLines,
);
let description = '';
['meta.title.content',
'attributes.href.content',
(qs) => query(qs, [{ query: { attributes: { method: {} } }, symbolKind: 0 }]),
].some((path: string | Function): boolean => {
if (typeof (path) === 'function') {
description = decodeURI(lodash.get((path as Function)(queryResult)[0], 'attributes.method.content'));
return true;
} else {
if (lodash.has(queryResult, path)) {
description = decodeURI(lodash.get(queryResult, path));
return true;
}
}
});
if (!lodash.isEmpty(lineReference)) {
result.push(SymbolInformation.create(
description,
queryResult.symbolKind,
Range.create(
lineReference.startRow,
lineReference.startIndex,
lineReference.endRow,
lineReference.endIndex,
),
null,
queryResult.container));
}
});
示例3:
let res = externals.map(external => {
return SymbolInformation.create(external.name, util.formEmptyKind(), util.formEmptyRange(), util.formExternalUri(external));
});