org.eclipse.lsp4j.DocumentLinkCapabilities源码实例Demo

类org.eclipse.lsp4j.DocumentLinkCapabilities源码实例Demo

下面列出了org.eclipse.lsp4j.DocumentLinkCapabilities 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: lemminx   文件: XMLCapabilitiesTest.java
private void setAllCapabilities(boolean areAllDynamic) {
	textDocument.setRangeFormatting(new RangeFormattingCapabilities(areAllDynamic));
	textDocument.setFormatting(new FormattingCapabilities(areAllDynamic));
	CompletionCapabilities completion = new CompletionCapabilities();
	completion.setDynamicRegistration(areAllDynamic);
	textDocument.setCompletion(completion);
	textDocument.setDocumentSymbol(new DocumentSymbolCapabilities(areAllDynamic));
	textDocument.setHover(new HoverCapabilities(areAllDynamic));
	textDocument.setDocumentHighlight(new DocumentHighlightCapabilities(areAllDynamic));
	textDocument.setRename(new RenameCapabilities(areAllDynamic));
	FoldingRangeCapabilities folding = new FoldingRangeCapabilities();
	folding.setDynamicRegistration(areAllDynamic);
	textDocument.setFoldingRange(folding);
	textDocument.setDocumentLink(new DocumentLinkCapabilities(areAllDynamic));
	textDocument.setCodeAction(new CodeActionCapabilities(areAllDynamic));
	workspace.setDidChangeWatchedFiles(new DidChangeWatchedFilesCapabilities(areAllDynamic));
}
 
源代码2 项目: lemminx   文件: XMLCapabilitiesTest.java
@Test
public void testBothCapabilityTypes() {
	// Dynamic capabilities
	textDocument.setRangeFormatting(new RangeFormattingCapabilities(true));
	textDocument.setFormatting(new FormattingCapabilities(true));
	CompletionCapabilities completion = new CompletionCapabilities();
	completion.setDynamicRegistration(true);
	textDocument.setCompletion(completion);
	textDocument.setDocumentSymbol(new DocumentSymbolCapabilities(true));
	workspace.setDidChangeWatchedFiles(new DidChangeWatchedFilesCapabilities(true));

	// Non dynamic capabilities
	textDocument.setHover(new HoverCapabilities(false));
	textDocument.setDocumentHighlight(new DocumentHighlightCapabilities(false));
	textDocument.setRename(new RenameCapabilities(false));
	FoldingRangeCapabilities folding = new FoldingRangeCapabilities();
	folding.setDynamicRegistration(false);
	textDocument.setFoldingRange(folding);
	textDocument.setDocumentLink(new DocumentLinkCapabilities(false));
	textDocument.setCodeAction(new CodeActionCapabilities(false));

	setAndInitializeCapabilities();

	assertEquals(5, capabilityIDs.size());
	assertEquals(true, capabilityIDs.contains(FORMATTING_ID));
	assertEquals(true, capabilityIDs.contains(FORMATTING_RANGE_ID));
	assertEquals(true, capabilityIDs.contains(COMPLETION_ID));
	assertEquals(true, capabilityIDs.contains(DOCUMENT_SYMBOL_ID));

	ServerCapabilities serverCapabilities = ServerCapabilitiesInitializer
			.getNonDynamicServerCapabilities(manager.getClientCapabilities(), false);
	assertEquals(false, serverCapabilities.getDocumentRangeFormattingProvider());
	assertEquals(false, serverCapabilities.getDocumentFormattingProvider());
	assertEquals(false, serverCapabilities.getDocumentSymbolProvider());
	assertEquals(true, serverCapabilities.getHoverProvider());
	assertEquals(true, serverCapabilities.getDocumentHighlightProvider());
	assertEquals(true, serverCapabilities.getRenameProvider().getLeft());
	assertEquals(true, serverCapabilities.getFoldingRangeProvider().getLeft());
	assertEquals(true, serverCapabilities.getCodeActionProvider().getLeft());
	assertEquals(null, serverCapabilities.getCompletionProvider());
	assertEquals(DEFAULT_LINK_OPTIONS, serverCapabilities.getDocumentLinkProvider());
}
 
源代码3 项目: lsp4j   文件: TextDocumentClientCapabilities.java
/**
 * Capabilities specific to the `textDocument/documentLink`
 */
@Pure
public DocumentLinkCapabilities getDocumentLink() {
  return this.documentLink;
}
 
源代码4 项目: lsp4j   文件: TextDocumentClientCapabilities.java
/**
 * Capabilities specific to the `textDocument/documentLink`
 */
public void setDocumentLink(final DocumentLinkCapabilities documentLink) {
  this.documentLink = documentLink;
}
 
如果文章对您有帮助,请点击页面广告。以鼓励作者做出的努力。
 类所在包
 类方法
 同包方法