Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions phpcs/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,26 @@ export function activate(context: ExtensionContext) {
}
};

// Notify the server about file changes to 'ruleset.xml' files contain in the workspace
const watchedFiles: string[] = [
".phpcs.xml",
".phpcs.xml.dist",
"phpcs.xml",
"phpcs.xml.dist",
"phpcs.ruleset.xml",
"ruleset.xml",
];

const fileEvents = watchedFiles.map(file => workspace.createFileSystemWatcher(`**/${file}`));

context.subscriptions.push(...fileEvents);

// Options to control the language client
let clientOptions: LanguageClientOptions = {
// Register the server for php documents
documentSelector: ["php"],
synchronize: {
// Notify the server about file changes to 'ruleset.xml' files contain in the workspace
fileEvents: workspace.createFileSystemWatcher("**/ruleset.xml")
fileEvents
},
middleware: middleware as Middleware
};
Expand Down