|
From: | Perry Smith |
Subject: | Are variations such as these desired? |
Date: | Mon, 12 Dec 2022 18:46:29 -0600 |
Adding on to the ruby-ts-mode I thought I would point out an example of the type of power available with tree sitter. With a not so complex function:
And two indent rules: ((query "(array \"[\" ( (_) ( \",\" (_) )*) @indent \",\"? \"]\")") my-func ruby-ts-mode-indent-offset) ((n-p-gp "]" "array" "assignment") grand-parent ruby-ts-mode-indent-offset) The programmer can now right justify elements of an array in two different fashions: if dog array = [ 145, 21110, 11 ] end if dog array = [ 145, 21110, 11] end The two rules could be conditionally added to the rest of the rules via a customizable boolean variable such as ruby-ts-mode--right-justify-arrays (for example). And this concept could be applied to hashes. The possibilities are almost endless. My question is, do others see adding this versatility at this point in time to the Emacs distribution as desirable? Should we wait and see how users use the new system? Perhaps some see both of the above formats as abominations. Perry |
signature.asc
Description: Message signed with OpenPGP
[Prev in Thread] | Current Thread | [Next in Thread] |