News for hackers. Stuff that matters.
Re:FauxPilot – an attempt to build a locally hosted version ... by danpalmer on Wednesday August 03, 2022 @04:01AM (#32328898)
To do this in a way that’s actually useful is hard. Microsoft has had Intellisense, JetBrains have autocomplete in Intellij and other products. Both have big teams and decades of work put into them, and still and great, hence the ML approach being tried now.
Re:FauxPilot – an attempt to build a locally hosted version ... by amelius on Wednesday August 03, 2022 @07:39AM (#32330355)
Is it really that difficult?

If I type app.get('/', then looking for literal occurrences and presenting me a menu of all the literal completions I have used before (no ML required at all) would already be a huge win.

Re:FauxPilot – an attempt to build a locally hosted version ... by danpalmer on Thursday August 04, 2022 @07:25AM (#32341536)
What if it's not called `app` – in larger codebases there's often a layer of indirection with different naming.

What if it's not indented the same amount, is it the same?

What if it's not a GET, but a POST? Both use the req/res handlers so you'd want the prediction for both.

What if it's not for the path /, but for some other path. As you can only have one handler for the root, most handlers will be for different paths.

Maybe you can write these edge cases in for the Express situation and get req/res prediction, but that's a bunch of work to automate ~10 characters and it only works for this specific use-case. It doesn't work for any other languages, frameworks, libraries, or use-cases.

There are 2 ways to do this well: 1) static analysis of code to understand what is allowed to come next, and predicting based on that (Intellij, Intellisense, etc) or 2) ML or statistical analysis to determine what's likely to come next without knowing much about the rules (Copilot, Tabnine, Intellicode). Both of these approaches are hard to do right, but have a high pay off.

Re:FauxPilot – an attempt to build a locally hosted version ... by bsima on Wednesday August 03, 2022 @07:46AM (#32330402)
Emacs and vim do this out of the box
Re:FauxPilot – an attempt to build a locally hosted version ... by sneak on Wednesday August 03, 2022 @08:02AM (#32330563)
Vim does not do this "out of the box".
Re:FauxPilot – an attempt to build a locally hosted version ... by bbkane on Wednesday August 03, 2022 @08:44AM (#32330939)
It does it on the "word" level: https://stackoverflow.com/a/52635099/2958070
Re:FauxPilot – an attempt to build a locally hosted version ... by amelius on Wednesday August 03, 2022 @08:53AM (#32331038)
Yes, I use this a lot.

One problem though is that sometimes I have a sub-folder with lots of (unrelated) files and Vim starts searching it, thereby basically hanging the editor without a possibility to stop the operation.