How to use the vscode-jsonrpc/lib/is.nil 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 crapo / sadlos2 / sadl3 / com.ge.research.sadl.parent / io.typefox.lsp.monaco / src / main / ts / client / languageClient.ts View on Github external
protected updateColoringDecorators(uri: string, infos: ColoringInformation[], uriToColoringDecorationIdsMap: Map) {
        let modelUri = monaco.Uri.parse(uri)
        let model = monaco.editor.getModel(modelUri)
        if (is.undefined(model) || is.nil(model)) {
            return;
        }

        const decorationIdsToRemove = uriToColoringDecorationIdsMap.get(uri);
        if (decorationIdsToRemove) {
            while (decorationIdsToRemove.length !== 0) {
                const oldId = decorationIdsToRemove.pop();
                model.deltaDecorations([oldId], []);
            }
        }

        const newDecorationIds: string[] = [];
        infos.forEach(info => {
            const monacoRange = protocolConverter.asRange(info.range);
            info.styles.forEach(style => {
                const cssClass = ColoringIdToCssStyleMap.map.get(style);
github crapo / sadlos2 / sadl3 / com.ge.research.sadl.parent / io.typefox.lsp.monaco / src / main / ts / client / languageClient.ts View on Github external
protected updateMarkers(uri: string, diagnostics: lstypes.Diagnostic[]): void {
        let modelUri = monaco.Uri.parse(uri)
        let model = monaco.editor.getModel(modelUri)
        if (is.undefined(model) || is.nil(model)) {
            return;
        }

        let markers: monaco.editor.IMarkerData[] = []
        if (is.defined(diagnostics) && !is.nil(diagnostics)) {
            markers = diagnostics.map(protocolConverter.asMarker)
        }
        monaco.editor.setModelMarkers(model, 'LanguageClient', markers)
    }
github crapo / sadlos2 / sadl3 / com.ge.research.sadl.parent / io.typefox.lsp.monaco / src / main / ts / client / languageClient.ts View on Github external
protected updateMarkers(uri: string, diagnostics: lstypes.Diagnostic[]): void {
        let modelUri = monaco.Uri.parse(uri)
        let model = monaco.editor.getModel(modelUri)
        if (is.undefined(model) || is.nil(model)) {
            return;
        }

        let markers: monaco.editor.IMarkerData[] = []
        if (is.defined(diagnostics) && !is.nil(diagnostics)) {
            markers = diagnostics.map(protocolConverter.asMarker)
        }
        monaco.editor.setModelMarkers(model, 'LanguageClient', markers)
    }
github crapo / sadlos2 / sadl3 / com.ge.research.sadl.parent / io.typefox.lsp.monaco / src / main / ts / client / languageClient.ts View on Github external
protected filterTextDocument(textDocument: lstypes.TextDocument, acceptor: (textDocument: lstypes.TextDocument) => void) {
        if (is.undefined(textDocument)) {
            return;
        }
        if (is.nil(textDocument)) {
            return;
        }
        if (!this.isLanguageSupported(textDocument.languageId)) {
            return;
        }
        acceptor(textDocument);
    }
github crapo / sadlos2 / sadl3 / com.ge.research.sadl.parent / io.typefox.lsp.monaco / src / main / ts / client / languageClient.ts View on Github external
protected onDidChangeTextDocument(textDocument: lstypes.TextDocument, contentChanges?: lstypes.TextDocumentContentChangeEvent[]): void {
        const params = languageConverter.asDidChangeTextDocumentParams(textDocument);
        if (this._capabilites.textDocumentSync === protocol.TextDocumentSyncKind.Incremental) {
            if (is.defined(contentChanges) && !is.nil(contentChanges)) {
                params.contentChanges = contentChanges.map((change) => {
                    return languageConverter.asTextDocumentContentChangeEvent(change);
                })
            }
        }
        this.props.connection.sendNotification(protocol.DidChangeTextDocumentNotification.type, params);
    }