Allow only for appplication*.yml files

This commit is contained in:
BoykoAlex
2016-09-22 10:40:20 -04:00
parent 1e0b673169
commit 116648083f

View File

@@ -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);;
}
}
}