ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <j.hagen@xs4all.nl>
To: Julian Gompper <julian.gompper@pm.me>,
	mailing list for ConTeXt users <ntg-context@ntg.nl>,
	info@eric-detrez.fr
Subject: Re: Use Visual studio code
Date: Wed, 21 Aug 2019 22:28:16 +0200	[thread overview]
Message-ID: <03686dab-a2ab-1ad4-04f2-52c50e0d7573@xs4all.nl> (raw)
In-Reply-To: <g__Zx_Tn993Ffn_mi8JaoeU_AjH2m_GH6MzN50HLAaVSr6mtl0aONI7SKHMTra-dBQHRKgOg8YCKs8EGBLpdpMaa_lUTPR274wST4Mbm5MM=@pm.me>

On 8/21/2019 9:44 PM, Julian Gompper wrote:
> Hello,
> 
> 
> I too use vscode as my editor, and recently wanted to use it for ConTeXt
> as well.
> 
> Patrick Gundlach created a tmLanguage file for ConTeXt:
> https://github.com/pgundlach/context.tmbundle/blob/master/Syntaxes/ConTeXt.tmLanguage
> 
> I just finished packaging and publishing said file in a vscode extension.
> 
> You can find it on GitHub:
> https://github.com/JulianGmp/vscode-context-syntax
> 
> Or on the vscode marketplace:
> https://marketplace.visualstudio.com/items?itemName=JulianGmp.context-syntax
> 
> 
> As the name suggests, the extension only provides syntax highlighting. I
> might add snippets or build macros in the future, though I would
> probably implement these things in a seperate extension.

I wrote (reasonable advanced) lexers for all the languages that matter 
for context (tex, mp, lua, etc), also with support for embedded lexing 
as well as highlighting of categories of keywords (updates when new 
betas are pushed). These lexers are mostly compatible with my reference 
lexers for scite. So that should work anyway. They are poart of the 
distribution and activated when one starts vscode from the command line 
with the right switches or when one puts thexe lexers someplace known.

So, I didn't make some 'installable package' (also because i actually 
want to use a different color scheme and less clutter in the editor) so 
the idea is to have a independent start up without interference with an 
existing install.

But it works ok here (apart from adbaced suffix based runners, but i can 
run tex; ok, i could make mtxrun more clever and cheat but it would be a 
hack).

(The problem that I have with editors is that they keep adding stuff and 
become more complex over time while in practice I only need avery few 
features.)

> Also, if you want to build the document with a keybinding, you could
> define a build task in your tasks.json:
> https://gist.github.com/JulianGmp/a2b38212878c23d71de3d977214f2bf7
The problem is not to have key bindings (I can do that) but to have 
different ones per filetype (i want to run lua files with mtxrun 
--script for instance) and also because there can be multiple nindings 
per suffix. As far as I can see this is not yet possible (when i looked 
into it and searched abit i got the impression that this was a general 
known shortcoming but also that it was on some agenda to deal with it) 
and I don't want to ship/maintain a lot of fragile/moving target 
javascript (and node js) code.

Anyway, the files are in the distribuition to play with. And 
occasionally I see when it becomes more useable for me. It's currently 
mostly a fallback for when scite stops working (unfortunately the lua 
lexer support is is not build into scite and the (small) lib is 
unmaintained ... ok, i could do that when needed).

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

      reply	other threads:[~2019-08-21 20:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-19 20:08 Eric Détrez
2019-08-19 22:03 ` Hans Hagen
2019-08-21 19:44 ` Julian Gompper
2019-08-21 20:28   ` Hans Hagen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=03686dab-a2ab-1ad4-04f2-52c50e0d7573@xs4all.nl \
    --to=j.hagen@xs4all.nl \
    --cc=info@eric-detrez.fr \
    --cc=julian.gompper@pm.me \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).