Very early days (and not as innovative as a lot of the things I see on here), but I started working on a vscode extension that takes some ideas from semantic editing to build something sort of vimlike but that has things like functions, parameters, etc as first class ideas so you can e.g. press f to select the nearest function, press q to go to parameters, and then press a to append a new parameter at the end (which adds a comma and space, or newline and space, or whatever, and then drops you in insert mode) Here's a little video if you're interested -
https://youtu.be/owuuFxDBQh4▾
🍰 1
💓 3
k
Kartik Agaram
09/09/2024, 3:16 PM
Ooh so cool! I can't believe I haven't thought to want this before.
I wonder how many such polyglot concepts there are like statement, function, argument. Argument in particular is a powerful one that many tools don't do much with.
Idea: include a couple of paredit like hotkeys for broadening or narrowing the selection. For example, wanting to append to the lhs and then rhs of a parallel assignment statement.
z
Zachary Miller
09/09/2024, 4:08 PM
That's a good idea! I have a way to go up and down on the tree, (e.g. go from one parameter to all of them) but I don't have something for extending to include siblings but it would be easy to add
Zachary Miller
09/09/2024, 4:13 PM
My thinking was that there are a relatively small number of concepts that people care about in most languages, and c like languages are similar enough that you can get 95% of what you want across all those languages pretty easily. The demo is typescript but I've done some testing with go and rust and it mostly works
❤️ 1
d
Daniel Garcia
09/10/2024, 2:09 AM
This is really cool.
Did you follow any tutorial on how to create a vscode extension?