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

How to use
JavaClientConnection
in
org.eclipse.jdt.ls.core.internal

Best Java code snippets using org.eclipse.jdt.ls.core.internal.JavaClientConnection (Showing top 18 results out of 315)

origin: eclipse/eclipse.jdt.ls

public void disconnectClient() {
  Job.getJobManager().setProgressProvider(null);
  this.client.disconnect();
}
origin: eclipse/eclipse.jdt.ls

private void processLogMessage(IStatus status) {
  if ((filter != null && !filter.accepts(status)) || !status.matches(this.logLevelMask)) {
    //no op;
    return;
  }
  String dateString = this.dateFormat.format(new Date());
  String message = status.getMessage();
  if (status.getException() != null) {
    message = message + '\n' + status.getException().getMessage();
    StringWriter sw = new StringWriter();
    status.getException().printStackTrace(new PrintWriter(sw));
    String exceptionAsString = sw.toString();
    message = message + '\n' + exceptionAsString;
  }
  connection.logMessage(getMessageTypeFromSeverity(status.getSeverity()), dateString + ' ' + message);
}
origin: eclipse/eclipse.jdt.ls

public void clearDiagnostics() {
  JavaLanguageServerPlugin.logInfo("Clearing problems for " + this.uri.substring(this.uri.lastIndexOf('/')));
  problems.clear();
  PublishDiagnosticsParams $ = new PublishDiagnosticsParams(ResourceUtils.toClientUri(uri), Collections.emptyList());
  this.connection.publishDiagnostics($);
}
origin: eclipse/eclipse.jdt.ls

public void sendStatus(ServiceStatus serverStatus, String status) {
  if (client != null) {
    client.sendStatus(serverStatus, status);
  }
}
origin: eclipse/eclipse.jdt.ls

/**
 * Sends a message to the client to be presented to users, with possible
 * commands to execute
 */
public void sendActionableNotification(MessageType severity, String message, Object data, List<Command> commands) {
  ActionableNotification notification = new ActionableNotification().withSeverity(severity).withMessage(message).withData(data).withCommands(commands);
  sendActionableNotification(notification);
}
origin: eclipse/eclipse.jdt.ls

protected void notifyClient(VersionedTextDocumentIdentifier textDocument, List<SemanticHighlightingInformation> infos) {
  if (infos.isEmpty()) {
    return;
  }
  this.connection.semanticHighlighting(new SemanticHighlightingParams(textDocument, infos));
}
origin: eclipse/eclipse.jdt.ls

public void registerCapability(String id, String method, Object options) {
  if (registeredCapabilities.add(id)) {
    Registration registration = new Registration(id, method, options);
    RegistrationParams registrationParams = new RegistrationParams(Collections.singletonList(registration));
    client.registerCapability(registrationParams);
  }
}
origin: Microsoft/vscode-java-test

@Override
public void elementChanged(ElementChangedEvent event) {
  final Set<IProject> projects = getAffectedProjects(event.getDelta(), new HashSet<IProject>());
  if (projects.isEmpty()) {
    return;
  }
  try {
    final Set<String> projectLocations = new HashSet<String>();
    for (final IProject project : projects) {
      projectLocations.add(ResourceUtils.fixURI(project.getLocationURI()));
    }
    final JDTLanguageServer ls = JavaLanguageServerPlugin.getInstance().getProtocol();
    ls.getClientConnection().sendNotification(CLIENT_UPDATE_CLASSPATH,
        (Object[]) projectLocations.toArray(new String[projectLocations.size()]));
  } catch (final Exception e) {
    // Ignore.
    JavaLanguageServerPlugin.logException("An exception occured while reporting project CLASSPATH change", e);
  }
}
origin: eclipse/eclipse.jdt.ls

final boolean applyNow = JavaLanguageServerPlugin.getPreferencesManager().getClientPreferences().isWorkspaceApplyEditSupported();
if (applyNow) {
  JavaLanguageServerPlugin.getInstance().getClientConnection().applyWorkspaceEdit((WorkspaceEdit) result);
origin: eclipse/eclipse.jdt.ls

public void connectClient(JavaLanguageClient client) {
  this.client = new JavaClientConnection(client);
  progressReporterManager = new ProgressReporterManager(client, preferenceManager);
  Job.getJobManager().setProgressProvider(progressReporterManager);
  this.workingCopyOwner = new LanguageServerWorkingCopyOwner(this.client);
  pm.setConnection(client);
  WorkingCopyOwner.setPrimaryBufferProvider(this.workingCopyOwner);
  this.documentLifeCycleHandler = new DocumentLifeCycleHandler(this.client, preferenceManager, pm, true);
}
origin: eclipse/eclipse.jdt.ls

@Override
public IStatus runInWorkspace(IProgressMonitor monitor) {
  long start = System.currentTimeMillis();
  connection.sendStatus(ServiceStatus.Starting, "Init...");
  SubMonitor subMonitor = SubMonitor.convert(monitor, 100);
  try {
    projectsManager.setAutoBuilding(false);
    projectsManager.initializeProjects(roots, subMonitor);
    projectsManager.setAutoBuilding(preferenceManager.getPreferences().isAutobuildEnabled());
    JavaLanguageServerPlugin.logInfo("Workspace initialized in " + (System.currentTimeMillis() - start) + "ms");
    connection.sendStatus(ServiceStatus.Started, "Ready");
  } catch (OperationCanceledException e) {
    connection.sendStatus(ServiceStatus.Error, "Initialization has been cancelled.");
  } catch (Exception e) {
    JavaLanguageServerPlugin.logException("Initialization failed ", e);
    connection.sendStatus(ServiceStatus.Error, e.getMessage());
  }
  return Status.OK_STATUS;
}
origin: eclipse/eclipse.jdt.ls

        new Command("Don't Show Again", "java.ignoreIncompleteClasspath", null)
        ));
