Notification textDocument/didClose is not emitted
Affected version
- Nightly flatpak: Yes
Steps to reproduce
- Start with
flatpak run --env=JSONRPC_DEBUG=1 org.gnome.Builder.Devel -v
- Open a document of a type backed by a language server (Vala, Swift) (You should see that a
textDocument/didOpen
notification is sent) - Close the document (No
textDocument/didClose
notification is sent)
Current behavior
No textDocument/didClose
is sent.
Expected behavior
textDocument/didClose
should be sent.
This notification is supported, as this code exists: https://gitlab.gnome.org/GNOME/gnome-builder/-/blob/main/src/libide/lsp/ide-lsp-client.c#L636
The function is called if the buffer-unloaded
signal is emitted. This probably means that the buffer isn't getting unloaded.
Additional information
[runtime.version]
version = "45.alpha"
channel = "flatpak-nightly"
identifier = "44.1-27-g23bb4ef2b"
It seems like the buffer is disposed before the buffer-unloaded signal is emitted:
(With a bit of instrumentation of mine)
07:57:14.0352 ide-buffer[ 12]: CRITICAL: Disposing buffer 0x55555acca3b0
07:57:14.0356 ide-buffer-manager[ 12]: CRITICAL: ide_buffer_manager_remove: 0x55555acca3b0
07:57:14.0356 ide-lsp-client[ 12]: CRITICAL: ide_lsp_client_supports_buffer: (nil) (text/plain)
07:57:14.0356 ide-lsp-client[ 12]: CRITICAL: ide_lsp_client_supports_buffer: (nil) (text/plain)
Edited by JCWasmx86