tree-sitter / tree-sitter-typescript

TypeScript grammar for tree-sitter
MIT License
341 stars 104 forks source link

parser_config.tsx.used_by is not working #161

Closed craftzdog closed 3 years ago

craftzdog commented 3 years ago

This works:

local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.typescript.used_by = "javascript"

But this doesn't work:

local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.tsx.used_by = "javascript"

What am I missing?

:checkhealth nvim_treesitter result:

health#nvim_treesitter#check
========================================================================
## Installation
  - OK: `tree-sitter` found  0.19.5 (parser generator, only needed for :TSInstallFromGrammar)
  - OK: `node` found v16.2.0 (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
  - tsx            ✓ ✓ ✓ ✓ ✓
  - typescript     ✓ ✓ ✓ ✓ ✓
  - javascript     ✓ ✓ ✓ ✓ ✓

 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}
nvim --version
NVIM v0.5.0-dev+1411-gb28d458f8
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/tmp/neovim-20210615-45542-4diuf7/build/config -I/tmp/neovim-20210615-45542-4diuf7/src -I/opt/homebrew/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/opt/homebrew/opt/gettext/include -I/tmp/neovim-20210615-45542-4diuf7/build/src/nvim/auto -I/tmp/neovim-20210615-45542-4diuf7/build/include
Compiled by ***

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/HEAD-b28d458_2/share/nvim"

Run :checkhealth for more info
craftzdog commented 3 years ago

I guess it's due to this issue: https://github.com/nvim-treesitter/nvim-treesitter/issues/1317