Package org.graalvm.tools.api.lsp
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 TypeMethodDescriptiongetDocumentation
(Object object) Get the documentation information about an object.static com.oracle.truffle.api.library.LibraryFactory
<LSPLibrary> getSignature
(Object object) 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
-
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 providingMarkupContent
protocol interface, with two memberskind
andvalue
. Thekind
is a String literal of the markup kind, eitherplaintext
, ormarkdown
. Thevalue
is the documentation String. If the kind ismarkdown
, 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 toSignatureInformation
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 providingMarkupContent
, seegetDocumentation(Object)
for details.parameters
- An array of objects representing theParameterInformation
protocol interface describing parameters of the callable signature. EveryParameterInformation
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 providingMarkupContent
, seegetDocumentation(Object)
for details.
- Throws:
com.oracle.truffle.api.interop.UnsupportedMessageException
-
getFactory
-