Replies: 3 comments 4 replies
-
In theory treesitter's |
Beta Was this translation helpful? Give feedback.
-
I'm also interested in getting support for different formats. I'm wondering what would be the maintainers' preferred way to handle this?
Option 2 could look something like: [increment.verilog-based-hex]
pattern = "(%d*)'h([%x_]+)"
base = 16
[increment.verilog-based-bin]
pattern = "(%d*)'b([01_]+)"
base = 2
[[language]]
name = "verilog"
increment = ["verilog-based-hex", "verilog-based-bin"] |
Beta Was this translation helpful? Give feedback.
-
IMO this should be a plugin: it would be a fair amount of effort to build/maintain broad language support for a fairly small feature. It would be a good test of how much of the tree-sitter internals we can expose through a plugin interface in the future though. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As it is now, numbers have to be either decimal,
0bxxx
or0xyyy
. It would be neat if there could be prefix rules per language. In verilog, decimals with fixed length are dictated like so:3'b000
. Helix doesn't pick up on this because it expects0b
. Similarly, it's'h
instead of0x
. I think the defaults as they are are sensible, but being able to add per language rules would be a real time saver. I also think that we should be able to have 1 zero-length prefix, so we could have say hex as the default behavior for<C-a>
instead of just decimal. Similarly, maybe being able to modify behavior ofswitch-case
so that we could flip 1's and 0's, though maybe that should be a separate issue.Beta Was this translation helpful? Give feedback.
All reactions