Hacker News new | ask | show | jobs
by wpride 1111 days ago
Everyone in this space seems to be building on the LSP and classic auto-complete in particular as their UI. But I've found this to be non ideal.

- As mentioned in this paper I definitely do not want the AI suggestion crowding out a suggestion generated directly from the type bindings

- I often do want the AI to write an entirely new block of boilerplate. To do this you have to write a comment string targeted at the AI, then delete this afterwards

- Sometimes I'd just like the AI to explain to me what some code does without writing anything

- This isn't something I always want on; I find myself turning the plugin on and off depending on the context

Overall I think we need a novel UX to really unlock the AI's helpfulness

6 comments

I have been enjoying a chat based AI coding modality. I built some tooling that gets rid of the need to cut & paste code between the chat and your files. This makes chatting about code changes much more ergonomic. My tool also integrates directly with git, which provides a safety net. It’s easy to undo changes if the AI does something silly.

Here are some chat transcripts that give a flavor of what it’s like to code with AI this way:

https://aider.chat/examples/

My tool is open source, and currently only works if you have a gpt-4 api key.

Very cool. I’ve been using ChatGPT quite manually for similar effect here, though I’m often using it for fragments of code less than whole projects/files, given I’m often dealing with an existing codebase.
A lot of my recent work has been focused on making this chat style coding work better with larger, pre-existing codebases.

I wrote up some notes on one effective approach:

https://github.com/paul-gauthier/aider/blob/main/docs/ctags....

This echoes my sentiment exactly. My biggest gripe is when type suggestions are replaced with AI suggestions, as I more often just want to auto-complete a method/attribute. I frequently find myself toggling AI suggestions via hotkey.

As for the getting a suggestion by writing comments, an "insert from prompt" action perhaps, or just a separate prompt pane/popup/whatever-you-prefer combined with using good ol' copy+paste would suffice.

Does it need to be that novel of a UX?

If you want to know what some code does, just select it & hit a keyboard shortcut (or right click and choose explain from menu).

If you want AI to write code for you, write a comment starting with a specific word, it suggests the implementation and you can choose to accept & replace the comment with it.

All of these things are pretty much exactly what GitHub Copilot chat does.

You can select code and ask it to explain it to you, or ask it to generate some boilerplate / code and then insert it at your cursor position without adding any comments like you described for prompting the Copilot autocomplete.

It seems okay, but I don't really use vscode that much

In vscode the Genie extension does these things and you can provide your own contextual hooks with custom prompts. It’s particularly good at explaining syntax and semantic errors.
What kind of novel UX are you imagining?