How to enable hover in VS Code? - visual-studio-code

How to enable vscode hover function? When I go to the function I want to see their references links and navigate to them. In my Sublime text It is working properly but I want to make proper in my VS code also.

I fixed this with going to extensions, typing #builtin, scrolling to my language extension in features list (Typescript and Javascript item) and enabling my language extension:
For some reasons my extension was disabled in the list (even though the docs say it's enabled by default).
Source:
alexdima`s answer from 4 Dec 2019 from:
https://github.com/microsoft/vscode/issues/85846#issuecomment-561649920

The feature you are referencing is known as IntelliSense in VSCode, which is enabled by default on versions 1.3 and above.
The languages supported out of the box are JavaScript and TypeScript.
So, if you need code-intellisense for other languages you'll have to install extensions for the specific languages.
See image below for intellisense support

I recently had the same issue for like a week and I was going crazy, then I discovered that there is a setting for it, which I don't remember disabling but anyways it fixed the problem.
Go to your VSCode settings (settings.json) and set editor.hover.enabled to true.
{
"editor.hover.enabled": true
}
Otherwise, if you like UI setting stuff, search for "hover enabled" in your settings and make sure is enabled.

Related

VSCode inserts space after comment sequence

Whenever VSCode formats code, for almost all languages, it will insert spaces after the comment escape sequence (//, #, et cetera).
Although this does not work for C code, I assume that this might be some kind of global setting.
Is it possible to disable the insertion of this extra space somewhere? I follow a style where I don't use the extra spaces after "code-only" comments.
Any (lightweight) extensions that do this (or similar)? Should I make my own...?
I'd like for this solution to work for all languages, although Java is what I use the most.
I tried searching for some extensions related to comments, but it seems that there are none doing this. Is a linter what I need..?
Sorry and thank you in advance!
VS Code doesn't have a default formatter that works across every language so, there is no global solution for you. You will have to check, for every language you noticed such behavior, if the formatter is built in or not, and look for settings individually.
You commented about using Java, and VS Code Java support doesn't provides a formatter, so I suppose you have some Java extension installed, maybe from RedHat. If that's the case, I've noticed (based on extension's Readme) that It has a Java: Open Java Formatter Settings command, which says opens the Eclipse formatter settings. Creates a new settings file if none exists. It's been a long time I don't use Eclipse, so I'm not sure how its settings works, and if it does support the format rule you want. But I suggest you to take a look.
Hope this helps
There is a setting that should affect all languages:
Editor > Comments: Insert Space
It is enabled by default, uncheck it.
It seems that setting java.format.comments.enabled to false was somewhat helpful:
java.format.comments.enabled setting in VSCode
However, it disables formatting for all comments, even JavaDoc ones.

What extension is causing my custom php snippets to get overwritten, and how can I fix this?

If this is due to an extension, how can I remove that extension?
It overwrites my custom snippet, which bothers me.
I disabled many extensions, but nothing changed.
What you're seeing in your screenshot (suggestions for dba_<etc.>) are not coming from any extension. One can verify that by running the command Developer: Reload With Extensions Disabled and trying triggering suggestions again. So this is just functionality that comes out-of-box with a standard VS Code installation. You don't even need to install any PHP extension to get this.
As for your custom snippets getting "overwritten", it's hard to tell without more detail why this is happening. If you're on version 1.75, it might just be due to a bug that will be fixed later (Ex. As was the case in this other recent Q&A: Visual Studio Code's recent update is disrupting autocompletion).
As #Mark showed in their answer, these are function suggestions. You can disable function suggestions with the following setting:
"[php]": {
"editor.suggest.showFunctions": false
}
Those icons indicate that those are Methods and Functions (not Snippets). See What do the Intellisense icons mean.
So you can try to disable two settings in your Settings UI:
Editor > Suggest: Show Methods
Editor > Suggest: Show Functions - this looks like the right one to disable
Of course, there might be situations where you want to see Function suggestions, so you will have to see if disabling the setting is acceptable.
You can disable those Function suggestions for php files only with this setting (in your settings.json):
"[php]": {
"editor.suggest.showFunctions": false
}

In VSCode how to stick the explorer to the sidebar?

In VSCode i'd like to make the explorer view always visible even when other sidebar windows are open. Is there an extension or setting that I can change to achieve such behaivour?
I've tried to find extensions or setting but I could not found any.
Sorry, this is not possible in VS Code.
Several people have made feature requests, e.g. https://github.com/Microsoft/vscode/issues/26777, which you could upvote.

Is there a way to export PhpStorm code style rules as .eslintrc?

I've been using PhpStorm for awhile, for PHP as well as JS. I would love, however, to switch to VSCode since it's lighter, open source and free. But one feature that I cannot quite carry over with extensions is Code Style settings.
PhpStorm has a sweet visual interface in settings that allows you to set up detailed code style rules with live examples right there. ESLint, unfortunately, doesn't have anything similar - it's all text rules (which is a drag and takes forever to set up).
So I'm wondering if there's any way at all to export PhpStorm code style settings as ESLint rules? Or if there's an app that has a similar interface to set up ESLint? Or maybe there's a VScode extension that I am missing that has a similar interface?

Chrome Dev Tools : Code Folding

Is there any way to enable cold folding in the CodeMirror used in the sources panel of Chrome Dev Tools.
Normally you would enable this through an option
foldGutter: true
I can see that the options for CodeMirror are being handled via source_frame_module.js.
Is it possible to customize this file?
Currently you cannot modify anything about how CodeMirror in DevTools operates. The only thing that can be done is re-styling via a custom theme extension. There have been numerous bug reports asking for this kind of functionality, but due to security reasons it hasn't been acted on yet nor is planned to be as far as I know.