How to use the vscode-jsonrpc/lib/messages.NotificationType function in vscode-jsonrpc

To help you get started, we’ve selected a few vscode-jsonrpc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github theia-ide / theia-sprotty-example / theia-dsl-extension / src / browser / diagram / theia-diagram-server-connector.ts View on Github external
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
 */

import { EditorManager } from 'theia-core/lib/editor/browser'
import { TextDocumentPositionParams, Location } from 'vscode-base-languageclient/lib/services'
import { DiagramConfigurationRegistry } from './diagram-configuration'
import { TYPES } from 'sprotty/lib'
import { TheiaDiagramServer } from './theia-diagram-server'
import { NotificationType } from 'vscode-jsonrpc/lib/messages'
import { LanguageClientContribution } from 'theia-core/lib/languages/browser'
import { injectable, inject } from "inversify"
import URI from "theia-core/lib/application/common/uri"

const actionMessageType = new NotificationType('diagram/onAction')
const openInTextEditorType = new NotificationType('diagram/openInTextEditor')
const textPositionMessageType = new NotificationType('diagram/update')

@injectable()
export class TheiaDiagramServerConnector {

    private servers: TheiaDiagramServer[] = []

    constructor(@inject(LanguageClientContribution) private languageClientContribution: LanguageClientContribution,
                @inject(DiagramConfigurationRegistry) private diagramConfigurationRegistry: DiagramConfigurationRegistry,
                @inject(EditorManager) private editorManager: EditorManager) {
        this.languageClientContribution.languageClient.then(
            lc => {
                lc.onNotification(actionMessageType, this.actionMessageReceived.bind(this))
                lc.onNotification(openInTextEditorType, this.openInTextEditorReceived.bind(this))
            }
        ).catch(
            err => console.error(err)
github eclipsesource / graphical-lsp / client / packages / theia-sprotty / src / sprotty / theia-sprotty-connector.ts View on Github external
import { TheiaDiagramServer } from './theia-diagram-server'
import { NotificationType } from 'vscode-jsonrpc/lib/messages'
import { Location } from 'vscode-languageserver-types'
import { LanguageClientContribution } from '@theia/languages/lib/browser'
import { EditorManager } from '@theia/editor/lib/browser'
import { TheiaFileSaver } from './theia-file-saver'
import { DiagramWidgetRegistry } from '../theia/diagram-widget-registry'
import URI from "@theia/core/lib/common/uri"

export interface OpenInTextEditorMessage {
    location: Location
    forceOpen: boolean
}

const acceptMessageType = new NotificationType('diagram/accept')
const didCloseMessageType = new NotificationType('diagram/didClose')
const openInTextEditorMessageType = new NotificationType('diagram/openInTextEditor')

export interface TheiaSprottyConnector {
    connect(diagramServer: TheiaDiagramServer): void
    disconnect(diagramServer: TheiaDiagramServer): void
    save(uri: string, action: ExportSvgAction): void
    openInTextEditor(message: OpenInTextEditorMessage): void
    showStatus(widgetId: string, status: ServerStatusAction): void
    sendMessage(message: ActionMessage): void
    onMessageReceived(message: ActionMessage): void
}
/**
 * Connects sprotty DiagramServers to a Theia LanguageClientContribution.
 *
 * Used to tunnel sprotty actions to and from the sprotty server through
 * the LSP.
github theia-ide / yangster / theia-yang-extension / src / frontend / diagram / theia-sprotty-connector.ts View on Github external
import { TheiaDiagramServer } from './theia-diagram-server'
import { NotificationType } from 'vscode-jsonrpc/lib/messages'
import { Location } from 'vscode-languageserver-types/lib/main'
import { LanguageClientContribution } from '@theia/languages/lib/browser'
import { EditorManager } from '@theia/editor/lib/browser'
import { TheiaFileSaver } from './theia-file-saver'
import URI from "@theia/core/lib/common/uri"

export interface OpenInTextEditorMessage {
    location: Location
    forceOpen: boolean
}

const acceptMessageType = new NotificationType('diagram/accept')
const didCloseMessageType = new NotificationType('diagram/didClose')
const openInTextEditorMessageType = new NotificationType('diagram/openInTextEditor')

/**
 * Connects sprotty DiagramServers to a Theia LanguageClientContribution.
 *
 * Used to tunnel sprotty actions to and from the sprotty server through
 * the LSP.
 *
 * Instances bridge the gap between the sprotty DI containers (one per
 * diagram) and a specific language client from the Theia DI container
 * (one per application).
 */
export class TheiaSprottyConnector {

    private servers: TheiaDiagramServer[] = []

    constructor(private languageClientContribution: LanguageClientContribution,
github theia-ide / yangster / theia-yang-extension / src / frontend / diagram / theia-sprotty-connector.ts View on Github external
import { ActionMessage, ExportSvgAction } from 'sprotty/lib'
import { TheiaDiagramServer } from './theia-diagram-server'
import { NotificationType } from 'vscode-jsonrpc/lib/messages'
import { Location } from 'vscode-languageserver-types/lib/main'
import { LanguageClientContribution } from '@theia/languages/lib/browser'
import { EditorManager } from '@theia/editor/lib/browser'
import { TheiaFileSaver } from './theia-file-saver'
import URI from "@theia/core/lib/common/uri"

export interface OpenInTextEditorMessage {
    location: Location
    forceOpen: boolean
}

const acceptMessageType = new NotificationType('diagram/accept')
const didCloseMessageType = new NotificationType('diagram/didClose')
const openInTextEditorMessageType = new NotificationType('diagram/openInTextEditor')

/**
 * Connects sprotty DiagramServers to a Theia LanguageClientContribution.
 *
 * Used to tunnel sprotty actions to and from the sprotty server through
 * the LSP.
 *
 * Instances bridge the gap between the sprotty DI containers (one per
 * diagram) and a specific language client from the Theia DI container
 * (one per application).
 */
export class TheiaSprottyConnector {

    private servers: TheiaDiagramServer[] = []
github eclipsesource / graphical-lsp / client / packages / theia-sprotty / src / sprotty / theia-sprotty-connector.ts View on Github external
import { NotificationType } from 'vscode-jsonrpc/lib/messages'
import { Location } from 'vscode-languageserver-types'
import { LanguageClientContribution } from '@theia/languages/lib/browser'
import { EditorManager } from '@theia/editor/lib/browser'
import { TheiaFileSaver } from './theia-file-saver'
import { DiagramWidgetRegistry } from '../theia/diagram-widget-registry'
import URI from "@theia/core/lib/common/uri"

export interface OpenInTextEditorMessage {
    location: Location
    forceOpen: boolean
}

const acceptMessageType = new NotificationType('diagram/accept')
const didCloseMessageType = new NotificationType('diagram/didClose')
const openInTextEditorMessageType = new NotificationType('diagram/openInTextEditor')

export interface TheiaSprottyConnector {
    connect(diagramServer: TheiaDiagramServer): void
    disconnect(diagramServer: TheiaDiagramServer): void
    save(uri: string, action: ExportSvgAction): void
    openInTextEditor(message: OpenInTextEditorMessage): void
    showStatus(widgetId: string, status: ServerStatusAction): void
    sendMessage(message: ActionMessage): void
    onMessageReceived(message: ActionMessage): void
}
/**
 * Connects sprotty DiagramServers to a Theia LanguageClientContribution.
 *
 * Used to tunnel sprotty actions to and from the sprotty server through
 * the LSP.
 *
github theia-ide / yangster / theia-yang-extension / src / frontend / diagram / theia-sprotty-connector.ts View on Github external
import { ActionMessage, ExportSvgAction } from 'sprotty/lib'
import { TheiaDiagramServer } from './theia-diagram-server'
import { NotificationType } from 'vscode-jsonrpc/lib/messages'
import { Location } from 'vscode-languageserver-types/lib/main'
import { LanguageClientContribution } from '@theia/languages/lib/browser'
import { EditorManager } from '@theia/editor/lib/browser'
import { TheiaFileSaver } from './theia-file-saver'
import URI from "@theia/core/lib/common/uri"

export interface OpenInTextEditorMessage {
    location: Location
    forceOpen: boolean
}

const acceptMessageType = new NotificationType('diagram/accept')
const didCloseMessageType = new NotificationType('diagram/didClose')
const openInTextEditorMessageType = new NotificationType('diagram/openInTextEditor')

/**
 * Connects sprotty DiagramServers to a Theia LanguageClientContribution.
 *
 * Used to tunnel sprotty actions to and from the sprotty server through
 * the LSP.
 *
 * Instances bridge the gap between the sprotty DI containers (one per
 * diagram) and a specific language client from the Theia DI container
 * (one per application).
 */
export class TheiaSprottyConnector {

    private servers: TheiaDiagramServer[] = []
github theia-ide / theia-sprotty-example / theia-dsl-extension / src / browser / diagram / theia-diagram-server-connector.ts View on Github external
*
 * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
 */

import { EditorManager } from 'theia-core/lib/editor/browser'
import { TextDocumentPositionParams, Location } from 'vscode-base-languageclient/lib/services'
import { DiagramConfigurationRegistry } from './diagram-configuration'
import { TYPES } from 'sprotty/lib'
import { TheiaDiagramServer } from './theia-diagram-server'
import { NotificationType } from 'vscode-jsonrpc/lib/messages'
import { LanguageClientContribution } from 'theia-core/lib/languages/browser'
import { injectable, inject } from "inversify"
import URI from "theia-core/lib/application/common/uri"

const actionMessageType = new NotificationType('diagram/onAction')
const openInTextEditorType = new NotificationType('diagram/openInTextEditor')
const textPositionMessageType = new NotificationType('diagram/update')

@injectable()
export class TheiaDiagramServerConnector {

    private servers: TheiaDiagramServer[] = []

    constructor(@inject(LanguageClientContribution) private languageClientContribution: LanguageClientContribution,
                @inject(DiagramConfigurationRegistry) private diagramConfigurationRegistry: DiagramConfigurationRegistry,
                @inject(EditorManager) private editorManager: EditorManager) {
        this.languageClientContribution.languageClient.then(
            lc => {
                lc.onNotification(actionMessageType, this.actionMessageReceived.bind(this))
                lc.onNotification(openInTextEditorType, this.openInTextEditorReceived.bind(this))
            }
github theia-ide / theia-sprotty-example / theia-dsl-extension / src / browser / diagram / theia-diagram-server-connector.ts View on Github external
* Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
 */

import { EditorManager } from 'theia-core/lib/editor/browser'
import { TextDocumentPositionParams, Location } from 'vscode-base-languageclient/lib/services'
import { DiagramConfigurationRegistry } from './diagram-configuration'
import { TYPES } from 'sprotty/lib'
import { TheiaDiagramServer } from './theia-diagram-server'
import { NotificationType } from 'vscode-jsonrpc/lib/messages'
import { LanguageClientContribution } from 'theia-core/lib/languages/browser'
import { injectable, inject } from "inversify"
import URI from "theia-core/lib/application/common/uri"

const actionMessageType = new NotificationType('diagram/onAction')
const openInTextEditorType = new NotificationType('diagram/openInTextEditor')
const textPositionMessageType = new NotificationType('diagram/update')

@injectable()
export class TheiaDiagramServerConnector {

    private servers: TheiaDiagramServer[] = []

    constructor(@inject(LanguageClientContribution) private languageClientContribution: LanguageClientContribution,
                @inject(DiagramConfigurationRegistry) private diagramConfigurationRegistry: DiagramConfigurationRegistry,
                @inject(EditorManager) private editorManager: EditorManager) {
        this.languageClientContribution.languageClient.then(
            lc => {
                lc.onNotification(actionMessageType, this.actionMessageReceived.bind(this))
                lc.onNotification(openInTextEditorType, this.openInTextEditorReceived.bind(this))
            }
        ).catch(
github eclipsesource / graphical-lsp / client / packages / theia-sprotty / src / sprotty / theia-sprotty-connector.ts View on Github external
import { ActionMessage, ExportSvgAction, ServerStatusAction } from 'glsp-sprotty/lib'
import { TheiaDiagramServer } from './theia-diagram-server'
import { NotificationType } from 'vscode-jsonrpc/lib/messages'
import { Location } from 'vscode-languageserver-types'
import { LanguageClientContribution } from '@theia/languages/lib/browser'
import { EditorManager } from '@theia/editor/lib/browser'
import { TheiaFileSaver } from './theia-file-saver'
import { DiagramWidgetRegistry } from '../theia/diagram-widget-registry'
import URI from "@theia/core/lib/common/uri"

export interface OpenInTextEditorMessage {
    location: Location
    forceOpen: boolean
}

const acceptMessageType = new NotificationType('diagram/accept')
const didCloseMessageType = new NotificationType('diagram/didClose')
const openInTextEditorMessageType = new NotificationType('diagram/openInTextEditor')

export interface TheiaSprottyConnector {
    connect(diagramServer: TheiaDiagramServer): void
    disconnect(diagramServer: TheiaDiagramServer): void
    save(uri: string, action: ExportSvgAction): void
    openInTextEditor(message: OpenInTextEditorMessage): void
    showStatus(widgetId: string, status: ServerStatusAction): void
    sendMessage(message: ActionMessage): void
    onMessageReceived(message: ActionMessage): void
}
/**
 * Connects sprotty DiagramServers to a Theia LanguageClientContribution.
 *
 * Used to tunnel sprotty actions to and from the sprotty server through