`notify` does not run on Typescript files
JeremyChuaWX opened this issue · comments
Description
When opening a Typescript project, the workspace files are detected, but their respective textDocument/didOpen
notifications were not sent to the LSP client.
Steps to reproduce
- Initialise a git repository with 2 Typescript files
- Create a syntax error in one of the files
- Git add the files
- Open neovim on the file with no syntax error
Expected behavior
Expected the syntax error to be listed in LSP diagnostics.
Evaluation
After some testing, it seems that it is a known issue that vim.filetype.match
does not work on Typescript files with just a filename (neovim/neovim#27265). Since the filetype is nil
, the textDocument/didOpen
is not sent to the LSP client.
One potential solution is to manually add the filetype, but it is not an elegant one.
vim.filetype.add({
extension = {
ts = "typescript",
},
})
Environment
- Neovim version: 0.9.5
- workspace-diagnostics version: main branch, commit ea9de9c