Open BlueskyFR opened 1 year ago
It should be associated by default. What version of the extension are you using?
I seem to be having the same issue, with v0.3.2. However, I'm using the lsp on neovim, so I don't know if it is only for VS Code for now. I also tried set filetype=typst
manually on a typ file, but the lsp still didn't seem to work. Maybe it's a config issue? I just installed it using Mason.
In neovim, when I open a .typ
file, the automatically associated filetype is sql
. Hence, the typst LS is not attached.
Setting manually set filetype=typst
does not work indeed.
I was able to make the LSP work by adding vim.filetype.add({ extension = {typ = "typst"}})
to my neovim config.
Hence, the problem is indeed that this association is not made by default. I guess that it should be upstream directly to neovim but I am not 100% sure.
In neovim, when I open a
.typ
file, the automatically associated filetype issql
. Hence, the typst LS is not attached. Setting manuallyset filetype=typst
does not work indeed. I was able to make the LSP work by addingvim.filetype.add({ extension = {typ = "typst"}})
to my neovim config.Hence, the problem is indeed that this association is not made by default. I guess that it should be upstream directly to neovim but I am not 100% sure.
Hey, sorry to hijack this bug.
I'm using neovim and running into the same problem it seems. The language server is not being attached to the buffer no matter what I do.
I added the file extension .typ to my neovim setup, just like you did and the file is now being recognized as a typst file. This doesn't solve the problem though.
:LspInfo says the following:
Detected filetype: typst
0 client(s) attached to this buffer:
Other clients that match the filetype: typst
Config: typst_lsp
Refer to :h lspconfig-root-detection for help.
filetypes: typst
root directory: Not found.
cmd: typst-lsp
cmd is executable: true
autostart: true
custom handlers:
Configured servers list: typst_lsp
I think the problem is that it doesn't find the root directory, but it should attach to the file, shouldn't it?
I guess that it should be upstream directly to neovim but I am not 100% sure.
Done:
@Pi77Bull The typ
file must be in some sort of git folder. I just do a quick git init
.
@Pi77Bull The
typ
file must be in some sort of git folder. I just do a quickgit init
.
Why so ? I don't see why we need the document to be in a git repo...
Why so ? I don't see why we need the document to be in a git repo...
Because the default config uses this:
root_dir = function(fname)
return util.find_git_ancestor(fname)
end,
Ok ! Thank you for the explanation
Done:
* vim: [vim/vim@4ce1bda](https://github.com/vim/vim/commit/4ce1bda869e4ec0152d7dcbe1e491ceac5341d5e) * neovim:
I guess that we can close this issue. Users will have to either
vim.filetype.add({extension = { 'typ' = 'typst' }})
)I guess that we can close this issue.
@nvarner @BlueskyFR
I guess that we can close this issue.
@nvarner @BlueskyFR
Issue is still present on VsCode AFAIK, which was the original purpose of this issue. I'll check asap
@BlueskyFR please update when you test in VS Code; it should work fine there with the latest version of the plugin.
I'm not familiar with Vim configuration, but it looks like that part of the issue has been resolved and wasn't strictly related to the language server. I'll have to look into Vim to see what's needed to improve support, though.
The file association
.typ
with theTypst
language should be done.