org.eclipse.lsp4j.SignatureHelpParams Java Examples

The following examples show how to use org.eclipse.lsp4j.SignatureHelpParams. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SignatureHelpServiceImpl.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public SignatureHelp getSignatureHelp(final Document document, final XtextResource resource, final SignatureHelpParams params, final CancelIndicator cancelIndicator) {
  final int offset = document.getOffSet(params.getPosition());
  Preconditions.<XtextResource>checkNotNull(resource, "resource");
  Preconditions.checkArgument((offset >= 0), ("offset >= 0. Was: " + Integer.valueOf(offset)));
  final EObject object = this.offsetHelper.resolveContainedElementAt(resource, offset);
  if ((object instanceof OperationCall)) {
    final String operationName = this.getOperationName(((OperationCall)object));
    boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(operationName);
    boolean _not = (!_isNullOrEmpty);
    if (_not) {
      return this.getSignatureHelp(((OperationCall)object), operationName, offset);
    }
  }
  return ISignatureHelpService.EMPTY;
}
 
Example #2
Source File: ActionScriptServices.java    From vscode-as3mxml with Apache License 2.0 5 votes vote down vote up
/**
 * Displays a function's parameters, including which one is currently
 * active. Called automatically by VSCode any time that the user types "(",
 * so be sure to check that a function call is actually happening at the
 * current position.
 */
@Override
public CompletableFuture<SignatureHelp> signatureHelp(SignatureHelpParams params)
{
    return CompletableFutures.computeAsync(compilerWorkspace.getExecutorService(), cancelToken ->
    {
        cancelToken.checkCanceled();

        //make sure that the latest changes have been passed to
        //workspace.fileChanged() before proceeding
        if(realTimeProblemsChecker != null)
        {
            realTimeProblemsChecker.updateNow();
        }

        compilerWorkspace.startBuilding();
        try
        {
            SignatureHelpProvider provider = new SignatureHelpProvider(workspaceFolderManager, fileTracker);
            return provider.signatureHelp(params, cancelToken);
        }
        finally
        {
            compilerWorkspace.doneBuilding();
        }
    });
}
 
Example #3
Source File: LanguageServerImpl.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Compute the signature help. Executed in a read request.
 * @since 2.20
 */
protected SignatureHelp signatureHelp(SignatureHelpParams params, CancelIndicator cancelIndicator) {
	URI uri = getURI(params);
	ISignatureHelpService helper = getService(uri, ISignatureHelpService.class);
	if (helper == null) {
		return ISignatureHelpService.EMPTY;
	}
	return workspaceManager.doRead(uri,
			(doc, resource) -> helper.getSignatureHelp(doc, resource, params, cancelIndicator));
}
 
Example #4
Source File: CamelTextDocumentService.java    From camel-language-server with Apache License 2.0 4 votes vote down vote up
@Override
public CompletableFuture<SignatureHelp> signatureHelp(SignatureHelpParams signatureHelpParams) {
	LOGGER.info("signatureHelp: {}", signatureHelpParams.getTextDocument());
	return CompletableFuture.completedFuture(null);
}
 
Example #5
Source File: JDTLanguageServer.java    From eclipse.jdt.ls with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public CompletableFuture<SignatureHelp> signatureHelp(SignatureHelpParams position) {
	logInfo(">> document/signatureHelp");
	SignatureHelpHandler handler = new SignatureHelpHandler(preferenceManager);
	return computeAsync((monitor) -> handler.signatureHelp(position, monitor));
}
 
Example #6
Source File: SignatureHelpHandlerTest.java    From eclipse.jdt.ls with Eclipse Public License 2.0 4 votes vote down vote up
private SignatureHelp getSignatureHelp(ICompilationUnit cu, int line, int character) {
	String payload = createSignatureHelpRequest(cu, line, character);
	SignatureHelpParams position = getParams(payload);
	return handler.signatureHelp(position, monitor);
}
 
Example #7
Source File: ISignatureHelpService.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public SignatureHelp getSignatureHelp(Document document, XtextResource resource, SignatureHelpParams params, CancelIndicator cancelIndicator) {
	return EMPTY;
}
 
Example #8
Source File: LanguageServerImpl.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public CompletableFuture<SignatureHelp> signatureHelp(SignatureHelpParams params) {
	return requestManager.runRead((cancelIndicator) -> signatureHelp(params, cancelIndicator));
}
 
Example #9
Source File: TextDocumentService.java    From lsp4j with Eclipse Public License 2.0 2 votes vote down vote up
/**
 * The signature help request is sent from the client to the server to
 * request signature information at a given cursor position.
 * 
 * Registration Options: SignatureHelpRegistrationOptions
 */
@JsonRequest
default CompletableFuture<SignatureHelp> signatureHelp(SignatureHelpParams params) {
	throw new UnsupportedOperationException();
}
 
Example #10
Source File: ISignatureHelpService.java    From xtext-core with Eclipse Public License 2.0 votes vote down vote up
SignatureHelp getSignatureHelp(Document document, XtextResource resource, SignatureHelpParams params, CancelIndicator cancelIndicator);