Dart-Code icon indicating copy to clipboard operation
Dart-Code copied to clipboard

Enable delayOpenNotifications=true with LSP client vNext to prevent redundant didOpen/didClose notifications to server

Open DanTup opened this issue 1 year ago • 2 comments

See https://github.com/microsoft/vscode-languageserver-node/issues/848#issuecomment-2210314682

textSynchronization: {
	delayOpenNotifications: true,
},

This will prevent redundant didOpen/didClose events being sent from VS Code to the LSP server when holding Ctrl and hovering over something (which triggers some work for the open file, such as sending outline notifications etc.).

DanTup avatar Jul 08 '24 14:07 DanTup

Although it's still a pre-release, we're going to switch to using this vNext of the LSP client and enable this setting.

(Whether we use any vNext features of the protocol is not yet decided, but getting just this fix seems reasonably safe).

DanTup avatar Dec 02 '25 11:12 DanTup

This appears to have caused a bug where open notifications will have "future" versions of the content when a file is created from a code action (see https://github.com/dart-lang/sdk/issues/62209).

For now, I'm reverting the flag (but keeping the vNext client for simplicity) and will fail an issue in the LSP client.

DanTup avatar Dec 09 '25 11:12 DanTup