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

Whenever I try a new text editor, I run into a problem: I absolutely love the feature where it auto-completes based on other words in open windows (or other files in the open project). But there's no official term for this so I can never tell if a text editor has it.

Years ago this used to be called "hippie expand", but I can't figure out a more modern name that is used. Does anyone know what Visual Studio Code calls this feature, and/or how to enable it (assuming it even exists?)



You mean you have a text editor that knows what words are on the page in a CHROME tab (for example)

Or you mean, that if you've got 2 text files open as tabs in the same VSCODE window typing in 1 tab will auto-complete with words from the 2nd tab?

Where have you seen this feature as it sounds AMAZING!


Pretty sure he means the latter. Several editors I've used over the years supported that. The ones I can remember are Scite, UltraEdit, PNotepad and Vim.


I mean the latter (other open windows in the text editor). TextMate and Sublime both operate this way, as opposed to IntelliSense style auto-complete where it only operates off of symbol definitions (class names, function names, properties and variables, etc). Which makes sense, because TextMate and Sublime don't really "understand" your code like Visual Studio historically does.


Sublime Text doesn't do this by default although there's an extension[1] to do that.

[1] https://github.com/alienhard/SublimeAllAutocomplete


It auto-completes with words from tabs in the same VSCODE window. Atom has similar behaviour with autocomplete-plus.


Unfortunately there isn't a clear name for it. There's a bunch of sibling comments that, I think, don't quite get it right. Autocomplete is a feature. For any given autocomplete implementation, there can be a number of different sources to actually populate the AC UI. Company mode in Emacs (COMPlete ANYthing) works this way - it's a general AC framework, and different modes can provide different AC sources to it. Hippie completion, in Emacs at least, refers to a combination of a variety of sources - text in the current buffer, in other buffers, on the kill ring (e.g. Recently copied text), etc.


This is very true indeed. Company mode is the completion framework that rules them all. I have abandoned the older ac-alternatives in favour of this. And it's easy to write new backend source plugins too.


I've seen it called dumb auto-completion. Where intelligent auto-completion is called "intellisense".

intelligent auto-completion knows the variable type and available methods/properties. Whereas the dumb auto-completion just match the words.


I don't know what it's called specifically in context of other open Windows, but I'm guessing the functionality could be described as a feature of "IntelliSense" (but I think IntelliSense is Microsoft's name for it).


I wasn't clear about this, but in my experience with Visual Studio back in the day, IntelliSense only operates off of defined symbols (function names, class names, variables, etc). Whereas text editors such as TextMate and Sublime don't seem to "understand" the code as much, so instead they just autocomplete based on all word they find in the open project or Windows. But I actually prefer this more loosy-goosy style of autocomplete, so was just wondering if this new Visual Studio works that way (since it seems to be geared more towards dynamic languages such as javascript than VS was in the past).


In a dynamic language like javascript, yes VS Code works exactly like this.


Emacs has dabbrev-completion and dabbrev-expand which, I guess, shows its age...


Even older versions of Excel had this. Now I'm dying to know what it is called too...


It should be pretty easy to build a plugin that makes this happen. By default I think it auto completes from the buffer of existing document.



Yes, but there are two different kinds of autocomplete -- MS's "IntelliSense" style which actually understands your class/function/variable definitions and only gives you options it thinks are legit, versus more loosey-goosey style where the text editor just uses all words it finds in the open project or windows (regardless of whether or not they make sense in the context of the programming language).

Historically, Visual Studio has only done the stricter "IntelliSense" style, but I am wondering if this new version handles the looser cases like TextMate and Sublime do.


Intellisense? Autocomplete?


It isn't Intellisense since it isn't using type information but the context of the text buffer to determine possible completions. Autocomplete is too vague.


I think it's just part of autocomplete, but it has to have an expanded set of contexts it uses. I think VSC only checks for actual existing types/properties in that context. But other editors can be more intelligent: IntelliJ's IDEs, for example, will automatically autocomplete a new method name to a method that some code is referring to but that doesn't exist yet (it knows I'm trying to create it). I'll check what variables you created and suggest some names for new variables depending on context. Etc.

It's really vague, but I'd still call it autocomplete.

Some editors, like Notepad++, end up using whatever they can find as a means to autocomplete. So you end up with a huge list of suggestions for anything you type. But it's because they lack the power to analyze the code and actually know what's allowed where you're typing.


Answer the question "Does your editor support autocomplete?" isn't very useful, since autocomplete only means, can the editor feedback some choices (wherever those choices may come) into your typing experience? We really need a better vocabulary to describe and differentiate between the many kinds of auto-completions, or we might just talk past each other when comparing the powers of our editing experiences.


This is only 20% relevant, but I've been messing with the Vim extension YouCompleteMe, expecting very intelligent completion based on the syntax of the language.

However, at least for C++ code, it seems like just a dumb symbol-lookup, suggesting only other symbols in the file, regardless of whether they syntactically make sense or not.

I must be doing something wrong but I don't know what. It seems to do a better job with Python, where it knows about keywords and built in functions.

(fyi, compiled with Clang Complete enabled).




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

Search: