From 09b79463d71f3b144a0cfd878108a012c87464ca Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Sat, 6 Feb 2021 13:39:01 +0100 Subject: feat(lsp): add asset cache regression test When we migrated away from all the locks, there was a regression that was not caught immediately. The tsc::get_asset() would attempt to modify the snapshot, but the problem was that the snapshot was a .clone() of the inner language server's assets, which meant that modifications to that where lost. When we then attempted to do a hover on those assets, the inner language servers assets didn't have the retrieved asset, and therefore would throw an error. --- cli/tests/lsp/hover_request_asset_02.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 cli/tests/lsp/hover_request_asset_02.json (limited to 'cli/tests/lsp/hover_request_asset_02.json') diff --git a/cli/tests/lsp/hover_request_asset_02.json b/cli/tests/lsp/hover_request_asset_02.json new file mode 100644 index 000000000..30f404709 --- /dev/null +++ b/cli/tests/lsp/hover_request_asset_02.json @@ -0,0 +1,14 @@ +{ + "jsonrpc": "2.0", + "id": 4, + "method": "textDocument/hover", + "params": { + "textDocument": { + "uri": "deno:/asset//lib.es2015.symbol.wellknown.d.ts" + }, + "position": { + "line": 109, + "character": 13 + } + } +} -- cgit v1.2.3