Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Tangential, maybe someone here knows; how complicated would be to implement an autocompleter that just understands syntax + patterns and can offer me suggestions but based on my own stuff? Like what is the simplest version of Copilot that doesn't require huge amounts of training but just does a decent job at recognizing tokens and trying to fill in the structure based on some input code. e.g: `app.get('/',|` <- at this point I should get an express.js handler autocomplete like `(req, res, next) => {}`, maybe with multiple choices grepped from my own data ranked by occurences. Is this too extreme it needs a multibillion parameter AI model to achieve? Does anything like this exist? Like an auto-snippet thing but contextual and token replacing.


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.


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.


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.


Emacs and vim do this out of the box


Vim does not do this "out of the box".


It does it on the "word" level: https://stackoverflow.com/a/52635099/2958070


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.


That's exactly the thing I would be looking for, too.

Especially since I'm working in proprietary niche language, it would be so great to have my own code to be the corpus of the model.

It could be so easy: stuff your codebase into a model generator and out comes some sensible autocomplete. Well, at least I hope we will see something like this soon.


If you would like a custom model on your code (or language) this is one of the unique capabilities of Tabnine. We have done this on lots of code already and do it all the time for companies across the globe. Your code is your code. Transparently I am with Tabnine.


I've tested Tabnine but found it significantly slowing down my whole PC down to barely usable at all. Maybe this issue has been fixed and I can have another look at it. Also it seemed to me that the suggestions were only based on the existing code, whereas Github's Copilot appears to be "smarter".


The plugin TabNine does what you're looking for. I've been using it enjoyably for about two years.


Clarification - a user can run Tabnine on their laptop only OR as a part of Tabnine Enterprise we can run the large cloud models in your VPC (on GPU's) for your entire team of developers. Your code is your code and you can run it anywhere.


It sends your code to the cloud though.


Well, it _can_ but that option is configurable.


How effective is it without cloud access?


I'm pleasantly surprised at its effectiveness!


For sane, modern languages like C# and Java, autocomplete has worked somewhere between adequate and amazingly well for a long time already.

I think it used to be kind of usable also in VB6 also, at least that is how I remember it.

Golang and Typescript seems to have good support too now.

But for just the thing you mention above you could go a long way with live templates or what it is called in different IDEs, or just text templates with variables like the Rails guys used to use in their demos.


The latest version of Sublime Text works kind of like that. It know the tokens that most commonly appear together in the folders you currently have open in the sidebar and prioritizes the suggestions popup based on that. Seems to work pretty well for me.

It's a relatively new feature - within the last year I think.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: