6 ms·
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 fil
by jordanlev 10y ago
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?)
- alexc05 10y agoYou 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!
- dguaraglia 10y agoPretty 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.
- anujanpan 10y agoIt auto-completes with words from tabs in the same VSCODE window. Atom has similar behaviour with autocomplete-plus.
- jordanlev 10y agoI 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.
- sunnyps 10y agoSublime Text doesn't do this by default although there's an extension[1] to do that. [1] https://github.com/alienhard/SublimeAllAutocomplete https://github.com/alienhard/SublimeAllAutocomplete
- deleted 10y ago[deleted]
- abtinf 10y agoIntellisense? Autocomplete?
- seanmcdirmid 10y agoIt 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.
- whatever_dude 10y agoI 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.
- 2bitencryption 10y agoThis 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).
- seanmcdirmid 10y agoAnswer 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.
- aokyler 10y agoI 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).
- jordanlev 10y agoI 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).
- julianz 10y agoIn a dynamic language like javascript, yes VS Code works exactly like this.
- hactually 10y agoYou mean [autocomplete](https://en.wikipedia.org/wiki/Autocomplete https://en.wikipedia.org/wiki/Autocomplete)?
- jordanlev 10y agoYes, 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.
- deleted 10y ago[deleted]
- azhenley 10y agoEven older versions of Excel had this. Now I'm dying to know what it is called too...
- nojvek 10y agoIt 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.
- cema 10y agoEmacs has dabbrev-completion and dabbrev-expand which, I guess, shows its age...
- numlocked 10y agoUnfortunately 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.
- grewil 10y agoThis 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.
- z3t4 10y agoI'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.