1

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: Treesitter parses the AST well, but the highlight is improper

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>",
    },
  },
}
3
  • Maybe it's just my poor eyesight but with that colorful background image of yours, I wonder how you can read anything at all. Please use text to represent text as much as possible. I understand this is about syntax highlighting (or the lack thereof) and this may be illustrated by an image. I'd appreciate a screenshot with a uniform background. Having said that, what does :echo &filetype print?
    – Friedrich
    Commented Aug 1 at 7:16
  • 1
    From the screenshot I believe the filetype is 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 :-/
    – Vivian De Smedt
    Commented Aug 1 at 9:13
  • I can't reproduce your problem. The default filetype for typescript files (file with a .ts extension) seems to be typescript. 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)?
    – Vivian De Smedt
    Commented 17 hours ago

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.