TypeshadeLanguageService
On this page

TypeshadeLanguageService

Class in Editor

Provides Typeshade diagnostics, completion, hover, and position mapping for editor integrations.

import { TypeshadeLanguageService } from 'typeshade'

The signature, the description and the examples come from the compiler's own source at commit 26de7be8.

Syntax

class TypeshadeLanguageService

Constructor

new TypeshadeLanguageService(options: TypeshadeLanguageServiceOptions = {})

Instance properties

fileNameread only string

File name used when parsing source text; carries no filesystem meaning.

Instance methods

getDiagnostics (source: string): readonly TypeshadeDiagnostic[]

Returns compiler diagnostics with zero-based ranges and UTF-16 spans suitable for editor markers.

getCompletions (source: string, position: TypeshadePosition): readonly TypeshadeCompletionItem[]

Returns context-aware Typeshade completion items at a zero-based editor position.

getHover (source: string, position: TypeshadePosition): TypeshadeHover | undefined

Returns hover documentation for known Typeshade types and attributes at a zero-based editor position.

getPosition (source: string, offset: number): TypeshadePosition

Converts a UTF-16 source offset into the zero-based position used by adapters; an offset past the end of the source clamps to the end.

getOffset (source: string, position: TypeshadePosition): number

Converts a zero-based editor position into a UTF-16 source offset; a position past the end of the source clamps to the end.

Source

src/language-service.ts, line 122, at commit 26de7be8

Edit this page Report a problem