Foreign code: low level adapter is not aware of the presence of foreign languages; it operates on the virtual document and must not attempt to infer the language dependencies as this would make the logic of inspections caching impossible to maintain, thus the WidgetAdapter has to handle that, keeping multiple connections and multiple virtual documents.

Hierarchy (View Summary)

Constructors

Properties

Signal emitted when the active editor have changed.

Signal emitted when the adapter is connected.

Signal emitted when the adapter is disposed.

Signal emitted when an editor is changed.

Signal emitted when an editor is removed.

editor: FileEditor

The wrapped FileEditor widget.

Accessors

  • get hasMultipleEditors(): boolean
  • Check if the document contains multiple editors

    Returns boolean

  • get isConnected(): boolean
  • The virtual document is connected or not

    Returns boolean

  • get isDisposed(): boolean
  • Check if the adapter is disposed

    Returns boolean

  • get language(): string
  • Get the language identifier of the document

    Returns string

  • get updateFinished(): Promise<void>
  • Promise that resolves once the document is updated

    Returns Promise<void>

  • get virtualDocument(): null | VirtualDocument
  • Internal virtual document of the adapter.

    Returns null | VirtualDocument

  • get widgetId(): string
  • Get the ID of the internal widget.

    Returns string

Methods

  • Opens a connection for the document. The connection may or may not be initialized, yet, and depending on when this is called, the client may not be fully connected.

    Parameters

    • virtualDocument: VirtualDocument

      a VirtualDocument

    • OptionalsendOpen: boolean

      whether to open the document immediately

    Returns Promise<void>

  • Disconnect virtual document from the language server.

    Returns void

  • Create the virtual document using current path and language.

    Returns void

  • Handler for opening a document contained in a parent document. The assumption is that the editor already exists for this, and as such the document should be queued for immediate opening.

    Parameters

    • host: VirtualDocument

      the VirtualDocument that contains the VirtualDocument in another language

    • context: IForeignContext

      information about the foreign VirtualDocument

    Returns Promise<void>