Tree sitter causes bad indentation in typescript multi line comments. The behavior is inconsistent with neovim's out of the box behavior and incorrect whether indent module is enabled or disabled, tho the behavior is different depending on the indent module.
With an empty init.vim and no plugins typing i/*<enter><enter>/<esc> yields an expected value
/*
*
*/
Typing o in the middle line has correct indentation as well
/*
* <- o here
*
*/
However with treesitter installed and the highlight module enabled the same keystrokes indent the second two lines (i/*<enter><enter>/<esc>)
require('nvim-treesitter.configs').setup {
ensure_installed = 'all',
highlight = { enable = true},
}
return require('packer').startup(function()
use 'wbthomason/packer.nvim'
use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' }
end)
/* <- enter enter here
*
*/
With the indent module enabled the initial comment is correct but new lines with o are indented wrong
~ » nvim --version
NVIM v0.8.0-1210-gd367ed9b2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by runner@fv-az505-656
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/share/nvim"
Run :checkhealth for more info
Additional context
The issue affects both typescript and javascript but not java.
Describe the bug
Tree sitter causes bad indentation in typescript multi line comments. The behavior is inconsistent with neovim's out of the box behavior and incorrect whether indent module is enabled or disabled, tho the behavior is different depending on the indent module.
With an empty init.vim and no plugins typing
i/*<enter><enter>/<esc>
yields an expected valueTyping
o
in the middle line has correct indentation as wellHowever with treesitter installed and the highlight module enabled the same keystrokes indent the second two lines (
i/*<enter><enter>/<esc>
)With the indent module enabled the initial comment is correct but new lines with
o
are indented wrongInitial comment
See that the third line has no space padding.
To Reproduce
See above
Expected behavior
The
*
s should be vertically aligned, matching the neovim's out of the box behavior.Output of
:checkhealth nvim-treesitter
Output of
nvim --version
Additional context
The issue affects both typescript and javascript but not java.