I'm trying to create a simple client + language server extension for Visual Studio Code (based on this guide) that would analyze the XML files and provide some diagnostic information based on .properties
file contained within the workspace.
In package.json I defined the activation event:
"activationEvents": [
"onLanguage:xml"
],
Client configuration:
// Options to control the language client
let clientOptions: LanguageClientOptions = {
// Register the server for plain text documents
documentSelector: [{
scheme: "file",
language: "xml"
}],
synchronize: {
fileEvents: workspace.createFileSystemWatcher("**/*.properties")
}
};
Server has registered onDidChangeWatchedFiles
event handler and it is working fine when creating/editing/deleting the .properties
files. However those files are not being sent to the server if user doesn't touch them at all.
My question is - what is correct way to send them to the server? Is there any VSCode API to trigger the create/change event during watcher registration? Should I sent a special request from the server to the client to fetch them?
question from:
https://stackoverflow.com/questions/65952516/vscode-extension-send-watched-files-to-language-server-on-activation 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…