congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
DocumentOnTypeFormattingParams.getTextDocument
Code IndexAdd Tabnine to your IDE (free)

How to use
getTextDocument
method
in
org.eclipse.lsp4j.DocumentOnTypeFormattingParams

Best Java code snippets using org.eclipse.lsp4j.DocumentOnTypeFormattingParams.getTextDocument (Showing top 6 results out of 315)

origin: org.eclipse.che.core/che-core-api-languageserver

private List<TextEditDto> onTypeFormatting(
  DocumentOnTypeFormattingParams documentOnTypeFormattingParams) {
 try {
  String wsPath = documentOnTypeFormattingParams.getTextDocument().getUri();
  Optional<ExtendedLanguageServer> serverOptional =
    findServer
      .byPath(wsPath)
      .stream()
      .filter(it -> it.getCapabilities().getDocumentOnTypeFormattingProvider() != null)
      .findFirst();
  if (serverOptional.isPresent()) {
   String lsId = serverOptional.get().getId();
   URI uri = languageServerPathTransformer.toFsURI(lsId, wsPath);
   documentOnTypeFormattingParams.getTextDocument().setUri(uri.toString());
   return serverOptional
     .get()
     .getTextDocumentService()
     .onTypeFormatting(documentOnTypeFormattingParams)
     .get()
     .stream()
     .map(TextEditDto::new)
     .collect(Collectors.toList());
  } else {
   return emptyList();
  }
 } catch (InterruptedException | ExecutionException e) {
  throw new JsonRpcException(-27000, e.getMessage());
 }
}
origin: eclipse/eclipse.jdt.ls

public List<? extends org.eclipse.lsp4j.TextEdit> onTypeFormatting(DocumentOnTypeFormattingParams params, IProgressMonitor monitor) {
  return format(params.getTextDocument().getUri(), params.getOptions(), params.getPosition(), params.getCh(), monitor);
}
origin: org.eclipse.lsp4j/org.eclipse.lsp4j

@Override
@Pure
public String toString() {
 ToStringBuilder b = new ToStringBuilder(this);
 b.add("position", this.position);
 b.add("ch", this.ch);
 b.add("textDocument", getTextDocument());
 b.add("options", getOptions());
 return b.toString();
}

origin: eclipse/lsp4j

@Override
@Pure
public String toString() {
 ToStringBuilder b = new ToStringBuilder(this);
 b.add("position", this.position);
 b.add("ch", this.ch);
 b.add("textDocument", getTextDocument());
 b.add("options", getOptions());
 return b.toString();
}

origin: org.eclipse.che.core/che-core-api-languageserver

if (o.getTextDocument() == null) {
  setTextDocument((org.eclipse.lsp4j.TextDocumentIdentifier)null);
} else {
  org.eclipse.lsp4j.TextDocumentIdentifier textDocumentVal = new TextDocumentIdentifierDto(o.getTextDocument());
  setTextDocument((org.eclipse.lsp4j.TextDocumentIdentifier)textDocumentVal);
origin: org.eclipse.che.core/che-core-api-languageserver

DocumentOnTypeFormattingParams clone(
  DocumentOnTypeFormattingParams documentOnTypeFormattingParams) {
 if (documentOnTypeFormattingParams == null) {
  return null;
 }
 String ch = documentOnTypeFormattingParams.getCh();
 Position position = documentOnTypeFormattingParams.getPosition();
 FormattingOptions options = documentOnTypeFormattingParams.getOptions();
 TextDocumentIdentifier textDocument = documentOnTypeFormattingParams.getTextDocument();
 DocumentOnTypeFormattingParams cloned = new DocumentOnTypeFormattingParams();
 cloned.setCh(ch);
 cloned.setPosition(clone(position));
 cloned.setOptions(clone(options));
 cloned.setTextDocument(clone(textDocument));
 return cloned;
}
org.eclipse.lsp4jDocumentOnTypeFormattingParamsgetTextDocument

Popular methods of DocumentOnTypeFormattingParams

  • getOptions
  • getCh
    The character that has been typed.
  • getPosition
    The position at which this request was send.
  • <init>
  • setCh
    The character that has been typed.
  • setOptions
  • setPosition
    The position at which this request was send.
  • setTextDocument

Popular in Java

  • Reading from database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • getContentResolver (Context)
  • requestLocationUpdates (LocationManager)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • ImageIO (javax.imageio)
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • JOptionPane (javax.swing)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now