p00f / nvim-ts-rainbow

Rainbow parentheses for neovim using tree-sitter. Use https://sr.ht/~p00f/nvim-ts-rainbow instead
Apache License 2.0
869 stars 67 forks source link

Not working with typescript #44

Closed kaykhancheckpoint closed 3 years ago

kaykhancheckpoint commented 3 years ago

Hi friends i have this module installed but it does not seem to be working for typescript .ts files. To be honest im not even sure if tree-sitter is working at all, ive noticed no difference, but the rainbow parenthesis color is deff no working.

init.vim

lua << EOF
require'nvim-treesitter.configs'.setup {
  rainbow = {
    enable = true,
    extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean
    max_file_lines = 1000, -- Do not enable for files with more than 1000 lines, int
  }
}
EOF

:TSConfigInfo

{                                                                                                                                                                                                                           
  ensure_installed = {},
  ignore_install = {},
  modules = {
    highlight = {
      additional_vim_regex_highlighting = false,
      custom_captures = {},
      disable = { "c", "rust" },
      enable = true,
      loaded = true,
      module_path = "nvim-treesitter.highlight"
    },
    incremental_selection = {
      disable = {},
      enable = false,
      keymaps = {
        init_selection = "gnn",
        node_decremental = "grm",
        node_incremental = "grn",
        scope_incremental = "grc"
      },
      module_path = "nvim-treesitter.incremental_selection"
    },
    indent = {
      disable = {},
      enable = false,
      module_path = "nvim-treesitter.indent"
    },
    rainbow = {
      enable = true,
      extended_mode = true,
      max_file_lines = 1000
    }
  },
  update_strategy = "lockfile"
}

image

:checkhealth nvim_treesitter

health#nvim_treesitter#check
========================================================================
## Installation
  - OK: `tree-sitter` found  0.19.5 (8d8690538ef0029885c7ef1f163b0e32f256a5aa) (parser generator, only needed for :TSInstallFromGrammar)
  - OK: `node` found v12.18.3 (only needed for :TSInstallFromGrammar)
  - OK: `git` executable found.
  - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl" }
  - OK: Neovim was compiled with tree-sitter runtime ABI version 13 (required >=13). Parsers must be compatible with runtime ABI.

