How to get WebStorm code formatting in VS Code - visual-studio-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.

Related

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.

Better plugin for Julia autocomplete for Vs code

I am new to Julia and wanted to shift from Juno IDE to vs code. Juno has a pretty awesome auto-complete which shows which package a function comes from. I was wondering if there is an external plugin that I could install to get something similar to vs code. The vs code hovering to get the details of the function is good, but I definitely prefer the one Juno offers.
Here is a pic of the Juno autocomplete
There is only one official Julia VS Code Extension at the moment which does support autocompletion: https://www.julia-vscode.org
The different results you see is just a factor of what the various IDE's are searching for when they populate that autocomplete list.
Note that this is on the radar of the Julia VS Code team: https://github.com/julia-vscode/julia-vscode/issues/1199

Is there any drawback to have lots of installed and enabled extensions?

Every extension added to VS Code is enabled by default. This makes me wonder : does having dozens of them as any impact on the editor performance ?
In practice, a given project usually uses only a few of the installed extensions. For example, a C# project doesn't need all the other languages linter and specific tools.
So, how does VS Code manage extensions ? Does it enable them on-the-fly, as needed ?
It doesn't seem to me that it takes more time to load as I add more extensions over time.
I couldn't find any information on the subject in the VS Code Extension documentation. Extensions can be disabled individually within a workspace, but that's it.

How can I configure Visual Studio Code to recognize files with extensions other than .js as Javascript

We have a QA tool (SmartBear's TestComplete) that uses javascript as a scripting language, but names the file with a ".sj" extension instead of ".js". I would like to use Visual Studio Code to edit those files, with all the nice intellisense and other tooling that comes with it, but I can't figure out how to configure it to recognize .sj files as javascript files. Any ideas?
Answering my own question, just for future readers that may be searching for the same thing.
According to a tweet from #code, this is not yet possible, but is coming "soon".

Visual Studio Code Plugins (Format / Spell Check)

Using the new Visual Studio Code editor vs 1. This is not the full Visual Studio IDE but their atom.io based code editor. I would like to install plugins specifically for spell check and formatting my code. How can I do this?
I've followed instructions here: Is there a command for formatting HTML in the Atom editor?
but realized that I do not have a install plugin command.
It's been a few months since the question was asked (and answered), but thankfully, things have changed!
VSCode now support extensions!
Here's a relevant excerpt from the above blog post:
Extension Marketplace/Gallery
To complement the extensibility mechanism, we have also launched an in product gallery and web based extension marketplace. These allow you to discover and install extensions. To open this up in VSCode, simply hit F1 and select Extensions: Install Extensions.
Alternatively, you can browse the Extension Marketplace at https://marketplace.visualstudio.com/#VSCode.
I gave the marketplace a quick search and easily found multiple extensions for spelling and source formatting, but I'll forego making any specific recommendations since everyone's requirements are different.
For anyone looking to write their own extensions for VSCode, take a look at the documentation for extending VSCode, as it has a lot of the information you'd need to start writing your own extensions.
Lastly, thanks to Daniel for his comment. It helped me find the information I needed, but to save future visitors some time, I thought it was worth sharing my findings.
Plugin support is not currently enabled in the VSCode editor. The development team were not happy with the plugin API, so they have disabled them until further work can be made on this.
For more information, see this post: https://stackoverflow.com/a/30006220/495328
Nowadays you can use Prettier and Code Spell Checker for the purposes.
Here are some use case for spell check:
Load a CSS, JavaScript, Text, etc. file. Words not in the dictionary files will have a squiggly underline below the text.
To see the list of suggestions just click on the 💡 (lightbulb) in the left hand margin. You have the option to add your own words to the workspace dictionary.