当前位置: 首页>>代码示例>>Java>>正文


Java TextDocumentSyncKind类代码示例

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


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

示例1: initialize

import org.eclipse.lsp4j.TextDocumentSyncKind; //导入依赖的package包/类
@Override
public CompletableFuture<InitializeResult> initialize(InitializeParams params) {
	sendLogMessageNotification(MessageType.Info, "Initializing capabilities of the server...");
	Integer processId = params.getProcessId();
	if(processId != null) {
		setParentProcessId(processId.longValue());
	} else {
		sendLogMessageNotification(MessageType.Info, "Missing Parent process ID!!");
		setParentProcessId(0);
	}
	
	InitializeResult result = new InitializeResult();
	
	ServerCapabilities capabilities = new ServerCapabilities();
	capabilities.setTextDocumentSync(TextDocumentSyncKind.Full);
	capabilities.setCompletionProvider(new CompletionOptions(Boolean.TRUE, Arrays.asList(".","?","&", "\"", "=")));
	capabilities.setHoverProvider(Boolean.TRUE);
	
	result.setCapabilities(capabilities);
	return CompletableFuture.completedFuture(result);
}
 
开发者ID:lhein,项目名称:camel-language-server,代码行数:22,代码来源:CamelLanguageServer.java

示例2: getSynchronize

