Hi Hans (et al.), find attached a slightly extended version of the "interface" script that can also generate the list of commands in cson format for Pulsar/Atom. It just creates a basic list of commands for syntax highlighting; for a complete plugin, "grammars" and "settings" are missing, see https://codeberg.org/fiee/language-context (Yes, this approach is oldfashioned and a plugin could do a lot more, but I don’t speak TypeScript.) The generated cson file is for "snippets", like in: https://codeberg.org/fiee/language-context/src/branch/master/snippets/langua... There, I added information from the interface files and also from the wiki, if existing. I don’t know how to do that in the lua script. --- function flushers.pulsar(collected) for interface, whatever in next, collected do local commands = whatever.commands local environments = whatever.environments local result, r = { }, 0 r = r + 1 ; result[r] = "'.text.tex.context':\n" for i=1,#commands do r = r + 1 ; result[r] = format("\t'\\%s':\n",commands[i]) r = r + 1 ; result[r] = format("\t\tprefix: '%s'\n",commands[i]) -- can we have some information? --r = r + 1 ; result[r] = format("\t\tdescription: 'level: primitive; interface: i-tex.xml'",'') -- no URL if command starts with "stop" r = r + 1 ; result[r] = format("\t\tdescriptionMoreURL: 'https://wiki.contextgarden.net/Command/%s'\n",commands[i]) end io.savedata(format("language-context-%s.cson",interface), concat(result),"\n") end end --- Also, the "en" interface is empty, everything is in "common", so the iteration over interfaces makes no sense here. Actually, Atom/Pulsar could work with a tree sitter parser (https://github.com/pmazaitis/tree-sitter-context), but I don’t know how to use it. [TextMate] For TextMate and other editors that use TM bundles, it might make sense to update https://github.com/pgundlach/context.tmbundle At least the list of commands could be automatically converted from the interface files, but it’s more involved than what mtx-interface does. [Visual Studio Code / VSCodium] BTW, is the ConTeXt language server for VS Code public anywhere? (Ramkumar KB promised…) Or is "mtxrun --script=vscode --lsfile" the same? Hraban
participants (1)
-
Henning Hraban Ramm