## Parser/Features H L F I
  - c_sharp        ✓ . ✓ . ✓ 
  - bibtex         ✓ . ✓ ✓ . 
  - python         ✓ ✓ ✓ ✓ ✓ 
  - r              ✓ ✓ . . . 
  - comment        ✓ . . . . 
  - lua            ✓ ✓ ✓ ✓ ✓ 
  - ocaml          ✓ ✓ ✓ . ✓ 
  - go             ✓ ✓ ✓ ✓ ✓ 
  - scss           ✓ . . ✓ . 
  - json           ✓ ✓ ✓ ✓ . 
  - jsdoc          ✓ . . . . 
  - ledger         ✓ . ✓ ✓ ✓ 
  - php            ✓ ✓ ✓ ✓ ✓ 
  - clojure        ✓ ✓ ✓ . ✓ 
  - supercollider  ✓ ✓ ✓ ✓ ✓ 
  - typescript     ✓ ✓ ✓ ✓ ✓ 
  - fennel         ✓ ✓ . . ✓ 
  - query          ✓ ✓ ✓ ✓ ✓ 
  - cpp            ✓ ✓ ✓ ✓ ✓ 
  - vue            ✓ . ✓ . ✓ 
  - latex          ✓ . ✓ . . 
  - rst            ✓ ✓ . . ✓ 
  - css            ✓ . ✓ ✓ ✓ 
  - zig            ✓ ✓ ✓ ✓ ✓ 
  - erlang         . . . . . 
  - regex          ✓ . . . . 
  - svelte         ✓ . ✓ ✓ ✓ 
  - c              ✓ ✓ ✓ ✓ ✓ 
  - fortran        ✓ . ✓ ✓ . 
  - teal           ✓ ✓ ✓ ✓ ✓ 
  - java           ✓ ✓ . ✓ ✓ 
  - gomod          ✓ . . . . 
  - dart           ✓ ✓ . ✓ ✓ 
  - verilog        ✓ ✓ ✓ . ✓ 
  - bash           ✓ ✓ ✓ . ✓ 
  - yaml           ✓ ✓ ✓ ✓ ✓ 
  - julia          ✓ ✓ ✓ . ✓ 
  - turtle         ✓ ✓ ✓ ✓ ✓ 
  - html           ✓ ✓ ✓ ✓ ✓ 
  - beancount      ✓ . ✓ . . 
  - commonlisp     ✓ ✓ ✓ . . 
  - swift          . . . . . 
  - glimmer        ✓ . . . . 
  - elm            . . . . . 
  - ocaml_interface✓ ✓ ✓ . ✓ 
  - cuda           ✓ ✓ ✓ ✓ . 
  - haskell        . . . . . 
  - ocamllex       ✓ . . . ✓ 
  - kotlin         ✓ . . . ✓ 
  - ruby           ✓ ✓ ✓ ✓ ✓ 
  - fish           ✓ ✓ ✓ ✓ ✓ 
  - devicetree     ✓ ✓ ✓ ✓ ✓ 
  - scala          . . . . . 
  - dockerfile     ✓ . . . ✓ 
  - rust           ✓ ✓ ✓ ✓ ✓ 
  - toml           ✓ ✓ ✓ ✓ ✓ 
  - ql             ✓ ✓ . ✓ ✓ 
  - javascript     ✓ ✓ ✓ ✓ ✓ 
  - nix            ✓ ✓ ✓ . ✓ 
  - jsonc          ✓ ✓ ✓ ✓ ✓ 
  - graphql        ✓ . . ✓ ✓ 
  - gdscript       ✓ ✓ . . ✓ 
  - sparql         ✓ ✓ ✓ ✓ ✓ 
  - tsx            ✓ ✓ ✓ ✓ ✓ 

 Legend: H[ighlight], L[ocals], F[olds], I[ndents]
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang}
p00f commented 3 years ago

Can you paste the typescript code here?

kaykhancheckpoint commented 3 years ago

Can you paste the typescript code here?

Just want to point out im new to this plugin, so i could be doing something entirely wrong. Let me know if you need me to provide you with more information

import MySQL from "./services/mysql.service";

export const InsertIntoPersonGame = async (payload) => {
    const connection = MySQL();

    const query = "INSERT INTO person_game SET ?";

    try {
        const results = await connection.query(query, payload);

        return results;
    } catch (err) {
        throw err;
    } finally {
        await connection.end();
        connection.quit();
    }
};

export const GetTrackedGames = async () => {
    const connection = MySQL();

    const query = `
        SELECT *
        FROM discovery_games
    `;

    try {
        const results = await connection.query(query);
        return results;
    } catch (err) {
        throw err;
    } finally {
        await connection.end();
        connection.quit();
    }
};
p00f commented 3 years ago

Should be fixed now, sorry about that - I don't know typescript so I couldn't test it thoroughly

kaykhancheckpoint commented 3 years ago

Should be fixed now, sorry about that - I don't know typescript so I couldn't test it thoroughly

thanks, and how do i update the module to get your fix?

p00f commented 3 years ago

Use the update command from your package manager

kaykhancheckpoint commented 3 years ago

Use the update command from your package manager

Ye thats the first thing i tried :PlugUpdate but no change to nvim-treesitter

p00f commented 3 years ago

Did you install this module using vim-plug?

kaykhancheckpoint commented 3 years ago

Did you install this module using vim-plug?

I have installed nvim-treesitter via vim-plug and this is one of the modules included https://github.com/nvim-treesitter/nvim-treesitter/wiki/Extra-modules-and-plugins

p00f commented 3 years ago

It's not "included" in the main plugin, it just works with the main plugin's module system. You still have to install it separately

kaykhancheckpoint commented 3 years ago

It's not "included" in the main plugin, it just works with the main plugin's module system. You still have to install it separately

oh! Well yep its working now hhhh

thanks again