import org.eclipse.lsp4j.TextDocumentSyncKind; //导入依赖的package包/类
public TextDocumentSynchronize getSynchronize(TextDocumentSyncKind kind) {
  if (kind == null) {
    // use NONE syncronizer if server doesn't require any
    return NONE;
  }
  switch (kind) {
    case None:
      return NONE;
    case Full:
      return fullTextDocumentSynchronize;
    case Incremental:
      return incrementalTextDocumentSynchronize;
    default:
      throw new RuntimeException("Unsupported synchronization kind: " + kind);
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:17,代码来源:TextDocumentSynchronizeFactory.java

示例3: LanguageServerReconcileStrategy

import org.eclipse.lsp4j.TextDocumentSyncKind; //导入依赖的package包/类
@Inject
public LanguageServerReconcileStrategy(
    TextDocumentSynchronizeFactory synchronizeFactory,
    @Assisted ServerCapabilities serverCapabilities) {

  Either<TextDocumentSyncKind, TextDocumentSyncOptions> sync =
      serverCapabilities.getTextDocumentSync();
  TextDocumentSyncKind documentSync;
  if (sync.isLeft()) {
    documentSync = sync.getLeft();
  } else {
    documentSync = sync.getRight().getChange();
  }

  synchronize = synchronizeFactory.getSynchronize(documentSync);
}
 
开发者ID:eclipse,项目名称:che,代码行数:17,代码来源:LanguageServerReconcileStrategy.java

示例4: initialize

import org.eclipse.lsp4j.TextDocumentSyncKind; //导入依赖的package包/类
@Override
public CompletableFuture<InitializeResult> initialize(final InitializeParams params) {
  InitializeResult result = new InitializeResult();
  ServerCapabilities cap = new ServerCapabilities();

  cap.setTextDocumentSync(TextDocumentSyncKind.Full);
  cap.setDocumentSymbolProvider(true);
  cap.setWorkspaceSymbolProvider(true);
  cap.setDefinitionProvider(true);
  cap.setCodeLensProvider(new CodeLensOptions(true));
  cap.setExecuteCommandProvider(
      new ExecuteCommandOptions(Lists.newArrayList(SomMinitest.COMMAND)));

  CompletionOptions completion = new CompletionOptions();
  List<String> autoComplTrigger = new ArrayList<>();
  autoComplTrigger.add("#"); // Smalltalk symbols
  autoComplTrigger.add(":"); // end of keywords, to complete arguments
  autoComplTrigger.add("="); // right-hand side of assignments
  completion.setTriggerCharacters(autoComplTrigger);
  completion.setResolveProvider(false); // TODO: look into that

  cap.setCompletionProvider(completion);
  result.setCapabilities(cap);

  loadWorkspace(params);

  return CompletableFuture.completedFuture(result);
}
 
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:29,代码来源:SomLanguageServer.java

示例5: testWillSaveAndWillSaveWaitUntilCapabilities

import org.eclipse.lsp4j.TextDocumentSyncKind; //导入依赖的package包/类
@Test
public void testWillSaveAndWillSaveWaitUntilCapabilities() throws Exception {
	ClientPreferences mockCapabilies = mock(ClientPreferences.class);
	when(mockCapabilies.isExecuteCommandDynamicRegistrationSupported()).thenReturn(Boolean.TRUE);
	when(preferenceManager.getClientPreferences()).thenReturn(mockCapabilies);
	when(mockCapabilies.isWillSaveRegistered()).thenReturn(Boolean.TRUE);
	when(mockCapabilies.isWillSaveWaitUntilRegistered()).thenReturn(Boolean.TRUE);
	InitializeResult result = initialize(true);
	Either<TextDocumentSyncKind, TextDocumentSyncOptions> o = result.getCapabilities().getTextDocumentSync();
	assertTrue(o.isRight());
	assertTrue(o.getRight().getWillSave());
	assertTrue(o.getRight().getWillSaveWaitUntil());
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:14,代码来源:InitHandlerTest.java

示例6: TextDocumentChangeRegistrationOptions

import org.eclipse.lsp4j.TextDocumentSyncKind; //导入依赖的package包/类
public TextDocumentChangeRegistrationOptions(@NonNull final TextDocumentSyncKind syncKind) {
  this.syncKind = syncKind;
}
 
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:4,代码来源:TextDocumentChangeRegistrationOptions.java

示例7: getSyncKind

import org.eclipse.lsp4j.TextDocumentSyncKind; //导入依赖的package包/类
/**
 * How documents are synced to the server. See TextDocumentSyncKind.Full
 * and TextDocumentSyncKind.Incremental.
 */
@Pure
@NonNull
public TextDocumentSyncKind getSyncKind() {
  return this.syncKind;
}
 
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:10,代码来源:TextDocumentChangeRegistrationOptions.java

示例8: getChange

import org.eclipse.lsp4j.TextDocumentSyncKind; //导入依赖的package包/类
/**
 * Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full
 * and TextDocumentSyncKind.Incremental.
 */
@Pure
public TextDocumentSyncKind getChange() {
  return this.change;
}
 
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:9,代码来源:TextDocumentSyncOptions.java

示例9: getTextDocumentSync

import org.eclipse.lsp4j.TextDocumentSyncKind; //导入依赖的package包/类
/**
 * Defines how text documents are synced. Is either a detailed structure defining each notification or
 * for backwards compatibility the TextDocumentSyncKind number.
 */
@Pure
public Either<TextDocumentSyncKind, TextDocumentSyncOptions> getTextDocumentSync() {
  return this.textDocumentSync;
}
 
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:9,代码来源:ServerCapabilities.java

示例10: setTextDocumentSync

import org.eclipse.lsp4j.TextDocumentSyncKind; //导入依赖的package包/类
public void setTextDocumentSync(final TextDocumentSyncKind textDocumentSync) {
  this.textDocumentSync = Either.forLeft(textDocumentSync);
}
 
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:4,代码来源:ServerCapabilities.java

示例11: getTextDocumentSync

import org.eclipse.lsp4j.TextDocumentSyncKind; //导入依赖的package包/类
public Either<TextDocumentSyncKind, TextDocumentSyncOptions> getTextDocumentSync() {
  return mergeTextDocumentSync(left.getTextDocumentSync(), right.getTextDocumentSync());
}
 
开发者ID:eclipse,项目名称:che,代码行数:4,代码来源:ServerCapabilitiesOverlay.java

示例12: mergeTextDocumentSync

import org.eclipse.lsp4j.TextDocumentSyncKind; //导入依赖的package包/类
private Either<TextDocumentSyncKind, TextDocumentSyncOptions> mergeTextDocumentSync(
    Either<TextDocumentSyncKind, TextDocumentSyncOptions> left,
    Either<TextDocumentSyncKind, TextDocumentSyncOptions> right) {
  if (left == null) {
    return right;
  }
  if (right == null) {
    return left;
  }
  if (left.equals(right)) {
    return left;
  }

  if (left.isLeft() && left.getLeft() == TextDocumentSyncKind.Full) {
    return left;
  }

  if (left.isLeft() && left.getLeft() == TextDocumentSyncKind.Incremental) {
    if (right.isLeft() && right.getLeft() == TextDocumentSyncKind.Full) {
      return right;
    } else {
      return left;
    }
  }

  if (left.isRight() && right.isRight()) {
    TextDocumentSyncOptions leftRight = left.getRight();
    TextDocumentSyncOptions rightRight = right.getRight();
    if (leftRight.getChange() == TextDocumentSyncKind.Full) {
      return left;
    }

    if (leftRight.getChange() == TextDocumentSyncKind.Incremental) {
      if (rightRight.getChange() == TextDocumentSyncKind.Full) {
        return right;
      } else {
        return left;
      }
    }
  }

  if (left.isLeft() && right.isRight()) {
    return right;
  }

  if (left.isRight() && right.isLeft()) {
    return left;
  }
  return right;
}
 
开发者ID:eclipse,项目名称:che,代码行数:51,代码来源:ServerCapabilitiesOverlay.java

示例13: initialize

import org.eclipse.lsp4j.TextDocumentSyncKind; //导入依赖的package包/类
@Override
public CompletableFuture<InitializeResult> initialize(InitializeParams params) {
  ServerCapabilities capabilities = new ServerCapabilities();
  capabilities.setTextDocumentSync(TextDocumentSyncKind.Incremental);
  return CompletableFuture.completedFuture(new InitializeResult(capabilities));
}
 
开发者ID:eclipse,项目名称:che,代码行数:7,代码来源:MavenLanguageServer.java

示例14: setChange

import org.eclipse.lsp4j.TextDocumentSyncKind; //导入依赖的package包/类
/**
 * Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full
 * and TextDocumentSyncKind.Incremental.
 */
public void setChange(final TextDocumentSyncKind change) {
  this.change = change;
}
 
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:8,代码来源:TextDocumentSyncOptions.java

示例15: setSyncKind

import org.eclipse.lsp4j.TextDocumentSyncKind; //导入依赖的package包/类
/**
 * How documents are synced to the server. See TextDocumentSyncKind.Full
 * and TextDocumentSyncKind.Incremental.
 */
public void setSyncKind(@NonNull final TextDocumentSyncKind syncKind) {
  this.syncKind = syncKind;
}
 
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:8,代码来源:TextDocumentChangeRegistrationOptions.java


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