Autocomplete for all text in current file

How can I turn on autocomplete to suggest for all text in the current file? The context/scoping for autocomplete isn't very smart :-/

4 comments
Comment actions Permalink

Haven't got what you mean, sorry... Would you like to limit the completion to variables/functions from current file only? or, would you like the completion to suggest all words you have typed in current file? In the latter case, did you try 'hippie completion' (cyclic expand word) - it's Alt+Slash in default keymap? See https://www.jetbrains.com/help/webstorm/2016.3/hippie-completion-expanding-words.html

3
Comment actions Permalink

Elena, he means something like the Default Autocomplete that comes with Notepad++: https://notepad-plus-plus.org/community/topic/13583/plugin-update-an-alternative-auto-completion-for-notepad .

This would be something that would trigger without needing to press any hotkeys, but wouldn't get inserted without pressing Enter or Tab.

In my opinion, this would be a VERY helpful addition.  AFAIK, there is no way to do this in IntelliJ.

0
Comment actions Permalink

Webstorm auto-completes code where appropriate - while typing variable, etc. names, after `.`, etc.

Showing auto-completion just on entering plain text would be rather annoying.

0
Comment actions Permalink

Elena, I don't think you understand the feature yet.  It is not annoying.  One of the world's most popular text editors has it.

Consider typing the following:

my_map = {
  'key' = 'value',
  'very_long_key_that_is_hard_to_type' = 'value_that_i_really_want'
}
# Note: often we get dicts from external data sources and we can't control the key names to make them short.

my_|desired = my_map['very|

In the above, the final line has two pipes (|).  These are the points at which the auto-complete would appear either with min_match=3 (for `my_|`) or min_match=4 (for `very|`.  I usually set my min_match to 3 in settings.

In the first case, you would get the option to select `my_map` by pressing enter or ignoring the autocomplete.  If your min_match was 4, you would not see an autocomplete option here at all.

In the second case, you would see `very_long_key_that_is_hard_to_type`.  That would be VERY useful.

0

Please sign in to leave a comment.