53 lines
1.8 KiB
TypeScript
53 lines
1.8 KiB
TypeScript
'use strict';
|
|
// The module 'vscode' contains the VS Code extensibility API
|
|
// Import the module and reference it with the alias vscode in your code below
|
|
|
|
import * as VSCode from 'vscode';
|
|
import * as commons from 'commons-vscode';
|
|
import * as Path from 'path';
|
|
import * as FS from 'fs';
|
|
import * as Net from 'net';
|
|
import * as ChildProcess from 'child_process';
|
|
import {LanguageClient, LanguageClientOptions, SettingMonitor, ServerOptions, StreamInfo} from 'vscode-languageclient';
|
|
import {TextDocument, OutputChannel} from 'vscode';
|
|
|
|
var log_output : OutputChannel = null;
|
|
|
|
const PIPELINE_LANGUAGE_ID = "concourse-pipeline-yaml";
|
|
const TASK_LANGUAGE_ID = "concourse-task-yaml";
|
|
|
|
function log(msg : string) {
|
|
if (log_output) {
|
|
log_output.append(msg +"\n");
|
|
}
|
|
}
|
|
|
|
function error(msg : string) {
|
|
if (log_output) {
|
|
log_output.append("ERR: "+msg+"\n");
|
|
}
|
|
}
|
|
|
|
/** Called when extension is activated */
|
|
export function activate(context: VSCode.ExtensionContext) {
|
|
let options : commons.ActivatorOptions = {
|
|
DEBUG : false,
|
|
CONNECT_TO_LS: false,
|
|
extensionId: 'vscode-concourse',
|
|
fatJarFile: 'target/vscode-concourse-0.0.2-SNAPSHOT.jar',
|
|
jvmHeap: "48m",
|
|
clientOptions: {
|
|
documentSelector: [ PIPELINE_LANGUAGE_ID, TASK_LANGUAGE_ID ],
|
|
synchronize: {
|
|
// TODO: Remove textDocumentFilter property once https://github.com/Microsoft/vscode-languageserver-node/issues/9 is resolved
|
|
textDocumentFilter: function(textDocument : TextDocument) : boolean {
|
|
let languageId = textDocument.languageId;
|
|
return PIPELINE_LANGUAGE_ID===languageId || TASK_LANGUAGE_ID===languageId;
|
|
}
|
|
}
|
|
}
|
|
};
|
|
commons.activate(options, context);
|
|
}
|
|
|