• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DocumentSymbolParams类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.lsp4j.DocumentSymbolParams的典型用法代码示例。如果您正苦于以下问题:Java DocumentSymbolParams类的具体用法?Java DocumentSymbolParams怎么用?Java DocumentSymbolParams使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DocumentSymbolParams类属于org.eclipse.lsp4j包,在下文中一共展示了DocumentSymbolParams类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testDocumentSymbol

import org.eclipse.lsp4j.DocumentSymbolParams; //导入依赖的package包/类
protected void testDocumentSymbol(final Procedure1<? super DocumentSymbolConfiguraiton> configurator) {
  try {
    @Extension
    final DocumentSymbolConfiguraiton configuration = new DocumentSymbolConfiguraiton();
    configuration.setFilePath(("MyModel." + this.fileExtension));
    configurator.apply(configuration);
    final String fileUri = this.initializeContext(configuration).getUri();
    TextDocumentIdentifier _textDocumentIdentifier = new TextDocumentIdentifier(fileUri);
    DocumentSymbolParams _documentSymbolParams = new DocumentSymbolParams(_textDocumentIdentifier);
    final CompletableFuture<List<? extends SymbolInformation>> symbolsFuture = this.languageServer.documentSymbol(_documentSymbolParams);
    final List<? extends SymbolInformation> symbols = symbolsFuture.get();
    Procedure1<? super List<? extends SymbolInformation>> _assertSymbols = configuration.getAssertSymbols();
    boolean _tripleNotEquals = (_assertSymbols != null);
    if (_tripleNotEquals) {
      configuration.getAssertSymbols().apply(symbols);
    } else {
      final String actualSymbols = this.toExpectation(symbols);
      this.assertEquals(configuration.getExpectedSymbols(), actualSymbols);
    }
  } catch (Throwable _e) {
    throw Exceptions.sneakyThrow(_e);
  }
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:24,代码来源:AbstractLanguageServerTest.java


示例2: documentSymbol

import org.eclipse.lsp4j.DocumentSymbolParams; //导入依赖的package包/类
@Override
public CompletableFuture<List<? extends SymbolInformation>> documentSymbol(final DocumentSymbolParams params) {
  final Function1<CancelIndicator, List<? extends SymbolInformation>> _function = (CancelIndicator cancelIndicator) -> {
    final URI uri = this._uriExtensions.toUri(params.getTextDocument().getUri());
    final IResourceServiceProvider resourceServiceProvider = this.languagesRegistry.getResourceServiceProvider(uri);
    DocumentSymbolService _get = null;
    if (resourceServiceProvider!=null) {
      _get=resourceServiceProvider.<DocumentSymbolService>get(DocumentSymbolService.class);
    }
    final DocumentSymbolService documentSymbolService = _get;
    if ((documentSymbolService == null)) {
      return CollectionLiterals.<SymbolInformation>emptyList();
    }
    final Function2<Document, XtextResource, List<? extends SymbolInformation>> _function_1 = (Document document, XtextResource resource) -> {
      return documentSymbolService.getSymbols(document, resource, params, cancelIndicator);
    };
    return this.workspaceManager.<List<? extends SymbolInformation>>doRead(uri, _function_1);
  };
  return this.requestManager.<List<? extends SymbolInformation>>runRead(_function);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:21,代码来源:LanguageServerImpl.java


示例3: actionPerformed

import org.eclipse.lsp4j.DocumentSymbolParams; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
  DocumentSymbolParams paramsDTO = dtoFactory.createDto(DocumentSymbolParams.class);
  TextDocumentIdentifier identifierDTO = dtoFactory.createDto(TextDocumentIdentifier.class);
  identifierDTO.setUri(
      editorAgent.getActiveEditor().getEditorInput().getFile().getLocation().toString());
  paramsDTO.setTextDocument(identifierDTO);
  activeEditor = (TextEditor) editorAgent.getActiveEditor();
  cursorPosition = activeEditor.getDocument().getCursorPosition();
  client
      .documentSymbol(paramsDTO)
      .then(
          arg -> {
            cachedItems = arg;
            presenter.run(GoToSymbolAction.this);
          })
      .catchError(
          arg -> {
            notificationManager.notify(
                "Can't fetch document symbols.",
                arg.getMessage(),
                StatusNotification.Status.FAIL,
                StatusNotification.DisplayMode.FLOAT_MODE);
          });
}
 
开发者ID:eclipse,项目名称:che,代码行数:26,代码来源:GoToSymbolAction.java


示例4: documentSymbol

import org.eclipse.lsp4j.DocumentSymbolParams; //导入依赖的package包/类
@Override
public CompletableFuture<List<? extends SymbolInformation>> documentSymbol(
    final DocumentSymbolParams params) {
  List<? extends SymbolInformation> result =
      som.getSymbolInfo(params.getTextDocument().getUri());
  return CompletableFuture.completedFuture(result);
}
 
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:8,代码来源:SomLanguageServer.java


示例5: documentSymbol

import org.eclipse.lsp4j.DocumentSymbolParams; //导入依赖的package包/类
public List<? extends SymbolInformation> documentSymbol(DocumentSymbolParams params,
		IProgressMonitor monitor) {
	ITypeRoot unit = JDTUtils.resolveTypeRoot(params.getTextDocument().getUri());
	if (unit == null) {
		return Collections.emptyList();
	}
	SymbolInformation[] elements = this.getOutline(unit, monitor);
	return Arrays.asList(elements);
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:10,代码来源:DocumentSymbolHandler.java


示例6: getSymbols

import org.eclipse.lsp4j.DocumentSymbolParams; //导入依赖的package包/类
private List<? extends SymbolInformation> getSymbols(String className)
		throws JavaModelException, UnsupportedEncodingException, InterruptedException, ExecutionException {
	String uri = ClassFileUtil.getURI(project, className);
	TextDocumentIdentifier identifier = new TextDocumentIdentifier(uri);
	DocumentSymbolParams params = new DocumentSymbolParams();
	params.setTextDocument(identifier);
	List<? extends SymbolInformation> symbols = handler.documentSymbol(params, monitor);
	assertTrue(symbols.size() > 0);
	return symbols;
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:11,代码来源:DocumentSymbolHandlerTest.java


示例7: documentSymbol

import org.eclipse.lsp4j.DocumentSymbolParams; //导入依赖的package包/类
@Override
public CompletableFuture<List<? extends SymbolInformation>> documentSymbol(DocumentSymbolParams params) {
	LOGGER.info("documentSymbol: " + params.getTextDocument());
	return CompletableFuture.completedFuture(Collections.emptyList());
}
 
开发者ID:lhein,项目名称:camel-language-server,代码行数:6,代码来源:CamelTextDocumentService.java


示例8: documentSymbol

import org.eclipse.lsp4j.DocumentSymbolParams; //导入依赖的package包/类
@Override
public CompletableFuture<List<? extends SymbolInformation>> documentSymbol(DocumentSymbolParams params) {
	logInfo(">> document/documentSymbol");
	DocumentSymbolHandler handler = new DocumentSymbolHandler();
	return computeAsync((cc) -> handler.documentSymbol(params, toMonitor(cc)));
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:7,代码来源:JDTLanguageServer.java


示例9: getSymbols

import org.eclipse.lsp4j.DocumentSymbolParams; //导入依赖的package包/类
public List<? extends SymbolInformation> getSymbols(final Document document, final XtextResource resource, final DocumentSymbolParams params, final CancelIndicator cancelIndicator) {
  return this.getSymbols(resource, cancelIndicator);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:4,代码来源:DocumentSymbolService.java


示例10: documentSymbol

import org.eclipse.lsp4j.DocumentSymbolParams; //导入依赖的package包/类
@Override
public CompletableFuture<List<? extends SymbolInformation>> documentSymbol(DocumentSymbolParams params) {
	throw new UnsupportedOperationException();
}
 
开发者ID:eclipse,项目名称:lsp4j,代码行数:5,代码来源:MockLanguageServer.java


示例11: documentSymbol

import org.eclipse.lsp4j.DocumentSymbolParams; //导入依赖的package包/类
@Override
public CompletableFuture<List<? extends SymbolInformation>> documentSymbol(
    DocumentSymbolParams params) {
  return null;
}
 
开发者ID:eclipse,项目名称:che,代码行数:6,代码来源:MavenTextDocumentService.java


示例12: configureMethods

import org.eclipse.lsp4j.DocumentSymbolParams; //导入依赖的package包/类
@PostConstruct
public void configureMethods() {
  dtoToDtoList(
      "definition", TextDocumentPositionParams.class, LocationDto.class, this::definition);
  dtoToDtoList("codeAction", CodeActionParams.class, CommandDto.class, this::codeAction);
  dtoToDtoList(
      "documentSymbol",
      DocumentSymbolParams.class,
      SymbolInformationDto.class,
      this::documentSymbol);
  dtoToDtoList("formatting", DocumentFormattingParams.class, TextEditDto.class, this::formatting);
  dtoToDtoList(
      "rangeFormatting",
      DocumentRangeFormattingParams.class,
      TextEditDto.class,
      this::rangeFormatting);
  dtoToDtoList("references", ReferenceParams.class, LocationDto.class, this::references);
  dtoToDtoList(
      "onTypeFormatting",
      DocumentOnTypeFormattingParams.class,
      TextEditDto.class,
      this::onTypeFormatting);

  dtoToDto(
      "completionItem/resolve",
      ExtendedCompletionItem.class,
      ExtendedCompletionItemDto.class,
      this::completionItemResolve);
  dtoToDto(
      "documentHighlight",
      TextDocumentPositionParams.class,
      DocumentHighlight.class,
      this::documentHighlight);
  dtoToDto(
      "completion",
      TextDocumentPositionParams.class,
      ExtendedCompletionListDto.class,
      this::completion);
  dtoToDto("hover", TextDocumentPositionParams.class, HoverDto.class, this::hover);
  dtoToDto(
      "signatureHelp",
      TextDocumentPositionParams.class,
      SignatureHelpDto.class,
      this::signatureHelp);

  dtoToDto("rename", RenameParams.class, RenameResultDto.class, this::rename);

  dtoToNothing("didChange", DidChangeTextDocumentParams.class, this::didChange);
  dtoToNothing("didClose", DidCloseTextDocumentParams.class, this::didClose);
  dtoToNothing("didOpen", DidOpenTextDocumentParams.class, this::didOpen);
  dtoToNothing("didSave", DidSaveTextDocumentParams.class, this::didSave);
}
 
开发者ID:eclipse,项目名称:che,代码行数:53,代码来源:TextDocumentService.java


示例13: documentSymbol

import org.eclipse.lsp4j.DocumentSymbolParams; //导入依赖的package包/类
/**
 * The document symbol request is sent from the client to the server to list
 * all symbols found in a given text document.
 * 
 * Registration Options: TextDocumentRegistrationOptions
 */
@JsonRequest
CompletableFuture<List<? extends SymbolInformation>> documentSymbol(DocumentSymbolParams params);
 
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:9,代码来源:TextDocumentService.java


示例14: documentSymbol

import org.eclipse.lsp4j.DocumentSymbolParams; //导入依赖的package包/类
/**
 * GWT client implementation of {@link TextDocumentService#documentSymbol(DocumentSymbolParams)}
 *
 * @param params
 * @return
 */
public Promise<List<SymbolInformation>> documentSymbol(DocumentSymbolParams params) {
  return transmitDtoAndReceiveDtoList(
      params, "textDocument/documentSymbol", SymbolInformation.class);
}
 
开发者ID:eclipse,项目名称:che,代码行数:11,代码来源:TextDocumentServiceClient.java



注:本文中的org.eclipse.lsp4j.DocumentSymbolParams类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EphemeralNode类代码示例发布时间:2022-05-23
下一篇:
Java VCFFilterHeaderLine类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap