Difference between revisions of "VSCode"

From Wiki
Jump to navigation Jump to search
(Created page with "https://code.visualstudio.com/ ConTeXt distribution comes with a VSCode Extension. It can be found here - `<somedir>/tex/texmf-context/context/data/vscode/extensions` To...")
 
 
(5 intermediate revisions by 2 users not shown)
Line 13: Line 13:
 
* The VSCode will start with only the ConTeXt extension
 
* The VSCode will start with only the ConTeXt extension
 
* One has to enable the Color Theme of this ConTeXt extension (it does not work with one's existing color themes)
 
* One has to enable the Color Theme of this ConTeXt extension (it does not work with one's existing color themes)
 +
* In Mac, this was complaining about some missing IDs. Needs further investigation for Macs.
  
 
Not withstanding these above limitations, it works well for editing the ConTeXt markup.
 
Not withstanding these above limitations, it works well for editing the ConTeXt markup.
 +
 +
== Building and installing a .vsix package ==
 +
 +
You can build a .vsix extension package.
 +
 +
First you need node.js installed.
 +
 +
Open a terminal and cd to `tex/texmf-context/context/data/vscode/extensions/context` of your ConTeXt installation;
 +
then run (change slashes into backslashes on Windows, this is tested on Linux)
 +
 +
<pre>
 +
npm install vsce --save-dev
 +
./node_modules/.bin/vsce package
 +
</pre>
 +
 +
`vsce` will ask you some questions about the absence of a repository and a license file.
 +
Just answer "yes" to continue.
 +
 +
A file with `.vsix` extension will be created in that directory.
 +
 +
To install it, go to the extensions tab in VSCode or VSCodium and click on the `...` icon on top of the extension list
 +
and choose "install from VSIX...". Choose the package you created and you're done.
 +
 +
As stated above, you have "to enable the Color Theme of this ConTeXt extension (it does not work with one's existing color themes)". It's the "ConTeXt" theme in the themes' list you usually access with CTRL-K CTRL-T.
 +
 +
== To Do ==
 +
Use this and polish it to a proper VSCode Extension, and publish to the Marketplace
 +
 +
= New VSCode Extension with ConTeXt Language Server =
 +
 +
As showcased during the 2022 https://meeting.contextgarden.net/2022/programme.shtml - please find below VSIX. One can install this manually in VSCode (using the manual installation of the extension) -
 +
 +
Go to the Extensions Menu and use the "Install from VSIX..." option -
 +
 +
Download the VSIX from here - https://1drv.ms/u/s!AgyC2RLivdVJgbxy9GPUKeSixzZuOA?e=2YdVmn

Latest revision as of 14:10, 8 November 2022

https://code.visualstudio.com/

ConTeXt distribution comes with a VSCode Extension. It can be found here -

<somedir>/tex/texmf-context/context/data/vscode/extensions

To enable the above extension (e.g. in Windows), use this command -

"C:\Program Files\Microsoft VS Code\code.exe" --extensions-dir "<somedir>/tex/texmf-context/context/data/vscode/extensions" --install-extension context

Some caveats

  • One has to start the VSCode with the above command line
  • The VSCode will start with only the ConTeXt extension
  • One has to enable the Color Theme of this ConTeXt extension (it does not work with one's existing color themes)
  • In Mac, this was complaining about some missing IDs. Needs further investigation for Macs.

Not withstanding these above limitations, it works well for editing the ConTeXt markup.

Building and installing a .vsix package

You can build a .vsix extension package.

First you need node.js installed.

Open a terminal and cd to tex/texmf-context/context/data/vscode/extensions/context of your ConTeXt installation; then run (change slashes into backslashes on Windows, this is tested on Linux)

npm install vsce --save-dev
./node_modules/.bin/vsce package

vsce will ask you some questions about the absence of a repository and a license file. Just answer "yes" to continue.

A file with .vsix extension will be created in that directory.

To install it, go to the extensions tab in VSCode or VSCodium and click on the ... icon on top of the extension list and choose "install from VSIX...". Choose the package you created and you're done.

As stated above, you have "to enable the Color Theme of this ConTeXt extension (it does not work with one's existing color themes)". It's the "ConTeXt" theme in the themes' list you usually access with CTRL-K CTRL-T.

To Do

Use this and polish it to a proper VSCode Extension, and publish to the Marketplace

New VSCode Extension with ConTeXt Language Server

As showcased during the 2022 https://meeting.contextgarden.net/2022/programme.shtml - please find below VSIX. One can install this manually in VSCode (using the manual installation of the extension) -

Go to the Extensions Menu and use the "Install from VSIX..." option -

Download the VSIX from here - https://1drv.ms/u/s!AgyC2RLivdVJgbxy9GPUKeSixzZuOA?e=2YdVmn