uga-rosa / ddu-source-lsp

Ddu source for lsp.
MIT License
21 stars 6 forks source link

Using lsp_definition source on a file with bracketed strings like [foo] in the path, I cannot get results #31

Closed kyoh86 closed 11 months ago

kyoh86 commented 11 months ago

Using it on a file like [foo]/foo.ts, we cannot get result.

To reproduce:

  1. Use "vtsls".

  2. Install @types/node for type definitions

npm init
npm i --save-dev @types/node
  1. Prepare a file on [foo]/foo.ts
import * as fs from 'fs';

function Foo() {
  fs.cpSync('foo', 'bar');
}
  1. Put a cursor on cpSync and call the source.

Contrast:

Placing the file on foo.ts, we can get result.

kyoh86 commented 11 months ago

log:

[START][2023-12-09 21:14:43] LSP logging initiated
[WARN][2023-12-09 21:14:43] ...lsp/handlers.lua:134 "The language server copilot triggers a registerCapability handler for workspace/didChangeWorkspaceFolders despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[DEBUG][2023-12-09 21:14:59] .../lua/vim/lsp.lua:1506   "LSP[vtsls]"    "client.request"    2   "textDocument/definition"   {  position = {    character = 12,    line = 3  },  textDocument = {    uri = "file:///home/kyoh86/[foo]/foo.ts"  }}    <function 1>    1
[DEBUG][2023-12-09 21:14:59] .../vim/lsp/rpc.lua:261    "rpc.send"  {  id = 5,  jsonrpc = "2.0",  method = "textDocument/definition",  params = {    position = {      character = 12,      line = 3    },    textDocument = {      uri = "file:///home/kyoh86/[foo]/foo.ts"    }  }}
[DEBUG][2023-12-09 21:14:59] .../vim/lsp/rpc.lua:364    "rpc.receive"   {  error = {    code = -32603,    message = "Request textDocument/definition failed with message: Cannot find docuemnt file:///home/kyoh86/[foo]/foo.ts"  },  id = 5,  jsonrpc = "2.0"}
[DEBUG][2023-12-09 21:14:59] .../lua/vim/lsp.lua:1506   "LSP[vtsls]"    "client.request"    2   "textDocument/typeDefinition"   {  position = {    character = 12,    line = 3  },  textDocument = {    uri = "file:///home/kyoh86/[foo]/foo.ts"  }}    <function 1>    1
[DEBUG][2023-12-09 21:14:59] .../vim/lsp/rpc.lua:261    "rpc.send"  {  id = 6,  jsonrpc = "2.0",  method = "textDocument/typeDefinition",  params = {    position = {      character = 12,      line = 3    },    textDocument = {      uri = "file:///home/kyoh86/[foo]/foo.ts"    }  }}
[DEBUG][2023-12-09 21:14:59] .../lua/vim/lsp.lua:1506   "LSP[vtsls]"    "client.request"    2   "textDocument/declaration"  {  position = {    character = 12,    line = 3  },  textDocument = {    uri = "file:///home/kyoh86/[foo]/foo.ts"  }}    <function 1>    1
[DEBUG][2023-12-09 21:14:59] .../vim/lsp/rpc.lua:261    "rpc.send"  {  id = 7,  jsonrpc = "2.0",  method = "textDocument/declaration",  params = {    position = {      character = 12,      line = 3    },    textDocument = {      uri = "file:///home/kyoh86/[foo]/foo.ts"    }  }}
[DEBUG][2023-12-09 21:14:59] .../lua/vim/lsp.lua:1506   "LSP[vtsls]"    "client.request"    2   "textDocument/implementation"   {  position = {    character = 12,    line = 3  },  textDocument = {    uri = "file:///home/kyoh86/[foo]/foo.ts"  }}    <function 1>    1
[DEBUG][2023-12-09 21:14:59] .../vim/lsp/rpc.lua:261    "rpc.send"  {  id = 8,  jsonrpc = "2.0",  method = "textDocument/implementation",  params = {    position = {      character = 12,      line = 3    },    textDocument = {      uri = "file:///home/kyoh86/[foo]/foo.ts"    }  }}
[DEBUG][2023-12-09 21:14:59] .../vim/lsp/rpc.lua:364    "rpc.receive"   {  error = {    code = -32603,    message = "Request textDocument/typeDefinition failed with message: Cannot find docuemnt file:///home/kyoh86/[foo]/foo.ts"  },  id = 6,  jsonrpc = "2.0"}
[DEBUG][2023-12-09 21:14:59] .../vim/lsp/rpc.lua:364    "rpc.receive"   {  error = {    code = -32601,    message = "Unhandled method textDocument/declaration"  },  id = 7,  jsonrpc = "2.0"}
[DEBUG][2023-12-09 21:14:59] .../vim/lsp/rpc.lua:364    "rpc.receive"   {  error = {    code = -32603,    message = "Request textDocument/implementation failed with message: Cannot find docuemnt file:///home/kyoh86/[foo]/foo.ts"  },  id = 8,  jsonrpc = "2.0"}
uga-rosa commented 11 months ago

This is vtsls's issue. https://github.com/yioneko/vtsls/issues/120