Documentation ¶
Index ¶
- Constants
- Variables
- func ClientCapabilities(ctx context.Context) (lsp.ClientCapabilities, error)
- func ClientName(ctx context.Context) (string, bool)
- func Command(cmd lang.Command) (lsp.Command, error)
- func ContentChange(chEvent lsp.TextDocumentContentChangeEvent) document.Change
- func ContextWithClientName(ctx context.Context, namePtr *string) context.Context
- func DirHandleFromDirURI(dirUri lsp.DocumentURI) document.DirHandle
- func DocumentChanges(events []lsp.TextDocumentContentChangeEvent) document.Changes
- func DocumentSymbols(sbs []decoder.Symbol, caps lsp.DocumentSymbolClientCapabilities) []lsp.DocumentSymbol
- func HCLDiagsToLSP(hclDiags hcl.Diagnostics, source string) []lsp.Diagnostic
- func HCLPosToLSP(pos hcl.Pos) lsp.Position
- func HCLPositionFromLspPosition(pos lsp.Position, doc *document.Document) (hcl.Pos, error)
- func HCLRangeToLSP(rng hcl.Range) lsp.Range
- func HCLSeverityToLSP(severity hcl.DiagnosticSeverity) lsp.DiagnosticSeverity
- func HandleFromDocumentURI(docUri lsp.DocumentURI) document.Handle
- func HoverData(data *lang.HoverData, cc lsp.TextDocumentClientCapabilities) *lsp.Hover
- func Links(links []lang.Link, caps lsp.DocumentLinkClientCapabilities) []lsp.DocumentLink
- func RefOriginsToLocations(origins decoder.ReferenceOrigins) []lsp.Location
- func RefTargetsToLocationLinks(targets decoder.ReferenceTargets, linkSupport bool) interface{}
- func SetClientCapabilities(ctx context.Context, caps *lsp.ClientCapabilities) error
- func SetClientName(ctx context.Context, name string) error
- func TextEditsFromDocumentChanges(changes document.Changes) []lsp.TextEdit
- func ToCompletionList(candidates lang.Candidates, caps lsp.TextDocumentClientCapabilities) lsp.CompletionList
- func TokenModifiersLegend(clientSupported []string) semtok.TokenModifiers
- func TokenTypesLegend(clientSupported []string) semtok.TokenTypes
- func WithClientCapabilities(ctx context.Context, caps *lsp.ClientCapabilities) context.Context
- func WorkspaceSymbols(sbs []decoder.Symbol, caps *lsp.WorkspaceSymbolClientCapabilities) []lsp.SymbolInformation
- type CodeActions
- type DirHandler
- type LanguageID
- type SemanticTokensClientCapabilities
- type TokenEncoder
Constants ¶
View Source
const (
// SourceFormatAllTerraform is a Terraform specific format code action.
SourceFormatAllTerraform = "source.formatAll.terraform"
)
Variables ¶
View Source
var ( // `source.formatAll`: Generic format code action. // We do not register this for terraform to allow fine grained selection of actions. // A user should be able to set `source.formatAll` to true, and source.formatAll.terraform to false to allow all // files to be formatted, but not terraform files (or vice versa). SupportedCodeActions = CodeActions{ SourceFormatAllTerraform: true, } )
Functions ¶
func ClientCapabilities ¶ added in v0.24.0
func ClientCapabilities(ctx context.Context) (lsp.ClientCapabilities, error)
func ContentChange ¶ added in v0.6.0
func ContentChange(chEvent lsp.TextDocumentContentChangeEvent) document.Change
func ContextWithClientName ¶ added in v0.24.0
func DirHandleFromDirURI ¶ added in v0.26.0
func DirHandleFromDirURI(dirUri lsp.DocumentURI) document.DirHandle
func DocumentChanges ¶ added in v0.6.0
func DocumentChanges(events []lsp.TextDocumentContentChangeEvent) document.Changes
func DocumentSymbols ¶ added in v0.15.0
func DocumentSymbols(sbs []decoder.Symbol, caps lsp.DocumentSymbolClientCapabilities) []lsp.DocumentSymbol
func HCLDiagsToLSP ¶ added in v0.10.0
func HCLDiagsToLSP(hclDiags hcl.Diagnostics, source string) []lsp.Diagnostic
func HCLPosToLSP ¶ added in v0.20.0
func HCLPositionFromLspPosition ¶ added in v0.26.0
func HCLRangeToLSP ¶ added in v0.7.0
func HCLSeverityToLSP ¶ added in v0.8.0
func HCLSeverityToLSP(severity hcl.DiagnosticSeverity) lsp.DiagnosticSeverity
func HandleFromDocumentURI ¶ added in v0.26.0
func HandleFromDocumentURI(docUri lsp.DocumentURI) document.Handle
func Links ¶ added in v0.14.0
func Links(links []lang.Link, caps lsp.DocumentLinkClientCapabilities) []lsp.DocumentLink
func RefOriginsToLocations ¶ added in v0.19.0
func RefOriginsToLocations(origins decoder.ReferenceOrigins) []lsp.Location
func RefTargetsToLocationLinks ¶ added in v0.25.0
func RefTargetsToLocationLinks(targets decoder.ReferenceTargets, linkSupport bool) interface{}
func SetClientCapabilities ¶ added in v0.24.0
func SetClientCapabilities(ctx context.Context, caps *lsp.ClientCapabilities) error
func TextEditsFromDocumentChanges ¶ added in v0.11.0
func ToCompletionList ¶ added in v0.10.0
func ToCompletionList(candidates lang.Candidates, caps lsp.TextDocumentClientCapabilities) lsp.CompletionList
func TokenModifiersLegend ¶ added in v0.12.0
func TokenModifiersLegend(clientSupported []string) semtok.TokenModifiers
func TokenTypesLegend ¶ added in v0.12.0
func TokenTypesLegend(clientSupported []string) semtok.TokenTypes
func WithClientCapabilities ¶ added in v0.24.0
func WorkspaceSymbols ¶ added in v0.24.0
func WorkspaceSymbols(sbs []decoder.Symbol, caps *lsp.WorkspaceSymbolClientCapabilities) []lsp.SymbolInformation
Types ¶
type CodeActions ¶ added in v0.21.0
type CodeActions map[lsp.CodeActionKind]bool
func (CodeActions) AsSlice ¶ added in v0.21.0
func (c CodeActions) AsSlice() []lsp.CodeActionKind
func (CodeActions) Only ¶ added in v0.21.0
func (ca CodeActions) Only(only []lsp.CodeActionKind) CodeActions
type DirHandler ¶ added in v0.11.0
type LanguageID ¶ added in v0.18.0
type LanguageID string
LanguageID represents the coding language of a file
const ( Terraform LanguageID = "terraform" Tfvars LanguageID = "terraform-vars" )
func (LanguageID) String ¶ added in v0.18.0
func (l LanguageID) String() string
type SemanticTokensClientCapabilities ¶ added in v0.12.0
type SemanticTokensClientCapabilities struct {
lsp.SemanticTokensClientCapabilities
}
func (SemanticTokensClientCapabilities) FullRequest ¶ added in v0.12.0
func (c SemanticTokensClientCapabilities) FullRequest() bool
type TokenEncoder ¶ added in v0.12.0
type TokenEncoder struct { Lines source.Lines Tokens []lang.SemanticToken ClientCaps lsp.SemanticTokensClientCapabilities // contains filtered or unexported fields }
func (*TokenEncoder) Encode ¶ added in v0.12.0
func (te *TokenEncoder) Encode() []uint32
Source Files ¶
- client_capabilities.go
- client_name.go
- code_actions.go
- command.go
- completion.go
- diagnostics.go
- dir_handler.go
- doc.go
- document_links.go
- file_change.go
- file_handler.go
- hover.go
- language_id.go
- location_links.go
- locations.go
- markup_content.go
- position.go
- range.go
- semantic_tokens.go
- symbols.go
- text_edits.go
- token_encoder.go
Click to show internal directories.
Click to hide internal directories.