I can't get nvim to use lsp on jsx files or Golang files.
As soon as I do :TSInstall jsx I get
Installation not possible: ...er/start/nvim-treesitter/lua/nvim-treesitter/install.lua:87: Parser not available for language "jsx"
See https://github.com/nvim-treesitter/nvim-treesitter/#adding-parsers on how to add a new parser!
Can someone tell me please, how do get jsx to work on nvim?
I don't really see any helpful tips. I expect to see something when I put my mouse on ${person.name} here
but I only see very basic highlighting:
function greet(person: Person): string {
return `Hello, my name is ${person.name} and I am ${person.age} years old.`;
}
or here:
jenia@archlinux ~/g/go-throw-away (main) [2]> cat test.go
package main
import "fmt"
type Person struct {
Name string
Age int
}
func Greet(person Person) string {
return fmt.Sprintf("Hello, %s! You are %d years old.", person.Name, person.Age)
}
func main() {
p := Person{Name: "Alice", Age: 30}
fmt.Println(Greet(p))
}
But it doesn't show me anything useful besides very basic highlighting.
jenia@archlinux ~/g/go-throw-away (main) [2]> gopls version
golang.org/x/tools/gopls v0.20.0
nvim --version
NVIM v0.11.4
Build type: RelWithDebInfo
LuaJIT 2.1.1753364724
Run "nvim -V1 -v" for more info
==============================================================================
nvim-treesitter: ✅
Installation ~
- ✅ OK `tree-sitter` found 0.25.9 (a467ea8502d95562171f97953a6dc5b2a8622609) (parser generator, only needed for :TSInstallFromGrammar)
- ✅ OK `node` found v20.19.4 (only needed for :TSInstallFromGrammar)
- ✅ OK `git` executable found.
- ✅ OK `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
Version: cc (GCC) 15.2.1 20250813
- ✅ OK Neovim was compiled with tree-sitter runtime ABI version 15 (required >=13). Parsers must be compatible with runtime ABI.
OS Info:
{
machine = "x86_64",
release = "6.16.6-arch1-1",
sysname = "Linux",
version = "#1 SMP PREEMPT_DYNAMIC Wed, 10 Sep 2025 00:38:07 +0000"
} ~
Parser/Features H L F I J
- bash ✓ ✓ ✓ . ✓
- c ✓ ✓ ✓ ✓ ✓
- javascript ✓ ✓ ✓ ✓ ✓
- lua ✓ ✓ ✓ ✓ ✓
- markdown ✓ . ✓ ✓ ✓
- markdown_inline ✓ . . . ✓
- python ✓ ✓ ✓ ✓ ✓
- query ✓ ✓ ✓ ✓ ✓
- tsx ✓ ✓ ✓ ✓ ✓
- typescript ✓ ✓ ✓ ✓ ✓
- vim ✓ ✓ ✓ . ✓
- vimdoc ✓ . . . ✓
Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
+) multiple parsers found, only one will be used
x) errors found in the query, try to run :TSUpdate {lang} ~
==============================================================================
vim.treesitter: ✅
Treesitter features ~
- Treesitter ABI support: min 13, max 15
- WASM parser support: false
Treesitter parsers ~
- ✅ OK Parser: bash ABI: 15, path: /usr/share/nvim/runtime/parser/bash.so
- ✅ OK Parser: c ABI: 14, path: /home/jenia/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/c.so
- ✅ OK Parser: c (not loaded), path: /usr/share/nvim/runtime/parser/c.so
- ✅ OK Parser: javascript ABI: 14, path: /home/jenia/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/javascript.so
- ✅ OK Parser: lua ABI: 14, path: /home/jenia/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/lua.so
- ✅ OK Parser: lua (not loaded), path: /usr/share/nvim/runtime/parser/lua.so
- ✅ OK Parser: markdown ABI: 15, path: /usr/share/nvim/runtime/parser/markdown.so
- ✅ OK Parser: markdown_inline ABI: 15, path: /usr/share/nvim/runtime/parser/markdown_inline.so
- ✅ OK Parser: python ABI: 14, path: /usr/share/nvim/runtime/parser/python.so
- ✅ OK Parser: query ABI: 15, path: /usr/share/nvim/runtime/parser/query.so
- ✅ OK Parser: tsx ABI: 14, path: /home/jenia/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/tsx.so
- ✅ OK Parser: typescript ABI: 14, path: /home/jenia/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/typescript.so
- ✅ OK Parser: vim ABI: 14, path: /home/jenia/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/vim.so
- ✅ OK Parser: vim (not loaded), path: /usr/share/nvim/runtime/parser/vim.so
- ✅ OK Parser: vimdoc ABI: 15, path: /usr/share/nvim/runtime/parser/vimdoc.so
jenia@archlinux ~/g/go-throw-away (main) [1]> cat ~/.config/nvim/init.lua
-- Install packer if not present
local install_path = vim.fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
vim.fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
vim.cmd [[autocmd VimEnter * PackerSync]]
end
-- Plugins
require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
use 'nvim-treesitter/nvim-treesitter'
use 'neovim/nvim-lspconfig'
end)
-- Treesitter
require('nvim-treesitter.configs').setup({
ensure_installed = { 'go', 'javascript', 'typescript', 'tsx' },
highlight = { enable = true },
indent = { enable = true },
})
-- Filetype detection for React
vim.filetype.add({
extension = {
jsx = 'javascriptreact',
tsx = 'typescriptreact',
},
})
-- Treesitter language registration
vim.treesitter.language.register('javascript', 'javascriptreact')
vim.treesitter.language.register('typescript', 'typescriptreact')
-- LSP shared on_attach
local lsp_on_attach = function(client, bufnr)
client.server_capabilities.semanticTokensProvider = nil
local opts = { buffer = bufnr, noremap = true, silent = true }
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, opts)
end
-- Go LSP
require('lspconfig').gopls.setup({
filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' },
settings = {
gopls = {
analyses = { unusedparams = true },
staticcheck = true,
},
},
on_attach = lsp_on_attach,
})
-- TypeScript/JavaScript LSP
require('lspconfig').ts_ls.setup({
filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact' },
on_attach = lsp_on_attach,
})
-- Diagnostics
vim.diagnostic.config({
virtual_text = true,
signs = true,
float = { border = 'rounded' },
})