How to enable auto-indentation of Python function arguments in VS Code - visual-studio-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!

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

Is there a ReSharper or similar extension to 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.

Can you run a version of vscode inside the browser without a server?

Is there any way to run a version of VS Code inside a browser without a server? (inside a React or Angular app). Something like an enhanced version of the monaco editor.
Of course that means it will have some missing functionalities.
If not, are there any other options?
Try this https://securingsincity.github.io/react-ace/
its something of the same king what you want
As far as I could find, it is possible to run VSCode in the browser (since we have vscode.dev), but there doesn't seem to be anyway to deploy it yourself yet?
This Github issue is probably what you want, but there isn't any information there (or on the repo) yet.
It does strongly suggest that https://github.com/microsoft/vscode is the version used for vscode.dev, so there might be things to be found there, until official instructions/embedding is possible.
I think it depends on how you treat vscode.
if it is just a editor software, there'll be a lot of .
For you customerization purpose, it sounds something like 'https://github.com/cdr/code-server'
Not sure if it helps, but you can try looking up gitpod.io. It opens up a visual studio code instance on your browser with options of installing extensions as well.
Use the link like gitpod.io/#https://github.com/username/repo-name
You can possibly use Gitpod self-host, https://github.com/gitpod-io/gitpod or https://github.com/gitpod-io/openvscode-server they both have documentation on how to create your own version of VSCode for the web, however, as I've never tried to create one myself, I don't know if it accomplishes your specific use case.

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 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