Created
July 6, 2016 21:53
-
-
Save smarr/79c1a5e90c9a13659f38597e44caa568 to your computer and use it in GitHub Desktop.
VS Code Language Protocol Proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var vscode = require('vscode-languageserver'); | |
const target = process.argv[2]; // the actual language server protocol implementation | |
const spawn = require('child_process').spawn; | |
const p = spawn(target, []); | |
const writer = new vscode.StreamMessageWriter(p.stdin); | |
process.on('message', (m) => { writer.write(m); }); | |
const reader = new vscode.StreamMessageReader(p.stdout); | |
reader.listen((m) => { process.send(m); }); | |
p.on('close', (code) => { | |
process.exit(code); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment