/** * Sends a message to client to apply the given workspace edit. * This is available since LSP v3.0 should be used * only by checking the ClientCapabilities. * * @param edit */ public boolean applyWorkspaceEdit(WorkspaceEdit edit){ ApplyWorkspaceEditParams $ = new ApplyWorkspaceEditParams(); $.setEdit(edit); ApplyWorkspaceEditResponse response = client.applyEdit($).join(); return response.isApplied(); }
public Object executeClientCommand(String id, Object... params) { return this.client.executeClientCommand(new ExecuteCommandParams(id, ImmutableList.copyOf(params))).join(); }
public void sendNotification(String id, Object... params) { client.sendNotification(new ExecuteCommandParams(id, ImmutableList.copyOf(params))); }
.withMessage("A build file was modified. Do you want to synchronize the Java classpath/configuration?").withCommands(asList(new Command("Never", cmd, asList(uri, FeatureStatus.disabled)), new Command("Now", cmd, asList(uri, FeatureStatus.interactive)), new Command("Always", cmd, asList(uri, FeatureStatus.automatic)))); client.sendActionableNotification(updateProjectConfigurationNotification);
public Object executeClientCommand(Duration timeout, String id, Object... params) throws InterruptedException, ExecutionException, TimeoutException { return this.client.executeClientCommand(new ExecuteCommandParams(id, ImmutableList.copyOf(params))).get(timeout.toNanos(), TimeUnit.NANOSECONDS); }
public void publishDiagnostics(PublishDiagnosticsParams diagnostics){ client.publishDiagnostics(diagnostics); }
protected void sendStatus() { if (client == null || preferenceManager == null || preferenceManager.getClientPreferences() == null || !preferenceManager.getClientPreferences().isProgressReportSupported()) { return; } ProgressReport progressReport = new ProgressReport(progressId); String task = StringUtils.defaultIfBlank(taskName, (job == null || StringUtils.isBlank(job.getName())) ? "Background task" : job.getName()); progressReport.setTask(task); progressReport.setSubTask(subTaskName); progressReport.setTotalWork(totalWork); progressReport.setWorkDone(progress); progressReport.setComplete(isDone()); progressReport.setStatus(formatMessage(task)); client.sendProgressReport(progressReport); }
/** * Sends a message to the client to be presented to users, with possible commands to execute */ public void sendActionableNotification(ActionableNotification notification) { client.sendActionableNotification(notification); }
@Override protected void sendStatus() { if (client == null) { return; } String message = formatMessage(subTaskName); client.sendStatusReport(new StatusReport().withType(ServiceStatus.Starting.name()).withMessage(message)); } }
/** * @see {@link org.eclipse.lsp4j.services.LanguageClient#registerCapability(RegistrationParams)} */ public void registerCapability(RegistrationParams params) { client.registerCapability(params); }
/** * Sends the logMessage message back to the client as a notification * @param msg The message to send back to the client */ public void logMessage(MessageType type, String msg) { MessageParams $= new MessageParams(); $.setMessage(msg); $.setType(type); client.logMessage($); }
/** * @see {@link LanguageClient#semanticHighlighting(SemanticHighlightingParams)} */ public void semanticHighlighting(SemanticHighlightingParams params) { client.semanticHighlighting(params); }
/** * Sends a progress report to the client to be presented to users * * @param progressReport * The progress report to send back to the client */ public void sendProgressReport(ProgressReport progressReport) { client.sendProgressReport(progressReport); }
/** * Sends a status to the client to be presented to users * @param msg The status to send back to the client */ public void sendStatus(ServiceStatus serverStatus, String status) { StatusReport $ = new StatusReport(); client.sendStatusReport( $.withMessage(status).withType(serverStatus.name())); }