pull/437/merge
Jesse Sivonen 2019-12-31 10:36:59 +01:00 committed by GitHub
commit 50238e751e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View File

@ -64,6 +64,19 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
return return
} }
// Get excludes from workspace configuration: files.exclude
const exclude: string[] = [];
const filesConfig = vscode.workspace.getConfiguration('files');
const _exclude = filesConfig.get<{[key: string]: boolean}>('exclude', {});
for (const key in _exclude) {
if (_exclude.hasOwnProperty(key) && _exclude[key]) {
// Push the exclude pattern to the array. Note that we want to
// match the files under the excluded directory not the
// directory itself.
exclude.push(key + '/**');
}
}
let client: LanguageClient let client: LanguageClient
const serverOptions = () => const serverOptions = () =>
@ -125,6 +138,9 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
// Notify the server about changes to PHP files in the workspace // Notify the server about changes to PHP files in the workspace
fileEvents: vscode.workspace.createFileSystemWatcher('**/*.php'), fileEvents: vscode.workspace.createFileSystemWatcher('**/*.php'),
}, },
initializationOptions: {
exclude,
},
} }
// Create the language client and start the client. // Create the language client and start the client.