Log language server output
parent
e38b8a9445
commit
c4ba0e1133
|
@ -1,20 +1,27 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
import { spawn } from 'child_process';
|
||||||
import { ExtensionContext } from 'vscode';
|
import { ExtensionContext } from 'vscode';
|
||||||
import { LanguageClient, LanguageClientOptions, ServerOptions } from 'vscode-languageclient';
|
import { LanguageClient, LanguageClientOptions } from 'vscode-languageclient';
|
||||||
|
|
||||||
export function activate(context: ExtensionContext) {
|
export function activate(context: ExtensionContext) {
|
||||||
|
|
||||||
// The server is implemented in PHP
|
// The server is implemented in PHP
|
||||||
const serverPath = context.asAbsolutePath(path.join('vendor', 'felixfbecker', 'language-server', 'bin', 'php-language-server.php'));
|
const serverPath = context.asAbsolutePath(path.join('vendor', 'felixfbecker', 'language-server', 'bin', 'php-language-server.php'));
|
||||||
|
|
||||||
const serverOptions: ServerOptions = {
|
const serverOptions = () => {
|
||||||
command: 'php',
|
const childProcess = spawn('php', [serverPath]);
|
||||||
args: [serverPath]
|
childProcess.stderr.on('data', (chunk: Buffer) => {
|
||||||
|
console.error(chunk + '');
|
||||||
|
});
|
||||||
|
childProcess.stdout.on('data', (chunk: Buffer) => {
|
||||||
|
console.log(chunk + '');
|
||||||
|
});
|
||||||
|
return Promise.resolve(childProcess);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Options to control the language client
|
// Options to control the language client
|
||||||
let clientOptions: LanguageClientOptions = {
|
let clientOptions: LanguageClientOptions = {
|
||||||
// Register the server for php documents
|
// Register the server for php documents
|
||||||
|
|
Loading…
Reference in New Issue