GithubHelp home page GithubHelp logo

lewis6991 / spellsitter.nvim Goto Github PK

View Code? Open in Web Editor NEW
421.0 9.0 22.0 70 KB

Treesitter powered spellchecker

License: MIT License

Lua 89.70% Makefile 1.83% C 2.33% Scheme 4.70% TeX 1.44%
neovim-plugin tree-sitter neovim

spellsitter.nvim's Introduction

NOTICE:

The functionality of this plugin has now been merged into Neovim core as of neovim/neovim#19419 and will be available in the upcoming v0.8 release of Neovim.

This repository will be archived.

spellsitter.nvim

CI License: MIT

Enable Neovim's builtin spellchecker for buffers with tree-sitter highlighting.

What this plugin does

With set spell:

Settings Result
syntax off, Treesitter disabled syntax off no treesitter
syntax on, Treesitter disabled syntax_on_no_treesitter
Treesitter enabled ts_no_spellsitter
Treesitter (with spellsitter), ts_plus_spellsitter

Requirements

Neovim >= 0.5.0

Installation

packer.nvim:

use {
  -- Optional but recommended
  -- 'nvim-treesitter/nvim-treesitter',
  'lewis6991/spellsitter.nvim',
}

vim-plug:

" Optional but recommended
" Plug 'nvim-treesitter/nvim-treesitter'
Plug 'lewis6991/spellsitter.nvim'

NOTE: This plugin does not depend on nvim-treesitter however it is recommended in order to easily install tree-sitter parsers.

Usage

For basic setup with all batteries included:

require('spellsitter').setup()

If using packer.nvim spellsitter can be setup directly in the plugin spec:

use {
  'lewis6991/spellsitter.nvim',
  config = function()
    require('spellsitter').setup()
  end
}

NOTE: If you are running this with nvim-treesitter (which will be 99% of users), then you must make sure additional_vim_regex_highlighting is either not set or disabled. Enabling this option will likely break this plugin. Example:

require'nvim-treesitter.configs'.setup {
  highlight = {
    enable = true,
    -- additional_vim_regex_highlighting = true, -- DO NOT SET THIS
  },
}

Configuration

Configuration can be passed to the setup function. Here is an example with all the default settings:

require('spellsitter').setup {
  -- Whether enabled, can be a list of filetypes, e.g. {'python', 'lua'}
  enable = true,
  debug = false
}

You can selectively disable spellchecking based on certain criterion by writing custom autocommands using the setlocal nospell command in your init.lua like this:

local my_augroup = vim.api.nvim_create_augroup("my_augroup", { clear = true })

vim.api.nvim_create_autocmd("FileType", {
  pattern = { "python", "lua" }, -- disable spellchecking for these filetypes
  command = "setlocal nospell",
  group = my_augroup,
})
vim.api.nvim_create_autocmd("TermOpen", {
  pattern = "*", -- disable spellchecking in the embeded terminal
  command = "setlocal nospell",
  group = my_augroup,
})

Languages Supported

Spellsitter uses several methods for looking for spelling regions:

  1. It first looks for a specific spell query file. These can be found here.

  2. If there is no language specific spell query file available, then Spellsitter will try to define an inline query to capture comment nodes. As some parsers don't have this specific node name (some have comment_block, inline_comment, etc), then this might fail.

  3. Finally Spellsitter will load the highlights query which nvim-treesitter defines for most languages. From this Spellsitter will use the @comment capture. This is a standard capture name (as it maps to the TSComment highlight), so this should always succeeds, but the same time provides the most limited spellchecking experience.

If you want better spellchecking support for a specific language then please open a pull request adding a spell query file for said language.

Non-Goals

  • Support external spellchecker backends.

spellsitter.nvim's People

Contributors

askfiy avatar brunnre8 avatar jamestrew avatar jmbuhr avatar kuznetsss avatar lewis6991 avatar malramsay64 avatar nifoc avatar ram02z avatar rockerboo avatar will avatar yourealwaysbe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spellsitter.nvim's Issues

Ignore words

Would it be possible to define a list of ignored words, maybe per filetype?

E.g. In python I have some # noqa: SOMECOME to disable a specific linter in the line, which are not proper words

