Is there a ReSharper or similar extension to Visual Studio Code? - visual-studio-code

I would like to know if there is some extension to VS Code that helps with cleaning code and suggesting more concise code (i.e., hinting for coding best practices).

There are a large number of ways to lint or provide code suggestions or refactoring tips in VSCode, some baked-in or improved with the C# extension.
But if I understand your question right, for something akin to an extension to suggest code simplification, like ReSharper, I would point you to the Roslynator extension. I have used Roslynator2022 (the Visual Studio 2022 version) and like how it links you out to see detailed reasons about the suggestions it makes.
For formatting your code the VSCode Marketplace has multiple good options such as the CSharpier extension.

Related

Visual Studio IDE's ToolBox alternative for VSCode

Visual Studio IDE has a nice feature: ToolBox, witch gives ability to save and use pieces of boilerplate code:
Can't find a similar extension for VSCode. There many extensions with the similar name but they serve different job and are a bit complicated for me.
Can you suggest me something similar to ToolBox please?
P.S. I' not asking about snippets, this is different.
Almost find it but it does not have foldering option and is no longer updated: Code Fragments

How to get WebStorm code formatting in VS Code

In the company we are using WebStorm for React, and for the last 3 years I have been working in VS Code.
Is there a way to get exact code formatting for all languages in VS Code as in WebStorm on default settings, and how to achieve that in order to prevent unnecessary diffs in git?
I can only tweak VS Code settings, I must not touch WebStorm.
To get the same formatting/functionality as Webstorm, I suggest using VS Code extensions. You will find an extension for almost every language/framework available on the VS Code marketplace.
Here is a list of recommended extensions that makes VS code behave as Webstorm.
For your particular case, I suggest you to use and configure Prettier.
Note that you might not want to install too many extensions but only the ones you need because loading too many extensions will probably slow down your IDE.

How to enable auto-indentation of Python function arguments in VS Code

I'm looking to enable automatic indentation of Python function arguments, as shown in the example below generated with use of pycharm. I had a look at a similar discussion but the discussed solutions do not appear to solve this problem.
Desired Behaviour
VS Code
VS Code version: 1.27.2
Python extension: 2018.8.0 (04 September 2018)
Update
Current autoIndent setting
This is a known issue for the Python VSCode extension and it can currently not be fixed because of limitations in the extension API. More specifically the line in the editor cannot know the content of other lines. I am not aware of any fix for this issue, but I agree that it decreases the experience of working with VSCode by far.
See this issue for further information: https://github.com/Microsoft/vscode-python/issues/701
Like #larsl already wrote, this is currently a limitation of the basic Microsoft python extension. However, fellow VS Code user Kevin Rose was so kind to write an extension that does exactly what we were looking for:
https://marketplace.visualstudio.com/items?itemName=KevinRose.vsc-python-indent
As far as my early experience with it goes, it works like a charm!

Is there an analogue of GhostDoc in Visual Studio Code?

I'm looking for something like GhostDoc for VS Code (C#), but to no avail. Anyone knows anything?
I've only found an "old" VS-like extension which makes XML comments available when you type '///', but it's not what I am looking for.
DocumentThis is available with similar features.

How to change all occurrences of variable name in Visual Studio Code for PHP?

I have tried Ctrl + F12 but it does not really work. It does not select $this-> for some reasons. Does anyone here know, how to do it?
Thanks in advance
Currently, Visual Studio Code's support for PHP is limited (see here), and I was unable to locate a PHP language service extension for Visual Studio Code (you're welcome to look, too).
Visual Studio Code currently only comes bundled with language services for JavaScript and TypeScript.
According to Visual Studio Code's documentation, a language service is defined as follows:
Language services provide the code understanding necessary for features like IntelliSense (suggestions) and smart code navigation (Go to Definition, Find All References, Rename Symbol).
You can try the regular search and replace CTRL+SHIFT+H. VS Code provides preview for all planned replacements so it is done not that bad as you would expect.
This question is a bit old but, for anyone who stumbled upon here,
You could use PHP Refactor Tool extension: https://marketplace.visualstudio.com/items?itemName=st-pham.php-refactor-tool
note that this extension dependent on PHP intelephense: https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client