本文整理汇总了Java中org.eclipse.lsp4j.DocumentOnTypeFormattingParams类的典型用法代码示例。如果您正苦于以下问题:Java DocumentOnTypeFormattingParams类的具体用法?Java DocumentOnTypeFormattingParams怎么用?Java DocumentOnTypeFormattingParams使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DocumentOnTypeFormattingParams类属于org.eclipse.lsp4j包,在下文中一共展示了DocumentOnTypeFormattingParams类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onTypeFormatting
import org.eclipse.lsp4j.DocumentOnTypeFormattingParams; //导入依赖的package包/类
@Override
public CompletableFuture<List<? extends TextEdit>> onTypeFormatting(final DocumentOnTypeFormattingParams params) {
throw new UnsupportedOperationException("TODO: auto-generated method stub");
}
开发者ID:eclipse,项目名称:xtext-core,代码行数:5,代码来源:LanguageServerImpl.java
示例2: onTypeFormatting
import org.eclipse.lsp4j.DocumentOnTypeFormattingParams; //导入依赖的package包/类
private List<TextEditDto> onTypeFormatting(
DocumentOnTypeFormattingParams documentOnTypeFormattingParams) {
try {
String uri = prefixURI(documentOnTypeFormattingParams.getTextDocument().getUri());
documentOnTypeFormattingParams.getTextDocument().setUri(uri);
InitializedLanguageServer server =
languageServerRegistry
.getApplicableLanguageServers(uri)
.stream()
.flatMap(Collection::stream)
.filter(
s ->
s.getInitializeResult()
.getCapabilities()
.getDocumentOnTypeFormattingProvider()
!= null)
.findFirst()
.get();
return server == null
? Collections.emptyList()
: server
.getServer()
.getTextDocumentService()
.onTypeFormatting(documentOnTypeFormattingParams)
.get()
.stream()
.map(TextEditDto::new)
.collect(Collectors.toList());
} catch (InterruptedException | ExecutionException | LanguageServerException e) {
throw new JsonRpcException(-27000, e.getMessage());
}
}
开发者ID:eclipse,项目名称:che,代码行数:33,代码来源:TextDocumentService.java
示例3: onTypeFormatting
import org.eclipse.lsp4j.DocumentOnTypeFormattingParams; //导入依赖的package包/类
@Override
public CompletableFuture<List<? extends TextEdit>> onTypeFormatting(DocumentOnTypeFormattingParams params) {
LOGGER.info("onTypeFormatting: " + params.getTextDocument());
return CompletableFuture.completedFuture(Collections.emptyList());
}
开发者ID:lhein,项目名称:camel-language-server,代码行数:6,代码来源:CamelTextDocumentService.java
示例4: onTypeFormatting
import org.eclipse.lsp4j.DocumentOnTypeFormattingParams; //导入依赖的package包/类
@Override
public CompletableFuture<List<? extends TextEdit>> onTypeFormatting(
final DocumentOnTypeFormattingParams params) {
// TODO Auto-generated method stub
return null;
}
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:7,代码来源:SomLanguageServer.java
示例5: onTypeFormatting
import org.eclipse.lsp4j.DocumentOnTypeFormattingParams; //导入依赖的package包/类
@Override
public CompletableFuture<List<? extends TextEdit>> onTypeFormatting(DocumentOnTypeFormattingParams params) {
logInfo(">> document/onTypeFormatting");
// Not yet implemented
return null;
}
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:7,代码来源:JDTLanguageServer.java
示例6: onTypeFormatting
import org.eclipse.lsp4j.DocumentOnTypeFormattingParams; //导入依赖的package包/类
@Override
public CompletableFuture<List<? extends TextEdit>> onTypeFormatting(DocumentOnTypeFormattingParams params) {
throw new UnsupportedOperationException();
}
开发者ID:eclipse,项目名称:lsp4j,代码行数:5,代码来源:MockLanguageServer.java
示例7: install
import org.eclipse.lsp4j.DocumentOnTypeFormattingParams; //导入依赖的package包/类
@Override
public void install(TextEditor editor) {
this.editor = editor;
if (capabilities.getDocumentOnTypeFormattingProvider() != null
&& capabilities.getDocumentOnTypeFormattingProvider().getFirstTriggerCharacter() != null) {
editor
.getDocument()
.getDocumentHandle()
.getDocEventBus()
.addHandler(
DocumentChangedEvent.TYPE,
new DocumentChangedHandler() {
@Override
public void onDocumentChanged(DocumentChangedEvent event) {
if (capabilities
.getDocumentOnTypeFormattingProvider()
.getFirstTriggerCharacter()
.equals(event.getText())) {
Document document = event.getDocument().getDocument();
DocumentOnTypeFormattingParams params =
dtoFactory.createDto(DocumentOnTypeFormattingParams.class);
TextDocumentIdentifier identifier =
dtoFactory.createDto(TextDocumentIdentifier.class);
identifier.setUri(document.getFile().getLocation().toString());
params.setTextDocument(identifier);
params.setOptions(getFormattingOptions());
params.setCh(event.getText());
TextPosition position = document.getPositionFromIndex(event.getOffset());
Position start = dtoFactory.createDto(Position.class);
start.setLine(position.getLine());
start.setCharacter(position.getCharacter());
params.setPosition(start);
Promise<List<TextEdit>> promise = client.onTypeFormatting(params);
handleFormatting(promise, document);
}
}
});
}
}
开发者ID:eclipse,项目名称:che,代码行数:44,代码来源:LanguageServerFormatter.java
示例8: onTypeFormatting
import org.eclipse.lsp4j.DocumentOnTypeFormattingParams; //导入依赖的package包/类
@Override
public CompletableFuture<List<? extends TextEdit>> onTypeFormatting(
DocumentOnTypeFormattingParams params) {
return null;
}
开发者ID:eclipse,项目名称:che,代码行数:6,代码来源:MavenTextDocumentService.java
示例9: configureMethods
import org.eclipse.lsp4j.DocumentOnTypeFormattingParams; //导入依赖的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
示例10: onTypeFormatting
import org.eclipse.lsp4j.DocumentOnTypeFormattingParams; //导入依赖的package包/类
/**
* The document on type formatting request is sent from the client to the
* server to format parts of the document during typing.
*
* Registration Options: DocumentOnTypeFormattingRegistrationOptions
*/
@JsonRequest
CompletableFuture<List<? extends TextEdit>> onTypeFormatting(DocumentOnTypeFormattingParams params);
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:9,代码来源:TextDocumentService.java
示例11: onTypeFormatting
import org.eclipse.lsp4j.DocumentOnTypeFormattingParams; //导入依赖的package包/类
/**
* GWT client implementation of {@link TextDocumentService#formatting(DocumentFormattingParams)}
*
* @param params
* @return
*/
public Promise<List<TextEdit>> onTypeFormatting(DocumentOnTypeFormattingParams params) {
return transmitDtoAndReceiveDtoList(params, "textDocument/onTypeFormatting", TextEdit.class);
}
开发者ID:eclipse,项目名称:che,代码行数:10,代码来源:TextDocumentServiceClient.java
注:本文中的org.eclipse.lsp4j.DocumentOnTypeFormattingParams类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论