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

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

Related

How to start creating a language extension for VS Code?

Pursuant to the discussion in Add XHTML support, I'd like to start creating an extension for Visual Studio Code which would implement support for XHTML. Which is HTML with XML syntax, so the the desired functionality is already (mostly?) implemented elsewhere ā€“ for XML and HTML languages, the latter having two extensions bundled with VS Code: html and html-language features. But it's disparate.
As the first step, should I clone the VS Code repo and delete everything except the two directories named html and html-language features? Or Language services for HTML? Or the latter and html from the former? Or start with html, make it work for XHTML and only then deal with language features?
Should the second step be just adding the extension(s) I'm developing on my computer to my installation of VS Code? The GUI seems to allow adding only extensions from the Visual Studio Marketplace. Is it the right solution to place the extensions under development into VS Code's directory for extensions (either directly or with symbolic links)? I'm on Manjaro Linux.
If you can offer any other helpful advice, I welcome it too.

How to I get Visual Studio Code to treat <webscript> the same way it treats <script>?

Iā€™m working on HTML files which contain JavaScript inside <webscript> tags. Can I customize Visual Studio Code so that it treats these tags the same way it treats <script> tags, i.e. with syntax highlighting, etc.?
AFAIK, there is no direct way to customize this in Code. But you could write your own language configuration. A documentation with a sample file can be found at: https://code.visualstudio.com/api/language-extensions/language-configuration-guide
The most easiest way would searching for the default html language configuration copy this file and just edit the regex for script to support webscript, too. Should be this one on GitHub

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

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.

What is the best tool or technique to write doxygen code comments

Public c++ header files must be provided with a lot of comments. It is hard to format and wrap doxygen comments. Does some formatting tool exists?
With features like auto wrap lines on 80th character, easy visual function grouping. Ideally documentation writer prepares a documentation separately, then inject it into or link using doxytags with code.
At this time we are using notepad/IDE to document the code.
You don't say which IDE you're working with - If you're working in Visual Studio, then I've written an addin (AtomineerUtils) that might help you - It generates/updates XML, Doxygen or JavaDoc documentation comments in your source files, and can word wrap and format the comments for you, minimising the work you need to do to keep them tidy. It also keeps the comments in sync with the code (parameters, type-params, thrown exceptions, etc).
(It supports C, C++, C++/CLI, C#, Visual Basic and Java, in Visual Studio 2010, 2008, 2005).
Emacs + doxymacs works fine for me.