connection.sendActionableNotification(ignoreIncompleteClasspath);
origin: eclipse/eclipse.jdt.ls

private void cleanUpDiagnostics(String uri){
  this.connection.publishDiagnostics(new PublishDiagnosticsParams(ResourceUtils.toClientUri(uri), Collections.emptyList()));
}
origin: eclipse/eclipse.jdt.ls

@Override
public void endReporting() {
  JavaLanguageServerPlugin.logInfo(problems.size() + " problems reported for " + this.uri.substring(this.uri.lastIndexOf('/')));
  PublishDiagnosticsParams $ = new PublishDiagnosticsParams(ResourceUtils.toClientUri(uri), toDiagnosticsArray(this.cu, problems));
  this.connection.publishDiagnostics($);
}
origin: eclipse/eclipse.jdt.ls

if (!project.equals(projectsManager.getDefaultProject())) {
  String uri = JDTUtils.getFileURI(project);
  connection.publishDiagnostics(new PublishDiagnosticsParams(ResourceUtils.toClientUri(uri), Collections.emptyList()));
origin: eclipse/eclipse.jdt.ls

private void publishMarkers(IProject project, IMarker[] markers) throws CoreException {
  Range range = new Range(new Position(0, 0), new Position(0, 0));
  List<IMarker> projectMarkers = new ArrayList<>(markers.length);
  String uri = JDTUtils.getFileURI(project);
  IFile pom = project.getFile("pom.xml");
  List<IMarker> pomMarkers = new ArrayList<>();
  for (IMarker marker : markers) {
    if (!marker.exists() || CheckMissingNaturesListener.MARKER_TYPE.equals(marker.getType())) {
      continue;
    }
    if (IMavenConstants.MARKER_CONFIGURATION_ID.equals(marker.getType())) {
      pomMarkers.add(marker);
    } else {
      projectMarkers.add(marker);
    }
  }
  List<Diagnostic> diagnostics = toDiagnosticArray(range, projectMarkers);
  String clientUri = ResourceUtils.toClientUri(uri);
  connection.publishDiagnostics(new PublishDiagnosticsParams(clientUri, diagnostics));
  if (pom.exists()) {
    IDocument document = JsonRpcHelpers.toDocument(pom);
    diagnostics = toDiagnosticsArray(document, pom.findMarkers(null, true, IResource.DEPTH_ZERO));
    List<Diagnostic> diagnosicts2 = toDiagnosticArray(range, pomMarkers);
    diagnostics.addAll(diagnosicts2);
    connection.publishDiagnostics(new PublishDiagnosticsParams(ResourceUtils.toClientUri(clientUri + "/pom.xml"), diagnostics));
  }
}
origin: eclipse/eclipse.jdt.ls

connection.publishDiagnostics(new PublishDiagnosticsParams(ResourceUtils.toClientUri(uri), diagnostics));
origin: eclipse/eclipse.jdt.ls

  this.connection.publishDiagnostics(new PublishDiagnosticsParams(ResourceUtils.toClientUri(uri), Collections.emptyList()));
  return false;
this.connection.publishDiagnostics(new PublishDiagnosticsParams(ResourceUtils.toClientUri(uri), toDiagnosticsArray(document, markers)));
org.eclipse.jdt.ls.core.internalJavaClientConnection

Most used methods

  • <init>
  • applyWorkspaceEdit
    Sends a message to client to apply the given workspace edit. This is available since LSP v3.0 should
  • disconnect
  • logMessage
    Sends the logMessage message back to the client as a notification
  • publishDiagnostics
  • registerCapability
  • semanticHighlighting
  • sendActionableNotification
    Sends a message to the client to be presented to users, with possible commands to execute
  • sendNotification
  • sendStatus
    Sends a status to the client to be presented to users
  • unregisterCapability
  • unregisterCapability

Popular in Java

  • Making http requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onCreateOptionsMenu (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Join (org.hibernate.mapping)
  • Top Vim plugins
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