Skip to main content

ILspService

MS Code Extension API


MS Code Extension API / core/services/ILspService

core/services/ILspService

Interfaces

ILspService

Defined in: core/services/ILspService.ts:11

ILspService Core Architectural Interface Defines the contract for all Language Server Protocol service implementations. Both real connection subsystems and web-safe test mock modules must implement this, decoupling consumption hooks like useLspSync from concrete layout dependencies.

Properties

disposables

disposables: IDisposable[]

Defined in: core/services/ILspService.ts:25

Dynamic operational registry tracking allocated language feature handlers for teardown

initialized

initialized: boolean

Defined in: core/services/ILspService.ts:16

True once the bi-directional initialize/initialized handshake lifecycle is confirmed

isConnected

readonly isConnected: boolean

Defined in: core/services/ILspService.ts:13

Reflects whether the underlying WebSocket network pipe is alive and active

isInitializing

isInitializing: boolean

Defined in: core/services/ILspService.ts:22

Tracks intermediate connection state where the socket has connected but the structural handshake is still outstanding. Used to trap microsecond race windows safely.

Methods

_notify()

_notify(method, params): void

Defined in: core/services/ILspService.ts:78

Direct pipeline allowing execution layers to fire off low-level custom notification strings. Intended strictly for test scripting runs or internal lifecycle testing loops.

Parameters
method

string

params

unknown

Returns

void

connect()

connect(languageId, url, options?): void

Defined in: core/services/ILspService.ts:41

Provisions network sockets and bootstraps the asynchronous LSP initialization protocol layers.

Parameters
languageId

string

Context identifier matching target editor configurations (e.g., 'typescript').

url

string

Absolute remote proxy endpoint or web socket server channel path.

options?

Record<string, any>

Secondary operational configurations mapping custom compiler settings.

Returns

void

disconnect()

disconnect(): void

Defined in: core/services/ILspService.ts:47

severs underlying web communication channels, wipes diagnostic maps, and unregisters active code intellisense providers from Monaco.

Returns

void

notifyDocumentOpen()

notifyDocumentOpen(model): void

Defined in: core/services/ILspService.ts:72

Synchronizes active code buffers upon tab mutations or layout focus updates. Alternates tracking streams via textDocument/didChange or initial textDocument/didOpen structures.

Parameters
model

ITextModel

Target Monaco document tracking model instance.

Returns

void

registerModelUri()

registerModelUri(model, realFileUri): void

Defined in: core/services/ILspService.ts:56

Associates an ephemeral, in-memory Monaco TextModel space with a concrete absolute filesystem string. Must be evaluated within file sync processes prior to submitting operational range positions.

Parameters
model

ITextModel

Active Monaco document tracking model instance.

realFileUri

string

Absolute peripheral file storage route address string.

Returns

void

unregisterModelUri()

unregisterModelUri(model): void

Defined in: core/services/ILspService.ts:64

Triggers terminal cleanup sequences when a document context unmounts. Transmits a textDocument/didClose RPC frame to flush out internal workspace map caches.

Parameters
model

ITextModel

Target Monaco document tracking model instance.

Returns

void

waitUntilReady()

waitUntilReady(): Promise<void>

Defined in: core/services/ILspService.ts:32

Returns a promise that resolves instantly if initialization has wrapped up, or suspends execution until active handshake workflows finish. Rejects immediately if no backing connection exists.

Returns

Promise<void>