The "First-class syntactic selection" reminds me of my most used shortcut(s) in Jetbrains IDEs: the Expand / Shrink Selection. Ctrl + W Ctrl + Shift + W https://www.jetbrains.com/help/idea/working-with-source-code... It really changed my perspective on interacting with the 'text' of a file. VS Code, Zed, etc. have similar operations, but in my experience they expand and shrink too coarsely.
Ki Editor - an editor that operates on the AST
71–80 of 154 posts
Re: Ki Editor - an editor that operates on the AST
#72The "First-class syntactic selection" reminds me of my most used shortcut(s) in Jetbrains IDEs: the Expand / Shrink Selection. Ctrl + W Ctrl + Shift + W https://www.jetbrains.com/help/idea/working-with-source-code... It really changed my perspective on interacting with the 'text' of a file. VS Code, Zed, etc. have similar operations, but in my experience they expand and shrink too coarsely.
Also available as `incremental selection` in Neovim via tree-sitter.
Re: Ki Editor - an editor that operates on the AST
#73I made the vscode integration for this. I feel bad that I haven’t contributed much since, it’s a really cool project. IMO it’s important to try to innovate in the foundational tools of our craft (editors, languages, tooling, OS, etc) which Ki does.
Re: Ki Editor - an editor that operates on the AST
#74I'll wait till an Emacs package is available
Re: Ki Editor - an editor that operates on the AST
#75I feel so illiterate when it comes to AST editing sometimes. I understand what an AST is from a computer science perspective. But I've never worked on a huge software refactor before that required direct AST textobject editing. Maybe an indication of my skill level... The extent of my usage is having nice textobjects to easily interact with arglists and functions which aren't native to (neo)vim. Very cute and nice to…
> I guess it's hard for me to edit things that I don't see right in front of me or aren't super simple changes (like name changes). Or at least, basic things I can reason about (such as finding by regex then deleting by textobject or something). This is actually what's nice about tools like ast-grep. The pattern language reads almost like the code itself so you can see the transformation right in front of you (at lea…
If your editor of choice supports an extension (vscode does for example) it's a very easy on-ramp for a better search/replace than regex offers. It's syntax-aware so you don't need care about whitespace, indentation etc. Very easy to dip your toes in where a regex would get complex fast, or require multiple passes.
I converted a codebase from commonjs to esm trivially with a few commands right after first installing it. Super useful.
I hope LLMs eventually start operating at this level rather than raw text. And likewise for them to leverage the language server to take advantage of built in refactorings etc
Re: Ki Editor - an editor that operates on the AST
#76Earlier quoted context omitted.
Mine are: Cmd+Shift+V - Stacked clipboard, you can start typing to search or hit a number to choose what to paste (keeps everything you've copied/cut inside jetbrains for a while) Cmd+Shift+E - Recent locations, you can start typing to search - shows little buffers of where you've been recently Cmd+Shift+A - Action tab of the command palette - fuzzy search for any command (really the only shortcut you need, other tha…
Hero! I had not done my homework/have not been aware, but these all look fantastic! The stacked clipboard is something I periodically mentally complain about (Why is clipboard on every OS/tool I've used single item?) I will add one that are possibly more well-known: - ctrl + shift + F: Find text in any file - ctrl + N: Find types (structs, classes etc) - ctrl + shift + N: Find any file by name or path
Re: Ki Editor - an editor that operates on the AST
#77Re: Ki Editor - an editor that operates on the AST
#78I feel so illiterate when it comes to AST editing sometimes. I understand what an AST is from a computer science perspective. But I've never worked on a huge software refactor before that required direct AST textobject editing. Maybe an indication of my skill level... The extent of my usage is having nice textobjects to easily interact with arglists and functions which aren't native to (neo)vim. Very cute and nice to…
I don't find myself doing huge structural refactoring often enough that it would be worth my while to learn a specialized tool for doing it; I'm a quick typist, and it's easy enough to just blat through the changes by hand on the rare occasion such a thing is necessary. But I don't work on giant line-of-business apps or sprawling web services, and I can see someone who did a lot of that sort of work having a different take on the matter.
Re: Ki Editor - an editor that operates on the AST
#79Re: Ki Editor - an editor that operates on the AST
#80I feel so illiterate when it comes to AST editing sometimes. I understand what an AST is from a computer science perspective. But I've never worked on a huge software refactor before that required direct AST textobject editing. Maybe an indication of my skill level... The extent of my usage is having nice textobjects to easily interact with arglists and functions which aren't native to (neo)vim. Very cute and nice to…
> I guess it's hard for me to edit things that I don't see right in front of me or aren't super simple changes (like name changes). Or at least, basic things I can reason about (such as finding by regex then deleting by textobject or something). This is actually what's nice about tools like ast-grep. The pattern language reads almost like the code itself so you can see the transformation right in front of you (at lea…