error: index out of range and performance problem(s)

  1. When typing in a file with bigger amount of comments, ie plugin file for packer, I get:
    spellsitter: Error executing lua: ...e/pack/packer/start/spellsitter.nvim/lua/spellsitter.lua:34: index out of range

  2. The other problem(s) could be somewhat related to the unresolved performance problem in rainbow:
    p00f/nvim-ts-rainbow#5

  3. The spellcheck somehow gets reapplied to words on other lines (the spell errors are redrawn with underlining them).

There dont show up treesitter problems.

[Question] Highlighting

Hello, the [s and ]s navigation does not match up with my actual highlights. For example, I have a file with (according to spellsitter.nvim) has no misspelled words. Thus, I press [s or ]s and correctly the cursor does not move.

However, vim highlights many other words it believes are spelled incorrectly with SpellBad - I thought the point of spellsitter was to prevent this?

Using with treesitter, syntax, and an empty spell file.

Edit: I just noticed this issue. I don't want to waste your time, but I do want to use this plugin.

To reiterate, spellsitter correctly knows what words are right and wrong in my files while surfing with [s and ]s. However, a bunch of other random words are highlighted with SpellBad. These highlights just pollute the file and distract me when all I want them to do is to be not highlighted.

plugin doesn't work for me due to the current_syntax check

Hi, I've added spellsitter to my nvim configuration. I'm using packer:

'lewis6991/spellsitter.nvim'

Then I call:

require('spellsitter').setup()

both in my scripts and I also tried calling it later from the editor. It doesn't throw any errors and I see that the plugin is correctly loaded. However the plugin seems to have no effect, it doesn't underline misspelled words as I would expect. I also see no relevant errors in nvim's :messages.

I'm using nvim 0.5.1. How could I track down the issue? Or maybe I'm misunderstanding how the plugin should work?

Error when editing perl file

Problem

Error when editing perl file

spellsitter: Error executing lua: /usr/share/nvim/runtime/lua/vim/treesitter/query.lua:161: query: invalid node type at position 1

It's this commit
88e9258

Config

require('packer').startup(function()
    use {
        'nvim-treesitter/nvim-treesitter',
        run = ':TSUpdate',
        config = function()
            require('nvim-treesitter.configs').setup {
                ensure_installed = {
                    "bash",
                    "comment",
                    "css",
                    "fish",
                    "hcl",
                    "html",
                    "java",
                    "javascript",
                    "json",
                    "lua",
                    "perl",
                    "php",
                    "ruby",
                    "rust",
                    "toml",
                    "typescript",
                    "yaml"
                },
                highlight = {
                    enable = true,
                },
                indent = {
                    enable = true
                }
            }
        end
    }

    use {
        "lewis6991/spellsitter.nvim",
        commit = "88e9258",
        requires = {
            {"nvim-treesitter/nvim-treesitter"}
        },
        config = function()
            require('spellsitter').setup {}
        end
    }
end)

Command to replicate

nvim perl_file.pl #file doesn't have to exist

How to enable support for spell checking inside a heredoc string

Hello and thank you for this plugin! Finally have spelling up and running in all its glory with treesitter enabled. Appreciate it.

I noticed that misspelled words inside of a heredoc block are not being picked up.

image

I'm not sure if this would be a feature of spellsitter.nvim or meant to be implemented/enabled somewhere else but I thought I would start here. If I need to be pointed elsewhere any help is appreciated! Thanks.

@nospell query?

In general I'm very happy with the string spellchecking you just merged in #57, however it'd be nice if calls to require like require "shellwords" didn't spellcheck shellwords

I think I've been able to figure out a query works to find those regions:

