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
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.
This is something I too am desperately looking for.
The ability to have Ctrl-space suggestions on JSON keys and also inside any string.
There is so much JSON "navigation" that simply autocompleting on functions and variables is not enough.
The coolest thing would be if you could supply Webstorm some sample JSON structures and it could then use that for suggestions when you are typing e.g.
docJSON.modeli(ctrl-space) to suggest modelindicatorId
The JSON Schemas support is only for editing an entire JSON files e.g. Settings.json
I am talking about when you are editing a Javascript (.js) file e.g.
function documentPrinter(documentArray) { var i, curJSONDoc; for(i=0; i<documentArray.length; i++) { curJSONDoc = documentArray[i]; console.log(curJSONDoc.modelindiatorgloballyUniqueUuidIdentifer, ":", curJSONDoc.modelindicatordescriptionText); } }
When you are writing the console.log line it would be *very* helpful to be able to enter (ctrl-space) after having typed .modeli to and then select modelindiatorgloballyUniqueUuidIdentifer from a list.
The hippie completion would be nice, as long as it will not cycle through the words and print them out rightaway. Otherwise, cycling through hundreds of words is a burden and thus the feature is useless.
I suggest to change the workflow to something like this:
Right after pressing Alt+/, a context menu (similar to Ctrl+Space) would be show with a list of all words used in the current file, ideally ordered by the most frequently used words.
Unless a Space/Enter is pressed, anything the user types would be considered as the search/filter string, thus only the matching words from the file will be listed.
The user can change the selected word using Up/Down arrows.
When a Space/Enter is pressed, the selected word would be actually inserted into the file. Alternatively, if a user want to exit the hippie completion without inserting a word, they can press Escape.
Or simply port the auto-suggestions feature from Fleet (see the screenshot below): it works as I wish it worked in WebStorm and how the OP wanted it to work and it works in Sublime Text and other text editors / IDEs.
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.htmlElena, 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.
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.
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.
This is something I too am desperately looking for.
The ability to have Ctrl-space suggestions on JSON keys and also inside any string.
There is so much JSON "navigation" that simply autocompleting on functions and variables is not enough.
The coolest thing would be if you could supply Webstorm some sample JSON structures and it could then use that for suggestions when you are typing e.g.
docJSON.modeli(ctrl-space) to suggest modelindicatorId
>The ability to have Ctrl-space suggestions on JSON keys and also inside any string
WebStorm provides JSON auto-completion based on JSON Schemas. see https://www.jetbrains.com/help/webstorm/2019.3/json.html
The JSON Schemas support is only for editing an entire JSON files e.g. Settings.json
I am talking about when you are editing a Javascript (.js) file e.g.
When you are writing the console.log line it would be *very* helpful to be able to enter (ctrl-space) after having typed .modeli to and then select modelindiatorgloballyUniqueUuidIdentifer from a list.
hardly possible with static code analysis - such completion would require executing a code
What I am suggesting requires neither static code ananlysis nor code execution.
I do not expect anything very "intelligent" from webstorm.
I the most basic case I would configure the project with a list of all possible JSON keys I would like to be completed.
When ctrl-space is pressed webstorm would simply list all list items where the characters after the "." are a leading substring.
I would *not* expect Webstorm to be able to decide precisely what keys would be legal at a given place in the code.
You can try using JSDoc for this, like:
I am using IntelliJ as a technical writing tool and would love to see something similar to Notepad++'s autocomplete tool for any text, not just JSON.
I can only suggest using 'hippie completion' (cyclic expand word) for this - it's
Alt+Slash
in default keymapHi there. I want to clarify do you have a solution for this request?
Thanks in advance.
Hello! Did anyone find a solution or workaround?
Did you try 'hippie completion' (cyclic expand word,
Alt+Slash
in default keymap) as suggested above?Hippie completion isn't what this post is about.
I did find a workaround though: VSCode has this feature.
I no longer use IntelliJ.
The hippie completion would be nice, as long as it will not cycle through the words and print them out rightaway. Otherwise, cycling through hundreds of words is a burden and thus the feature is useless.
I suggest to change the workflow to something like this:
Elena Pogorelova, WDYT? Would that work for JetBrains?
---
Update
Or simply port the auto-suggestions feature from Fleet (see the screenshot below): it works as I wish it worked in WebStorm and how the OP wanted it to work and it works in Sublime Text and other text editors / IDEs.