Visual Studio Code language extension not highlighting syntax - visual-studio-code

Followed this piece of instruction to create a language extension for .abcd files.
During yeoman generator I used this as a reference.
Everything went well and the new extension was created. Then I open the generated folder as a Visual Studio project and hit F5 to run VS Code with my newly created extension, but nothing gets highlighted as if there is no support for that language.
I have not done any changes to the generated files, but since I am using Ada.plist as a starting point, shouldn't it at least highlight .abcd file as Ada file?

You need package.json file to register the language. It's described in the same document.
You may be interested in this repo also:
https://github.com/Entomy/Ada-vscode

Related

Code copied and pasted from outside sources into Visual Studio Code not working

I have come across this recent problem when I copy & paste code from outside sources -- for example, GitHub sources or from my own Google Docs -- and paste it into a file within my Visual Studio Code. When the code is pasted into my VSC, it doesn't work right away. I've found that I have to comment out the code, then retype the entire code manually for it to work.
Is there a recent virus running around in VSC? Or do I have some extension or component in VSC I don't know about which is blocking this ability to allow copied and pasted code to work?

Visual Studio Code forgetting my extension

I'm developing an extension for Visual Studio Code for the proprietary language that the product I code for uses because I hate the antiquated IDE ships with it. Everything is going fine except for one issue. When I close and open Visual Studio Code, Visual Studio Code seems to "forget" my extension. Syntax highlighting, code completion, commands that I've implemented all stop working. I have to disable and then enable to extension for it to start working again. I am OK with this for personal use. However, I want to push this out to other users both in and outside of the company. If any code would be helpful, let me know, and I will happily provide it.
I resolved this issue. It was because in my settings.json for VS Code I had an entry for the file extension pointing to an extension that I had removed. Removing that line from my settings.json resolved the issue of things not working when I opened VS Code.
Thanks to everybody for their comments.

Indenting OCaml code in visual studio code

There are several questions here on indenting code in visual studio code (How do you format code in Visual Studio Code (VSCode)?), and on indenting OCaml code (How to indent existing OCaml code), but none of the answers work for indenting OCaml code in visual studio code.
I have installed the OCaml Platform visual studio code extension, vscode-ocaml-format (following https://dev.realworldocaml.org/install.html), ocaml-lsp-server (following https://ocaml.org/learn/tutorials/up_and_running.html) using opam, updated and upgraded everything, used eval $(opam env), but this still does not work. I'm a bit at a loss...
It is very hard to answer such questions as we need more debugging input from your side. On the other hand, it is so hard to get it from vscode so it is better just to walk you through the whole process from the very beginning to see where things might go wrong. I would suggest you follow the process for ease of debugging. After you have everything working you can adapt it to your particular setup.
Create a fresh new folder and put some OCaml file into it, let's name it test.ml and let's put into it the following code,
let test = [
"hello"
]
Now create a fresh local opam switch, by issuing in the same folder as the test.ml file the following command, (note the dot at the end of the command, it is required, it will create a local switch for you)
opam switch create .
Next install the required dependencies.
opam install ocamlformat ocamlformat-rpc ocaml-lsp-server
Create the .ocamlformat file in the same folder as the test.ml file. It will tell ocamlformat that you want to be ocamlformatted and you can use this file to setup your preferences.
Make sure that you have installed ocamlplatform for vscode
Now we are ready for the test. Start vscode and open test.ml. It will ask you to select the sandbox. Select the sandbox that corresponds to the folder where you put test.ml (it should be marked as local and have the same name as the folder name, and there will be the full path to it, so it will be easy for you to find it). The code syntax should be highlighted and there should be no error messages from vscode. Finally, hit Ctrl-Shift-I to re-indent your file, it should transform your code to,
let test = [ "hello" ]

VsCode - Update .njsproj

While working for a js project on vs code and vs 2019 synchronously. Is there any way to update .njsproj automaticly file when adding a new folder and file on vs code? Thus, those files can be include solution explorer for vs 2019 without manuel selecting files.
Update:
I created an extension to sync .njsproj file on vs code automatically.
Vs Code .njsproj Extension
VS Code does not have built-in support for synchronizing Visual Studio project files.
You could try:
An extension could provided this feature. This one claims it can, but I have not tested it
Write a simple script that updates your njsproj based on current folder contents.
If you are only using the project to open a set of files in VS, switch to use open folder as workspace instead.

Quickly creating certain files in VS Code

Is there an easy and quick way to create certain files in VS Code as in full blown Visual Studio? For example, I can create a config file or an app settings json file in Visual Studio that will not only create the file but insert the basic structure into the file.
Is this possible in VS Code?
This can't be done in bare Visual Studio Code. But there's a couple of extensions around which do what you are looking for.
Here's a non-exhaustive list of extensions:
File Templates for VSCode
File Templates
...