當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript vscode-languageserver.SymbolInformation類代碼示例

本文整理匯總了TypeScript中vscode-languageserver.SymbolInformation的典型用法代碼示例。如果您正苦於以下問題:TypeScript SymbolInformation類的具體用法?TypeScript SymbolInformation怎麽用?TypeScript SymbolInformation使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了SymbolInformation類的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();

  }));
開發者ID:smizell,項目名稱:vscode-apielements,代碼行數:32,代碼來源:refractUtils.ts

示例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));

    }

  });
開發者ID:XVincentX,項目名稱:vscode-apielements,代碼行數:66,代碼來源:refractUtils.ts

示例3:

 let res = externals.map(external => {
     return SymbolInformation.create(external.name, util.formEmptyKind(), util.formEmptyRange(), util.formExternalUri(external));
 });
開發者ID:antonina-cherednichenko,項目名稱:poc-jslang-server,代碼行數:3,代碼來源:connection.ts


注:本文中的vscode-languageserver.SymbolInformation類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。