Background
Not sure if this is a bug with the LSP-communication, or it is how VS Code works 🤷. Feels still wrong
Project Setup
- /home/project/
- .vscode/
- settings.json
- /home/outside-project/
- watched-file.txt
Opening the project with code /home/project
My extension has a setting where I can define the path for the watched file.
Example: my-extenion.watchingFiles: "/home/outside-project/watched-file.txt"
Issue
My LSP Server tells VS Code to watch for the file outside its project:
2026-05-29 14:22:37.762 [info] [Trace - 2:22:37 PM] Received request 'client/registerCapability - (0)'.
2026-05-29 14:22:37.762 [info] Params: {
"registrations": [
{
"id": "watcher-file:///home/project",
"method": "workspace/didChangeWatchedFiles",
"registerOptions": {
"watchers": [
{
"globPattern": "/home/outside-project/watched-file.txt",
"kind": 7
},
{
"globPattern": {
"baseUri": "file:///home/project",
"pattern": "**/tsconfig*.json"
},
"kind": 7
}
]
}
}
]
}
But VS Code does never send a workspace/didChangeWatchedFiles notification to the server, when editing the file.
When watched-file.txt is inside /home/project/ it works as expected with the absolute path.
2026-05-29 14:37:07.043 [info] [Trace - 2:37:07 PM] Sending notification 'workspace/didChangeWatchedFiles'.
2026-05-29 14:37:07.043 [info] Params: {
"changes": [
{
"uri": "file:///home/project/watched-file.txt",
"type": 2
}
]
}
Background
Not sure if this is a bug with the LSP-communication, or it is how VS Code works 🤷. Feels still wrong
Project Setup
Opening the project with
code /home/projectMy extension has a setting where I can define the path for the watched file.
Example:
my-extenion.watchingFiles: "/home/outside-project/watched-file.txt"Issue
My LSP Server tells VS Code to watch for the file outside its project:
But VS Code does never send a
workspace/didChangeWatchedFilesnotification to the server, when editing the file.When
watched-file.txtis inside/home/project/it works as expected with the absolute path.