(call
  method: (identifier) @method_name
  (#eq? @method_name "require")
  arguments: ( argument_list (string (string_content) @nospell))
)

(though it's my first not trivial query, so not 100% sure)

Do you think it's feasible to also mark things as not needing spellchecking? Or really, is this something you'd consider either adding or accepting at all in the first place?

Spell sitter not showing incorrect spelling (/not working)

Hey thanks for working on this plugin, I've really been missing having spell working in treesitter languages.

Apologies for the it doesn't work type issue but for the life of me I really can't seem to get it to work. I'm not sure if this is because it's still WIP in which case I'll just wait a bit, or if it should be working.

I have the plugin configured as

    use {
      "lewis6991/spellsitter.nvim",
      config = function()
        require("spellsitter").setup {hl = "SpellBad", captures = {"comment"}}
      end
    }

I'm on the latest nvim nightly, I have spell set to 0 my other spell related settings are

--the add helper just does string concatenation more or less
vim.o.spellsuggest = add(12, vim.o.spellsuggest)
vim.o.spelloptions = "camel"
vim.o.spellcapcheck = "" -- don't check for capital letters at start of sentence
vim.o.complete = add("kspell", vim.o.complete)

FWIW it was working when it was based on hunspell although I'm very glad to be done with an external dependency.

How can I disable it in the terminal?

Hello, how are you? I hope that you are doing well!!
can someone please tell me how to disable spell checking in the terminal? I tried using this 'vim.cmd[[set nospell filetype=toggleterm]]', but it will disable this plugin

Spell Checking entire file in Rust

I am getting some unusual behavior in Rust where when using line comments, rather than stopping the spell checking at the end of the line, it continues checking the rest of the file as shown below, where both const and f64 are considered spelled incorrectly

image

However when moving to a block comment, this problem is fixed.

image

I'm not sure if there are other languages where this a problem, however I would suspect there are.

Neovim 0.6.1 spell checking not working

I updated to 0.6.1 and I happened to notice that I no longer see any indication of misspellings when writing comments in my rust codebase. This same configuration was working fine with neovim 0.5. I didn't see any errors in the logs, how would I debug to understand what is causing the failure?

amsmath latex math environments

Thanks for the fantastic plugin. The plugin already recognizes inline and display math environments like \[ \]
However there are amsmath extensions, used by all scientific papers, most significant being:
\begin{equation}
\end {equation}
Further documented here: http://www.ams.org/arc/tex/amsmath/amsldoc.pdf. Assuming that treesitter already knows how to parse them. Which seems to be the case as far as syntax highlighting is concerned. Could these also be supported?

Segfault since last commit

Hello,

I just updated to the latest commit (c90bcc3) and I have been getting segmentation faults in Neovim, at least with Python files. Not every Python file trips up the editor, so simple scripts are fine. I have attached a script which produces a segfault (I had to change the extension because of GitHub, change it back to .py):
kNN.txt

Disabling spell within comments for words matching a specific pattern?

When commenting out code blocks (say, in C++), almost all variable and function names with CamelCase or containing underscore are highlighted as bad words. Before using Tree-sitter, I was able to ignore such words using Vim's patterns. I've played around with queries in cpp/spell.scm, and could achieve only ignoring separate lines within comments that contain a specific pattern.

Is my understanding correct that with Tree-sitter it is impossible to ignore such words (without marking them as good), because the parser (at least in case of cpp) does not produce each word within comments as an individual node that could be matched against a pattern?

spell sitter overrides tree sitter's comment parser

Hi, that looks really great, thanks! And given how amazing gitsigns is I am sure this plugin will get widely adopted too.

I have just noticed that it overrides highlighting for tree sitter's comment parser, stuff like TODO:, FIXME: etc.

Could probably add them to dictionary as valid words, but perhaps that exposes some issue with how highlights are prioritised so thought I might mention it.

Thanks!

TreeSitter Extension

Could this be rewritten to be an actual Treesitter extension? That way you could enable to on a per buffer/language basis and configure it inside of Treesitter as per other Treesitter extensions.

I would be happy to do this but won't if there's no chance of it being implemented.

Not finding parser where parser name and filetype is different

I noticed a bug where it wouldn't find the parser for latex because the name of the parser being latex, and filetype being tex.

So when doing vim.treesitter.get_parser(bufnr) it would default to filetype as the second argument, resulting in the parser not being found.

We need to pass in the parser name as the second argument for this to work for languages that have a different name of the parser compared to the filetype.

I saw that nvim-treesitter has ft_to_lang(ft) which I think we could use, but then again this plugin does not have a dependency on nvim-treesitter (although it is recommended to have it).

Personally I think we should just make nvim-treesitter a hard dependency so that we could reuse the ft_to_lang instead of duplicating it.

What do you think?

SpellSitter saying spell checking is not possible

I am using neovim 5.1
I have treesitter installed
I am editing a markdown file
I misspelled a word too see if the plug in was work it didn't highlight it so I did
:spellinfo
The output was
E756: spell checking is not possible

My setup is the basic packer setup with the config inside the use

Conflict with Packer

If I use this plugin and I use PackerClean to remove the plugin which not in my plugin list, the pop-up window that Packer prompts whether to confirm the removed plug-in list will disappear, which is very strange.

Don't highlight in insert mode over word

So I don't know if this really is possible to achieve, but I wanted to open an issue about it to hear if it is possible to do.

With the built-in spellchecker, it is not highlighted while in insertmode and typing out the word. See video below

Screen.Recording.2022-02-03.at.13.10.32.mov

Here is the same thing with spellsitter.nvim enabled:

Screen.Recording.2022-02-03.at.13.10.57.mov

Is it possible to make it not highlight while the cursor is over the word and in insert mode? It's a bit distracting to see it highlight the word as bad spelling while typing out the word

How to make it work?

Ehm, a stupid question … when I install spellsitter, how to I make it to work. Installed per README, add

if has("nvim-0.5.0")

lua << EOS
require'nvim-treesitter.configs'.setup {
  -- one of "all", "language", or a list of languages
  ensure_installed = "all",
  highlight = {
    enable = true
  },
  indent = {
    enable = true
  },
}

require('spellsitter').setup{}
EOS

set foldmethod=expr
set foldexpr=nvim_treesitter#foldexpr()

endif

as ~/.vim/plugin/nvim-treesitter.vim, started neovim with rST document, and now what?

Should I set spell?

Toggle on / off

I was unable to find any leads on the possibility of toggling this plugin on / off. Is this currently supported in any way ?

Spellsitter not working anymore with treesitter highlight

Only comments still working with enable = true. Nvim 0.6
Minimal configuration:

require'nvim-treesitter.configs'.setup {
  -- One of "all", "maintained" (parsers with maintainers), or a list of languages
  ensure_installed = "maintained",

  -- Install languages synchronously (only applied to `ensure_installed`)
  sync_install = false,

  -- List of parsers to ignore installing
  ignore_install = { "javascript" },

  highlight = {
    -- `false` will disable the whole extension
    enable = true,

    -- list of language that will be disabled
    disable = { "c", "rust" },

    -- Setting this to true will run `:h syntax` and tree-sitter at the same time.
    -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
    -- Using this option may slow down your editor, and you may see some duplicate highlights.
    -- Instead of true it can also be a list of languages
    additional_vim_regex_highlighting = false,
  },
}
require('spellsitter').setup()

Spelling in code

Hello! Thank you for the plugin.

Do you have any plans to add spell checks for variable names, class names and other namings which are not keywords or names from language's standard library?

Plugin could get variables (and all other words to be checked) from TreeSitter. Then it could try to split each word into separate words by rules of the most popular naming conventions (like CamelCase, shake_case etc) and check spelling of each split.

There is the same plugin written in VimL spelunker.vim but it is not maintained and I think it could work faster written in lua with TreeSitter and asynchronous tasks.

I had the same idea of the spellchecking plugin using TreeSitter. I don't have as much experience in writing nvim plugins as you but I would like to try to contribute. You may have a vision how the plugin should be developed so feel free to assign some tickets on me.

Error opening nvim without a file

Problem

Opening nvim without a file results in this error

packer.nvim: Error running config for spellsitter.nvim: ...e/pack/packer/start/spellsitter.nvim/lua/spellsitter.lua:13: attempt to index local 'query' (a nil value)

It's this commit
d4c01de

Config

require('packer').startup(function()
    use {
        "lewis6991/spellsitter.nvim",
        commit = "d4c01de9",
        requires = {
            {"nvim-treesitter/nvim-treesitter"}
        },
        config = function()
            require('spellsitter').setup {}
        end
    }
end)

Command to replicate

nvim

Multi-line C style comments don't show all misspelled words.

With multi-line C style comments only misspelled words on the line with the closing comment sequence (*/) are shown.

For example, in this comment:

/* line one: qwer
  * line two: asdf
  * line three: zxcv */

Only "zxcv" will be shown as being misspelled.

ERROR: Failed to add extmark, lnum=%d pos=%d

Is there way to disable this log or disable feature relate to this log? This sometimes occurs when I use [s, ]s to go to next misspell. This is very annoying if I have multiple misspell in one line:
image

Invalid buffer ID when loading spellsitter in a session in nvim 0.5

Hi,

So following the most recent changes spellsitter now error whenever vim is opened using a neovim session with Error executing vim.schedule lua callback: ...e/pack/packer/start/spellsitter.nvim/lua/spellsitter.lua:176: Invalid buffer id: 1

if excluded_filetypes[api.nvim_buf_get_option(bufnr, 'filetype')] then

At appears to be checking for a buffer id that I can see from :ls! is definitely not listed. It seems like it might be missing a check to ensure the buffer is valid before checking it's filetype. I'm not sure why this is suddenly happening but wasn't previously but I suspect it relates to the autocommand changes.

You can reproduce this by

  1. Opening nvim, open some files then :mksession
  2. re-open nvim with -s Session.vim
  3. Should reproduce this error

Ignore symbols from code.

Given

// misspelledd
void misspelledd();

Current behavior

"misspelledd" is flagged as spelling error.

Desired behavior

"misspelledd" is not flagged because it is a symbol in the code.

z= ignores my mappings

I have the following mapping to pick spell suggestion via telescope and it works as expected:

vim.api.nvim_set_keymap('n', 'z=', '<Cmd>Telescope spell_suggest theme=get_dropdown<CR>', { noremap = true })

However the plugin ignores it and shows regular spell suggestion picker instead. Can I somehow override it?

Name of plain text object for latex treesitter.

Not really an issue, but how do I only spell check
normal text in latex.
e.g.
\section
This stuff here is normalu text.
%normalu should be underlined.

I tried captures = {'text', 'normal'}, this
doesn't work. I have no idea what treesistter
calls normal text objects for latex.

Not beeing able to clear the spell highlights

If I understand it correctly, spellsitter applies its own highlight, when activating spell via set spell and disables the builtin spell directly afterwards:

M._wrap_map = function(key)
vim.wo.spell = true
vim.schedule(function()
vim.wo.spell = false
end)
return key

This applies the highlights on the buffer. But the normal workflow with the built-in spell option is to enable it, to see the highlights, and disable it to clear the SpellBad highlights.

Is there a way to clear the highlights? Preferably with set nospell but if not feasible, with an extra command? If you point me towards the right direction, I could give it a try.

Add specific treesitter queries for each filetype

I am trying to recover the sane spell checking behavior vim has as default.
It seems like spellsitter alone isn't enough, and I have to manually configure it.

Example cases:

  • Python: I want to have my doc-strings and comments spell-checked.
    (If you want to make it even better, don't spell-check symbols marked with ticks``)
    However, with TreeSitter+spellsitter the doc-strings aren't spell-checked.
    If I use set spell, then suddenly all my code is checked.

  • LaTeX: The whole document is text, so it should be spell-checked.
    Unless, of course, it's a command, then ignore it.

In principle, I just want back the good vim spell checking :-)

Error executing lua, invalid window id 1

image
Getting that error whenever there is grammar error.

Configuration:

call plug#begin()
Plug 'lewis6991/spellsitter.nvim'
call plug#end()
setlocal spell
set spelllang=pt_br,en_us
lua <<EOF
require('spellsitter').setup{
    enable = true,
  }
...

Python docstrings are not spell-checked

Hi!
I noticed in Python, docstrings are not spellchecked. Line comments are spellchecked as expected.
For context, docstrings are a special type of comments in Python that are reserved for documentation (similar to C++ Doxygen). They are introduced by three quotation marks, e.g.

"""Docstring.""""
# line comment

Since they usually, like line comments, contain human language, they are a similar candidate for spell checking. This feature would be highly appreciated 😸 .

Huge performance degradation

Since 6035839 I am seeing a huge performance issue with this plugin. When editing a larger YAML file, neovim ends up in a 100 percent CPU loop for ages. I can press Ctrl-C and see a message inline in the edited file that spellsitter was interrupted, but the 100% block starts again when trying to do anything.

This does not happen with the commit before the linked one.

Plugin doesn't check spelling even in strings

Hello.
I've guessed the goal of this plugin is to improve default nvim's spellchecking add prevent some spelling for keywords as const or something like that.
But it even doesn't highlight words in string.
Here is .tsx example:

image

it doesn't seem to work

I don't know why, but it doesn't look like it specifically:

图片

I'm sure I have spell check turned on:

vim.o.spell = true,
vim.o.spelllang = "en_us,cjk",

And I have treesitter installed, here is the configuration:

-- https://github.com/nvim-treesitter/nvim-treesitter
-- https://github.com/p00f/nvim-ts-rainbow
-- https://github.com/JoosepAlviste/nvim-ts-context-commentstring

local M = {}

function M.before() end

function M.load()
	local ok, m = pcall(require, "nvim-treesitter.configs")
	if not ok then
		return
	end

	M.nvim_treesitter = m
	M.nvim_treesitter.setup({
		ensure_installed = "all",
		highlight = {
			enable = true,
			additional_vim_regex_highlighting = false,
		},
		-- incremental selection
		incremental_selection = {
			enable = true,
			keymaps = {
				init_selection = "<cr>",
				node_incremental = "<cr>",
				node_decremental = "<bs>",
				scope_incremental = "<tab>",
			},
		},
		-- nvim-ts-rainbow
		rainbow = {
			enable = true,
			extended_mode = true,
		},
		-- nvim-ts-context-commentstring
		context_commentstring = {
			enable = true,
			enable_autocmd = false,
			config = {
				css = "/*%s*/",
			},
		},
	})
end

function M.after() end

return M

Error executing lua when opening nvim with no file argument

When opening nvim with no file argument. I.e.

$ nvim

I receive the error

(UNKNOWN PLUGIN): Error executing lua: attempt to call a nil value
                                                                  stack traceback:

This is a corrupted line of output and i don't know how to get the actual stack trace.

However, i tracked down the bug to commit 504e897, and Line 192 of the enabled function in spellsitter.lua

if not vim.treesitter.highlighter.active[bufnr] then

It looks like vim.treesitter is nil if there is not a file open (though it could also be that displaying the open file just hides the error above). Here is a patch that fixes it, but i'm not sure if it's the "right" solution. Perhaps oddly, returning false if vim.treesitter is nil results in the same error.

diff --git a/lua/spellsitter.lua b/lua/spellsitter.lua
index 55bf1c1..62fcd00 100644
--- a/lua/spellsitter.lua
+++ b/lua/spellsitter.lua
@@ -149,8 +149,10 @@ local function enabled(bufnr, winid)
   if not vim.wo[winid].spell then
     return false
   end
-  if not vim.treesitter.highlighter.active[bufnr] then
-    return false
+  if not vim.treesitter == nil then
+    if not vim.treesitter.highlighter.active[bufnr] then
+      return false
+    end
   end
   local ft = vim.bo[bufnr].filetype
   if config.enable ~= true and not vim.tbl_contains(config.enable, ft) then

Version info:

$ nvim -v
NVIM v0.6.0
Build type: Release
LuaJIT 2.0.5
Compiled by builduser

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

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Spellsitter: 2cb4700
nvim-treesitter: 288ef60edde1b5a49c325b0770bdf999ae648a92

Not working Neovim 0.5.1 ?

I notice that Spellsitter not working my Neovim 0.5.1. Is there any breaking change ?

My config:

-- Options
-----------------------------------------------------------------------------//
-- Spelling {{{1
-----------------------------------------------------------------------------//
local opt = vim.opt
-- opt.spell = true
-- opt.spellfile = string.format('%s/%s', vim.fn.stdpath 'config', 'spell/en.utf-8.add')
opt.spellsuggest:prepend { 12 }
opt.spelloptions = 'camel'
opt.spellcapcheck = '' -- don't check for capital letters at start of sentence
opt.fileformats = { 'unix', 'mac', 'dos' }
    {
      'lewis6991/spellsitter.nvim',
      after = 'nvim-treesitter',
      config = function()
        require('spellsitter').setup()
      end,
    },

Update queries for split markdown parser

nvim-treesitter/nvim-treesitter#3048 split the markdown parser into markdown and markdown_inline. Using the new parser causes errors like spellsitter: Error executing share/nvim/runtime/lua/vim/treesitter/query.lua:174: query: invalid node type at position 2

I think it is related to this change regarding the heading_content field but I don't know what the correct fix should be.

;; From MDeiml/tree-sitter-markdown
(atx_heading (heading_content) @text.title)
(setext_heading (heading_content) @text.title)
;From MDeiml/tree-sitter-markdown
(atx_heading (inline) @text.title)
(setext_heading (paragraph) @text.title)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.