bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#66845: 29.1; cmake-ts-mode indentation broken


From: Randy Taylor
Subject: bug#66845: 29.1; cmake-ts-mode indentation broken
Date: Tue, 31 Oct 2023 15:50:43 +0000

On Tuesday, October 31st, 2023 at 07:35, Juan Palacios <jpalaciosdev@gmail.com> 
wrote:
> Using cmake grammar from https://github.com/uyha/tree-sitter-cmake
> 
> Reproduction:
> 1. emacs -q
> 2. C-x C-f test.cmake
> 3. M-x cmake-ts-mode
> 4. Insert the following text:
> if(TRUE)
> message("indent")
> endif()
> 5. Move the point to the beginning of the second line.
> 6. TAB
> 7. Notice that no indentation is performed.
> 
> treesit-simple-indent-rules local value:
> ((cmake
> ((node-is ")")
> parent-bol 0)
> ((node-is "else_command")
> parent-bol 0)
> ((node-is "elseif_command")
> parent-bol 0)
> ((node-is "endforeach_command")
> parent-bol 0)
> ((node-is "endfunction_command")
> parent-bol 0)
> ((node-is "endif_command")
> parent-bol 0)
> ((parent-is "foreach_loop")
> parent-bol cmake-ts-mode-indent-offset)
> ((parent-is "function_def")
> parent-bol cmake-ts-mode-indent-offset)
> ((parent-is "if_condition")
> parent-bol cmake-ts-mode-indent-offset)
> ((parent-is "normal_command")
> parent-bol cmake-ts-mode-indent-offset)))
> 
> treesit-explore-mode shows:
> (if_condition
> (if_command (if) (
> (argument_list
> (argument (unquoted_argument)))
> ))
> (body
> (normal_command (identifier) (
> (argument_list
> (argument
> (quoted_argument " (quoted_element) ")))
> )))
> (endif_command (endif) ( )))
> 

Thanks for the report, I'll take a look tonight.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]