From 236c20795eb9f11e21e0719b735ea741711acc08 Mon Sep 17 00:00:00 2001 From: Mathias Fußenegger Date: Sat, 11 Mar 2023 07:35:23 +0100 Subject: revert: "fix(lsp): use buffer scheme for files not stored on disk" (#22604) Although using `buffer://` for unsaved file buffers fixes issues with language servers like eclipse.jdt.ls or ansible-language-server, it breaks completion and signature help for clangd. A regression is worse than a fix for something else, so this reverts commit 896d672736b32a8f4a4fa51844b44f266dcdcc6c. The spec change is also still in dicussion, see https://github.com/microsoft/language-server-protocol/pull/1679#discussion_r1130704886 --- test/functional/fixtures/fake-lsp-server.lua | 37 ++++++++++++---------------- 1 file changed, 16 insertions(+), 21 deletions(-) (limited to 'test') diff --git a/test/functional/fixtures/fake-lsp-server.lua b/test/functional/fixtures/fake-lsp-server.lua index 9cc2f6fa27..5fb86d029d 100644 --- a/test/functional/fixtures/fake-lsp-server.lua +++ b/test/functional/fixtures/fake-lsp-server.lua @@ -272,7 +272,6 @@ function tests.text_document_save_did_open() end; body = function() notify('start') - expect_notification('textDocument/didClose') expect_notification('textDocument/didOpen') expect_notification('textDocument/didSave') notify('shutdown') @@ -293,8 +292,6 @@ function tests.text_document_sync_save_bool() end; body = function() notify('start') - expect_notification('textDocument/didClose') - expect_notification('textDocument/didOpen') expect_notification('textDocument/didSave', {textDocument = { uri = "file://" }}) notify('shutdown') end; @@ -316,8 +313,6 @@ function tests.text_document_sync_save_includeText() end; body = function() notify('start') - expect_notification('textDocument/didClose') - expect_notification('textDocument/didOpen') expect_notification('textDocument/didSave', { textDocument = { uri = "file://" @@ -464,7 +459,7 @@ function tests.basic_check_buffer_open() textDocument = { languageId = ""; text = table.concat({"testing"; "123"}, "\n") .. '\n'; - uri = "buffer://"; + uri = "file://"; version = 0; }; }) @@ -491,13 +486,13 @@ function tests.basic_check_buffer_open_and_change() textDocument = { languageId = ""; text = table.concat({"testing"; "123"}, "\n") .. '\n'; - uri = "buffer://"; + uri = "file://"; version = 0; }; }) expect_notification('textDocument/didChange', { textDocument = { - uri = "buffer://"; + uri = "file://"; version = 3; }; contentChanges = { @@ -527,13 +522,13 @@ function tests.basic_check_buffer_open_and_change_noeol() textDocument = { languageId = ""; text = table.concat({"testing"; "123"}, "\n"); - uri = "buffer://"; + uri = "file://"; version = 0; }; }) expect_notification('textDocument/didChange', { textDocument = { - uri = "buffer://"; + uri = "file://"; version = 3; }; contentChanges = { @@ -562,13 +557,13 @@ function tests.basic_check_buffer_open_and_change_multi() textDocument = { languageId = ""; text = table.concat({"testing"; "123"}, "\n") .. '\n'; - uri = "buffer://"; + uri = "file://"; version = 0; }; }) expect_notification('textDocument/didChange', { textDocument = { - uri = "buffer://"; + uri = "file://"; version = 3; }; contentChanges = { @@ -577,7 +572,7 @@ function tests.basic_check_buffer_open_and_change_multi() }) expect_notification('textDocument/didChange', { textDocument = { - uri = "buffer://"; + uri = "file://"; version = 4; }; contentChanges = { @@ -607,13 +602,13 @@ function tests.basic_check_buffer_open_and_change_multi_and_close() textDocument = { languageId = ""; text = table.concat({"testing"; "123"}, "\n") .. '\n'; - uri = "buffer://"; + uri = "file://"; version = 0; }; }) expect_notification('textDocument/didChange', { textDocument = { - uri = "buffer://"; + uri = "file://"; version = 3; }; contentChanges = { @@ -622,7 +617,7 @@ function tests.basic_check_buffer_open_and_change_multi_and_close() }) expect_notification('textDocument/didChange', { textDocument = { - uri = "buffer://"; + uri = "file://"; version = 4; }; contentChanges = { @@ -631,7 +626,7 @@ function tests.basic_check_buffer_open_and_change_multi_and_close() }) expect_notification('textDocument/didClose', { textDocument = { - uri = "buffer://"; + uri = "file://"; }; }) expect_notification("finish") @@ -665,13 +660,13 @@ function tests.basic_check_buffer_open_and_change_incremental() textDocument = { languageId = ""; text = table.concat({"testing"; "123"}, "\n") .. '\n'; - uri = "buffer://"; + uri = "file://"; version = 0; }; }) expect_notification('textDocument/didChange', { textDocument = { - uri = "buffer://"; + uri = "file://"; version = 3; }; contentChanges = { @@ -708,13 +703,13 @@ function tests.basic_check_buffer_open_and_change_incremental_editing() textDocument = { languageId = ""; text = table.concat({"testing"; "123"}, "\n"); - uri = "buffer://"; + uri = "file://"; version = 0; }; }) expect_notification('textDocument/didChange', { textDocument = { - uri = "buffer://"; + uri = "file://"; version = 3; }; contentChanges = { -- cgit