Class LSPLibrary

java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.library.Library
org.graalvm.tools.api.lsp.LSPLibrary
All Implemented Interfaces:
com.oracle.truffle.api.nodes.NodeInterface, Cloneable

public abstract class LSPLibrary extends com.oracle.truffle.api.library.Library
LSP-specific message library.
Since:
1.0
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.oracle.truffle.api.nodes.Node

    com.oracle.truffle.api.nodes.Node.Child, com.oracle.truffle.api.nodes.Node.Children
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the documentation information about an object.
    static com.oracle.truffle.api.library.LibraryFactory<LSPLibrary>
     
    Get the signature information about object representing a callable.

    Methods inherited from class com.oracle.truffle.api.library.Library

    accepts

    Methods inherited from class com.oracle.truffle.api.nodes.Node

    accept, adoptChildren, atomic, atomic, copy, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, getSourceSection, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, onReplace, replace, replace, reportPolymorphicSpecialize, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • getDocumentation

      public Object getDocumentation(Object object) throws com.oracle.truffle.api.interop.UnsupportedMessageException
      Get the documentation information about an object. The returned object is either a String, or an object providing MarkupContent protocol interface, with two members kind and value. The kind is a String literal of the markup kind, either plaintext, or markdown. The value is the documentation String. If the kind is markdown, then the value can contain fenced code blocks like in GitHub issues. When just a String is returned, plaintext kind is assumed.
      Throws:
      com.oracle.truffle.api.interop.UnsupportedMessageException
    • getSignature

      public Object getSignature(Object object) throws com.oracle.truffle.api.interop.UnsupportedMessageException
      Get the signature information about object representing a callable. The returned object has a structure that corresponds to SignatureInformation protocol interface. The TruffleLanguage.toString(Object, Object) should provide the String representation of the signature, displayed as a label.

      Description of properties of the returned object:

      • documentation - Either a String providing the callable documentation, or an object providing MarkupContent, see getDocumentation(Object) for details.
      • parameters - An array of objects representing the ParameterInformation protocol interface describing parameters of the callable signature. Every ParameterInformation object has following properties:
        • label - String label of this parameter (a substring of its containing signature label), or an integer array of size 2 providing inclusive start and exclusive end offsets within its containing signature label. The intended use case is to highlight the parameter label part in the signature label.
        • documentation - Either a String providing the parameter documentation, or an object providing MarkupContent, see getDocumentation(Object) for details.
      Throws:
      com.oracle.truffle.api.interop.UnsupportedMessageException
    • getFactory

      public static com.oracle.truffle.api.library.LibraryFactory<LSPLibrary> getFactory()