Documentation
¶
Overview ¶
Package languageservice provides editor-independent analysis used by the REPL and future browser and language-server adapters.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallInfo ¶
CallInfo records structured call syntax without making adapters parse the human-readable signature in Detail.
type CompletionItem ¶
type CompletionItem struct {
Label string
InsertText string
Kind CompletionKind
Detail string
Replacement OffsetRange
}
CompletionItem separates the displayed label from the exact source text that replaces Replacement.
func Complete ¶
func Complete(request CompletionRequest) []CompletionItem
type CompletionKind ¶
type CompletionKind string
const ( CompletionKeyword CompletionKind = "keyword" CompletionVariable CompletionKind = "variable" CompletionParameter CompletionKind = "parameter" CompletionConstant CompletionKind = "constant" CompletionFunction CompletionKind = "function" CompletionMethod CompletionKind = "method" CompletionField CompletionKind = "field" CompletionType CompletionKind = "type" CompletionEnumMember CompletionKind = "enum_member" CompletionModule CompletionKind = "module" CompletionCommand CompletionKind = "command" )
type CompletionRequest ¶
type Context ¶
Context is the checked project information available at a cursor position. REPL contexts are rebuilt from typed IR after every accepted submission.
type HighlightKind ¶
type HighlightKind string
const ( HighlightKeyword HighlightKind = "keyword" HighlightType HighlightKind = "type" HighlightConstant HighlightKind = "constant" HighlightString HighlightKind = "string" HighlightNumber HighlightKind = "number" HighlightBoolean HighlightKind = "boolean" HighlightComment HighlightKind = "comment" HighlightFunction HighlightKind = "function" HighlightMethod HighlightKind = "method" HighlightInvalid HighlightKind = "invalid" )
type HighlightRequest ¶
type HighlightSpan ¶
type HighlightSpan struct {
Range OffsetRange
Kind HighlightKind
}
func Highlight ¶
func Highlight(request HighlightRequest) []HighlightSpan
Highlight classifies source without adding terminal or browser formatting. Lexical diagnostics override ordinary token classifications.
type OffsetRange ¶
OffsetRange is a half-open UTF-8 byte range. Protocol adapters may convert it to their own position representation without changing completion logic.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service owns a checked project snapshot while keeping terminal and browser presentation concerns outside the language analysis layer.
func (*Service) Highlight ¶
func (s *Service) Highlight(source string) []HighlightSpan