wkirschbaum / elixir-ts-mode

Elixir mode using Treesitter for fontification, navigation and indentation
GNU General Public License v3.0
61 stars 11 forks source link

incorrect parsing when keywords included inside docstrings #46

Closed thebinary closed 6 months ago

thebinary commented 6 months ago

I am not certain if this is an issue related to this particular ts-mode or smartparens-mode or elixir-treesitter itself. But it seems like keywords inside docstrings are being parsed as keywords instead of simply taken as strings.

With smartparens-mode active, the issue is visually reflected as some example screenshots given below:

Correct parsing

Here, the defmodule begin and end is correctly parsed.

Screenshot 2024-04-19 at 13 16 51

Incorrent parsings due to keywords inside docstring

Here, the defmodule begin and end is MISLEAD by for string inside the moduledoc

Screenshot 2024-04-19 at 13 07 54

Here, the for inside docstring is shown to have no end because of defmodule string ahead of it inside the moduledoc.

Screenshot 2024-04-19 at 13 08 33
thebinary commented 6 months ago

Apologies, seems like issue with smartparens-mode. Since treesit-beginning-of-defun and treesit-end-of-defun functions are working correctly.

wkirschbaum commented 6 months ago

@thebinary there was a discussion about this on emacs-devel and think there are ways to make it work better together, but it won't happen soon.