How do I get imports to show up when I press ctrl+dot in javascript in vscode? - visual-studio-code

When writing JSX (or any typescript code really) if you have an available import that's not yet imported, you get a squiggly line under it and can press ctrl+dot on it and then automatically import the code as a "refactoring."
How can I set this up in Javascript? I've seen a screenshot of someone else's VSC where it is available underneath "more options" and so I'm pretty sure it's possible, but when I press ctrl+dot I get nothing.
Note: I'm aware I can press ctrl+space. However, I don't want to do this, for two reasons. (1) alt+space is pretty bad UX because if you press it in the middle of a word it continues to autocomplete even if you already had the full name there and so you are left with an incorrect tag (e.g. if your cursor was after the d in Keyboard for a component called KeyboardRow you are left with KeyboardRowRow) and (2) I want to rebind quick fix to alt+enter to match pycharm; and I want the same hotkey & UX in both Typescript and Javascript.

I haven't worked too much with JS, mainly with TS, but I have two extensions installed in my vscode that helped me a lot while coding in vanilla JS.
Path intellisense and Auto import

You can try if My Code Actions can be used to construct a Quick Fix for these types of PROBLEMS/squiggles

Related

VSCode Type Hint toggle display

How can I toggle on and off the display of Type hints in VS Code? For example, I've got the code .remoteOf(ClassServiceClient.class) and what I see is .remoteOf(CLAZZ:ClassServiceClient.class) but I can't actually select or seem to interact with the CLAZZ word.
How do I toggle this on and off? It seems useful in certain situations, but it just makes me think I typoed something.
I'm sure this has been asked before, but I haven't been able to come up with a word that seems to describe this feature.
This feature is called Inlay Hints and can be found under the Editor section.
After this, I've gone from displaying clazz:#Log4J2 to #Log4J2, and have enabled the option to display this hint by holding down a set of keys, ctrl + alt by default on Windows.

VSCODE + Dart/Flutter: Double Autocomplete in conflict

i use visual studio code to create my flutter app, but since 1 month ago, i detected as if the editor have a double autocomplete.
When i write for example: "Container" i have the autocomplete while i'm writing, but if i press Enter it won't add the brackets at the end (before, it did!)
And, if i write: "child" i have the autocomplete while i'm writing, but if i press Enter, the cursor will be with a selection, and there is no autocomplete until i click in somewhere to remove the auto-selection, or i write the command completely without autocomplete.
It's like if there were a double autocomplete in conflict, that select the words after i press enter.
Autocomplete working:
Strange auto-selection and then no-autocomplete:
Furthermore, if i write "setState" and press Enter to autocomplete the function, i get the whole function selected and tabbed of 4 tabulation on the right. Same for initState.
I tried to disable every extension and restart, but i had same problem.
I'm so slow now to write flutter code, because i have to remember every CamelCase word and property and write them in every single char, or click in somewhere to make autocomplete works.
Fixed!
In setting i had to disable LSP.
"dart.previewLsp": false
I've the same issue, after some research I found this:
https://github.com/Dart-Code/Dart-Code/issues/2823#issuecomment-725630953
I'm not sure this is the right way because I didn't have try yet but the problem on GitHub issues seams the same you describe, apparently this solution works with LSP enabled

JS autocomplete package in ST3 annoying autocomplete list at the end of the line after semicolon

I have some annoying issue with my ST3 JavaScript Completions package. So, whenever I hit space even If I haven't write anything yet I get JS autocomplete list with bunch of different functions and every time when I want to go to the next line I can't because there is that autocomplete list and I need to click esc button first to remove that list and than click enter so I can move on to the next line. It is pretty annoying when code is a bit longer, every time at the end of the line I need to click esc and than enter.
I don't want to remove that plugin, it's quite useful but I haven't this problem until today. I tried to reinstall that package but I still have the same problem.
Is there any way to fix it? I don't want It to show every time just e.g. when I start typing the name of some functions etc.
If you visit the package's page on Package Control, you'll see that the package was just updated 2 days ago. I would suggest that you file an issue and explain in detail exactly what you are seeing, with images to demonstrate the behavior. The author of the package is much more able to address this issue than we are.

Does Rubymine have the feature code snippet and all auto-complete

I'm used to the sublime text 3 editor.
It has many handy features.
take the code snippets for example,
Once you type begin then press TAB
It will generate the corresponding code block
begin
rescue Exception => e
end
And the plugin All Autocomplete
It can show the auto-complete hint for all opened files.
For example, if you have a variable name called taiwan_is_awesome
then you can get the autocomplete in other files.
Does Rubymine has the above features ?
If yes, what's the corresponding keymap ?
It's important for me to use those features.
THanks
Once you type begin then press TAB
It's called "Live Templates".
"Live templates (or code snippets) allow you to insert frequently-used constructions into your code. These can be conditions, blocks, loops, and so on."
You can manage bundled and create new ones at Settings/Preferences | Editor | Live Templates.
Here is a good "how to use" tutorial with screenshots: https://confluence.jetbrains.com/display/PhpStorm/Live+Templates+%28Snippets%29+in+PhpStorm -- it's for PhpStorm but exactly the same functionality is available in RubyMine.
UPDATE: 2022-11-15
The above tutorial link now automatically redirects to the corresponding Help page for PhpStorm.
Here is the same official Help page but for RubyMine that shows how to use and create them: https://www.jetbrains.com/help/ruby/using-live-templates.html
The setting you want to make RubyMine code completion work like All Autocomplete in Atom & ST3 is called "Autopopup code completion".
Solution:
Settings > Editor > General > Code Completion > "Autopopup code completion"
Note: there is another type of code completion called "Hippie Completion".
However, it works differently than "All Autocomplete". In RubyMine "Hippy Completion", you start typing text, and then you have to "guess" when RubyMine has enough text to figure out the completion you want. Then you hit ⌥/ (on the Mac). If RubyMine guesses right, it will autocomplete correctly.
I greatly prefer the "All autocomplete"/"Autopopup code completion" method, but just thought I'd mention this alternative.

Netbeans IDE Code Snippet Keybinding

I'm not sure if this is possible and if this is the right place to ask, but I'd like to give it a try. I'm currently trying Netbeans IDE, coming from Dreamweaver.
In Dreamweaver I can create Code Snippets and bind a key to them. So for example marking a text and pressing CTRL+B then, surrounds the text with the [strong] tag. Or I created a snippet, when I press SHIFT+CTRL+B it adds a [br /] tag at the position of the cursor.
I could not find a way to do this in Netbeans so far. Does anyone know if this is possilbe, and if, how to achieve this?
There is a Plugin available for that,
Go to Tools->plugins and try out TagMyCode
https://tagmycode.com/
I've been using it for quite some time, there is a library of public snippets and the doc is really helpful.