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

Java DidOpenTextDocumentParams类代码示例

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

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



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

示例1: initializeLanguageServer

import org.eclipse.lsp4j.DidOpenTextDocumentParams; //导入依赖的package包/类
protected CamelLanguageServer initializeLanguageServer(String text)
throws URISyntaxException, InterruptedException, ExecutionException {
	InitializeParams params = new InitializeParams();
	params.setProcessId(new Random().nextInt());
	params.setRootUri(getTestResource("/workspace/").toURI().toString());
	CamelLanguageServer camelLanguageServer = new CamelLanguageServer();
	camelLanguageServer.connect(new DummyLanguageClient());
	CompletableFuture<InitializeResult> initialize = camelLanguageServer.initialize(params);
	
	assertThat(initialize).isCompleted();
	assertThat(initialize.get().getCapabilities().getCompletionProvider().getResolveProvider()).isTrue();
	
	camelLanguageServer.getTextDocumentService().didOpen(new DidOpenTextDocumentParams(createTestTextDocument(text)));
	
	return camelLanguageServer;
}
 
开发者ID:lhein,项目名称:camel-language-server,代码行数:17,代码来源:AbstractCamelLanguageServerTest.java


示例2: didOpen

import org.eclipse.lsp4j.DidOpenTextDocumentParams; //导入依赖的package包/类
private void didOpen(DidOpenTextDocumentParams openTextDocumentParams) {
  try {
    String uri = prefixURI(openTextDocumentParams.getTextDocument().getUri());
    openTextDocumentParams.getTextDocument().setUri(uri);
    languageServerRegistry
        .getApplicableLanguageServers(uri)
        .stream()
        .flatMap(Collection::stream)
        .map(InitializedLanguageServer::getServer)
        .forEach(
            server -> {
              server.getTextDocumentService().didOpen(openTextDocumentParams);
            });
  } catch (LanguageServerException e) {
    LOG.error("Error trying to process textDocument/didOpen", e);
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:TextDocumentService.java


示例3: onOpen

import org.eclipse.lsp4j.DidOpenTextDocumentParams; //导入依赖的package包/类
private void onOpen(
    final FileEvent event,
    final DtoFactory dtoFactory,
    final TextDocumentServiceClient serviceClient,
    final LanguageServerRegistry lsRegistry) {
  event
      .getFile()
      .getContent()
      .then(
          text -> {
            TextDocumentItem documentItem = dtoFactory.createDto(TextDocumentItem.class);
            documentItem.setUri(event.getFile().getLocation().toString());
            documentItem.setVersion(LanguageServerEditorConfiguration.INITIAL_DOCUMENT_VERSION);
            documentItem.setText(text);
            documentItem.setLanguageId(
                lsRegistry.getLanguageDescription(event.getFile()).getLanguageId());

            DidOpenTextDocumentParams openEvent =
                dtoFactory.createDto(DidOpenTextDocumentParams.class);
            openEvent.setTextDocument(documentItem);
            openEvent.getTextDocument().setUri(event.getFile().getLocation().toString());
            openEvent.setText(text);

            serviceClient.didOpen(openEvent);
          });
}
 
开发者ID:eclipse,项目名称:che,代码行数:27,代码来源:LanguageServerExtension.java


示例4: didOpen

import org.eclipse.lsp4j.DidOpenTextDocumentParams; //导入依赖的package包/类
public void didOpen(DidOpenTextDocumentParams params) {
	try {
		ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
			@Override
			public void run(IProgressMonitor monitor) throws CoreException {
				handleOpen(params);
			}
		}, new NullProgressMonitor());
	} catch (CoreException e) {
		JavaLanguageServerPlugin.logException("Handle document open ", e);
	}
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:13,代码来源:DocumentLifeCycleHandler.java


示例5: openDocument

import org.eclipse.lsp4j.DidOpenTextDocumentParams; //导入依赖的package包/类
private void openDocument(ICompilationUnit cu, String content, int version) {
	DidOpenTextDocumentParams openParms = new DidOpenTextDocumentParams();
	TextDocumentItem textDocument = new TextDocumentItem();
	textDocument.setLanguageId("java");
	textDocument.setText(content);
	textDocument.setUri(JDTUtils.toURI(cu));
	textDocument.setVersion(version);
	openParms.setTextDocument(textDocument);
	lifeCycleHandler.didOpen(openParms);
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:11,代码来源:DocumentLifeCycleHandlerTest.java


示例6: didOpen

import org.eclipse.lsp4j.DidOpenTextDocumentParams; //导入依赖的package包/类
@Override
public void didOpen(final DidOpenTextDocumentParams params) {
  final Function0<BuildManager.Buildable> _function = () -> {
    return this.workspaceManager.didOpen(this._uriExtensions.toUri(params.getTextDocument().getUri()), params.getTextDocument().getVersion(), params.getTextDocument().getText());
  };
  final Function2<CancelIndicator, BuildManager.Buildable, List<IResourceDescription.Delta>> _function_1 = (CancelIndicator cancelIndicator, BuildManager.Buildable buildable) -> {
    return buildable.build(cancelIndicator);
  };
  this.requestManager.<BuildManager.Buildable, List<IResourceDescription.Delta>>runWrite(_function, _function_1);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:11,代码来源:LanguageServerImpl.java


示例7: didOpen

import org.eclipse.lsp4j.DidOpenTextDocumentParams; //导入依赖的package包/类
@Override
public void didOpen(DidOpenTextDocumentParams params) {
	TextDocumentItem textDocument = params.getTextDocument();
	LOGGER.info("didOpen: {0}", textDocument);
	openedDocuments.put(textDocument.getUri(), textDocument);
}
 
开发者ID:lhein,项目名称:camel-language-server,代码行数:7,代码来源:CamelTextDocumentService.java


示例8: didOpen

import org.eclipse.lsp4j.DidOpenTextDocumentParams; //导入依赖的package包/类
@Override
public void didOpen(final DidOpenTextDocumentParams params) {
  parseDocument(params.getTextDocument().getUri(),
      params.getTextDocument().getText());
}
 
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:6,代码来源:SomLanguageServer.java


示例9: didOpen

import org.eclipse.lsp4j.DidOpenTextDocumentParams; //导入依赖的package包/类
@Override
public void didOpen(DidOpenTextDocumentParams params) {
	logInfo(">> document/didOpen");
	documentLifeCycleHandler.didOpen(params);
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:6,代码来源:JDTLanguageServer.java


示例10: didOpen

import org.eclipse.lsp4j.DidOpenTextDocumentParams; //导入依赖的package包/类
@Override
public void didOpen(DidOpenTextDocumentParams params) {
	throw new UnsupportedOperationException();
}
 
开发者ID:eclipse,项目名称:lsp4j,代码行数:5,代码来源:MockLanguageServer.java


示例11: didOpen

import org.eclipse.lsp4j.DidOpenTextDocumentParams; //导入依赖的package包/类
@Override
public void didOpen(DidOpenTextDocumentParams params) {
  String uri = params.getTextDocument().getUri();
  String text = params.getTextDocument().getText();
  reconciler.reconcileUri(uri, text);
}
 
开发者ID:eclipse,项目名称:che,代码行数:7,代码来源:MavenTextDocumentService.java


示例12: configureMethods

import org.eclipse.lsp4j.DidOpenTextDocumentParams; //导入依赖的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: didOpen

import org.eclipse.lsp4j.DidOpenTextDocumentParams; //导入依赖的package包/类
/**
 * The document open notification is sent from the client to the server to
 * signal newly opened text documents. The document's truth is now managed
 * by the client and the server must not try to read the document's truth
 * using the document's uri.
 * 
 * Registration Options: TextDocumentRegistrationOptions
 */
@JsonNotification
void didOpen(DidOpenTextDocumentParams params);
 
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:11,代码来源:TextDocumentService.java


示例14: didOpen

import org.eclipse.lsp4j.DidOpenTextDocumentParams; //导入依赖的package包/类
/**
 * GWT client implementation of {@link TextDocumentService#didOpen(DidOpenTextDocumentParams)}
 *
 * @param params
 * @return
 */
public void didOpen(DidOpenTextDocumentParams params) {
  transmitDtoAndReceiveNothing(params, "textDocument/didOpen");
}
 
开发者ID:eclipse,项目名称:che,代码行数:10,代码来源:TextDocumentServiceClient.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java CommandContextFactory类代码示例发布时间:2022-05-23
下一篇:
Java JRPrintImage类代码示例发布时间: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