lspext

package
v2.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheGetParams

type CacheGetParams struct {
	// Key is the cache key. The key namespace is shared for a language
	// server, but with other language servers. For example the PHP
	// language server on different workspaces share the same key
	// namespace, but does not share the namespace with a Go language
	// server.
	Key string `json:"key"`
}

CacheGetParams is the input for 'cache/get'. The response is any or null.

type CacheSetParams

type CacheSetParams struct {
	// Key is the cache key. The key namespace is shared for a language
	// server, but with other language servers. For example the PHP
	// language server on different workspaces share the same key
	// namespace, but does not share the namespace with a Go language
	// server.
	Key string `json:"key"`

	// Value is type any. We use json.RawMessage since we expect caching
	// implementation to cache the raw bytes, and not bother with
	// Unmarshaling/Marshalling.
	Value *json.RawMessage `json:"value"`
}

CacheSetParams is the input for the notification 'cache/set'.

type ContentParams

type ContentParams struct {
	TextDocument lsp.TextDocumentIdentifier `json:"textDocument"`
}

ContentParams is the input for 'textDocument/content'. The response is a 'TextDocumentItem'.

type FilesParams

type FilesParams struct {
	Base string `json:"base,omitempty"`
}

FilesParams is the input for 'workspace/xfiles'. The response is '[]TextDocumentIdentifier'

type ImplementationLocation

type ImplementationLocation struct {
	lsp.Location // the location of the implementation

	// Type is the type of implementation relationship described by this location.
	//
	// If a type T was queried, the set of possible values are:
	//
	// - "to": named or ptr-to-named types assignable to interface T
	// - "from": named interfaces assignable from T (or only from *T if Ptr == true)
	//
	// If a method M on type T was queried, the same set of values above is used, except they refer
	// to methods on the described type (not the described type itself).
	//
	// (This type description is taken from golang.org/x/tools/cmd/guru.)
	Type string `json:"type,omitempty"`

	// Ptr is whether this implementation location is only assignable from a pointer *T (where T is
	// the queried type).
	Ptr bool `json:"ptr,omitempty"`

	// Method is whether a method was queried. If so, then the implementation locations refer to the
	// corresponding methods on the types found by the implementation query (not the types
	// themselves).
	Method bool `json:"method"`
}

ImplementationLocation is a superset of lsp.Location with additional Go-specific information about the implementation.

type PartialResultParams

type PartialResultParams struct {
	// ID is the jsonrpc2 ID of the request we are returning partial
	// results for.
	ID lsp.ID `json:"id"`

	// Patch is a JSON patch as specified at http://jsonpatch.com/
	//
	// It is an interface{}, since our only requirement is that it JSON
	// marshals to a valid list of JSON Patch operations.
	Patch interface{} `json:"patch"`
}

PartialResultParams is the input for "$/partialResult", a notification.

type ReferenceInformation

type ReferenceInformation struct {
	// Reference is the location in the workspace where the `symbol` has been
	// referenced.
	Reference lsp.Location `json:"reference"`

	// Symbol is metadata information describing the symbol being referenced.
	Symbol SymbolDescriptor `json:"symbol"`
}

ReferenceInformation represents information about a reference to programming constructs like variables, classes, interfaces etc.

type SymbolDescriptor

type SymbolDescriptor map[string]interface{}

SymbolDescriptor represents information about a programming construct like a variable, class, interface, etc that has a reference to it. It is up to the language server to define the schema of this object.

SymbolDescriptor usually uniquely identifies a symbol, but it is not guaranteed to do so.

func (SymbolDescriptor) Contains

func (s SymbolDescriptor) Contains(other SymbolDescriptor) bool

Contains tells if this SymbolDescriptor fully contains all of the keys and values in the other symbol descriptor.

func (SymbolDescriptor) String

func (s SymbolDescriptor) String() string

String returns a consistently ordered string representation of the SymbolDescriptor. It is useful for testing.

type SymbolLocationInformation

type SymbolLocationInformation struct {
	// A concrete location at which the definition is located, if any.
	Location lsp.Location `json:"location,omitempty"`
	// Metadata about the definition.
	Symbol SymbolDescriptor `json:"symbol"`
}

SymbolLocationInformation is the response type for the `textDocument/xdefinition` extension.

type WorkspaceReferencesParams

type WorkspaceReferencesParams struct {
	// Query represents metadata about the symbol that is being searched for.
	Query SymbolDescriptor `json:"query"`

	// Hints provides optional hints about where the language server should
	// look in order to find the symbol (this is an optimization). It is up to
	// the language server to define the schema of this object.
	Hints map[string]interface{} `json:"hints,omitempty"`

	// Limit if positive will limit the number of results returned.
	Limit int `json:"limit,omitempty"`
}

WorkspaceReferencesParams is parameters for the `workspace/xreferences` extension

See: https://github.com/sourcegraph/language-server-protocol/blob/master/extension-workspace-reference.md

type WorkspaceSymbolParams

type WorkspaceSymbolParams struct {
	Query  string           `json:"query,omitempty"`
	Limit  int              `json:"limit"`
	Symbol SymbolDescriptor `json:"symbol,omitempty"`
}

WorkspaceSymbolParams is the extension workspace/symbol parameter type.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL