I have installed the up-to-date tree-sitter-typescript, and it works well in typescript files without shebang.
I searched online but couldn't find any particularly similar questions. Some people reported that their treesitter was not functioning properly, but mine was able to parse the AST correctly:
Here is my treesitter config:
{
highlight = {
enable = true,
},
ensure_installed = {
"c",
"cpp",
"lua",
"vim",
"vimdoc",
"regex",
"markdown",
"markdown_inline",
"latex",
"javascript",
"json",
"typescript",
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<CR>",
node_incremental = "<CR>",
node_decremental = "<BS>",
scope_incremental = "<TAB>",
},
},
}
:echo &filetype
print?ts
. Anyway the Tresitter seems to parse correctly the file. The problem seems to be in the colorization. I'm away from computers for some days. I'll try to reproduce your problem when I can :-/filetype
for typescript files (file with a.ts
extension) seems to betypescript
. Could you confirm the return value of the:set ft?
command? Could you share the content of the file (it make it easier to reproduce your problem)?