From 116648083f6e4cb97d723bee25408dcf37318484 Mon Sep 17 00:00:00 2001 From: BoykoAlex Date: Thu, 22 Sep 2016 10:40:20 -0400 Subject: [PATCH] Allow only for appplication*.yml files --- vscode-extensions/vscode-application-yaml/lib/Main.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vscode-extensions/vscode-application-yaml/lib/Main.ts b/vscode-extensions/vscode-application-yaml/lib/Main.ts index 33f865cb5..c31feace9 100644 --- a/vscode-extensions/vscode-application-yaml/lib/Main.ts +++ b/vscode-extensions/vscode-application-yaml/lib/Main.ts @@ -57,7 +57,7 @@ export function activate(context: VSCode.ExtensionContext) { // Options to control the language client let clientOptions: LanguageClientOptions = { // Register the server for java documents - documentSelector: ['yaml'], + documentSelector: [{language: 'yaml', pattern: '**/application*.yml'}], synchronize: { // Synchronize the setting section to the server: configurationSection: 'languageServerExample', @@ -65,7 +65,12 @@ export function activate(context: VSCode.ExtensionContext) { fileEvents: [ //What's this for? Don't think it does anything useful for this example: VSCode.workspace.createFileSystemWatcher('**/.clientrc') - ] + ], + textDocumentFilter: function(textDocument: TextDocument):boolean { + let idx : number = textDocument.fileName.lastIndexOf('/'); + let fileName : string = textDocument.fileName.substr(idx + 1); + return /application.*.yml/.test(fileName);; + } } }