Skip to content

Conversation

sambacha
Copy link
Owner

Languages: Solidity and Vyper

This feature branch adds solidity and vyper, languages used in smart contract programming in
the Ethereum Virtual Machine. It also adds a grammar for [ASC X12 EDI](https://x12.org).

Bug fix

When running the update grammars command an exception is thrown:

> Done normalizing grammars
> Copying grammars
> Done copying grammars
> Updating source files
internal/fs/utils.js:269
    throw err;
    ^
    Error: ENOENT: no such file or directory, open '/Users/sbacha/shiki/packages/languages/data/asp-vb-net.tmlanguage.json.tmLanguage.json'
    at Object.openSync (fs.js:462:3)
    at Object.readFileSync (fs.js:364:35)
    at /Users/sbacha/shiki/scripts/updateLangSrc.js:44:35
    at Array.map (<anonymous>)
    at Object.<anonymous> (/Users/sbacha/shiki/scripts/updateLangSrc.js:42:4)
    at Module._compile (internal/modules/cjs/loader.js:1015:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
    at Module.load (internal/modules/cjs/loader.js:879:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/Users/sbacha/shiki/packages/languages/data/asp-vb-net.tmlanguage.json.tmLanguage.json'

Remediation

$ wget https://raw.githubusercontent.com/microsoft/vscode/master/extensions/vb/syntaxes/asp-vb-net.tmlanguage.json
# asp-vb-net already exists, I did not try and doing `cp asp-vb-net.tmlanguage.json asp-vb-net.tmlanguage.json.tmLanguage.json `
$ mv asp-vb-net.tmlanguage.json.1 asp-vb-net.tmlanguage.json.tmLanguage.json

providing a file named asp-vb-net.tmlanguage.json.tmLanguage.json resolves this issue

Versioning

Running

$ lerna changed
info cli using local version of lerna
lerna notice cli v3.22.1
lerna info Looking for changed packages since v0.2.6
shiki-languages
shiki
shiki-themes
vuepress-plugin-shiki
lerna success found 4 packages ready to publish

Instructions for adding a grammar did not provide any additional information on bumping or otherwise changing versioning/enumeration of the packages.

total changes

running lerna diff shiki-languages we see that:

diff --git a/packages/languages/README.md b/packages/languages/README.md
index 913b1f8..2bcd98a 100644
--- a/packages/languages/README.md
+++ b/packages/languages/README.md
@@ -14,29 +14,44 @@ See [/scripts/pullGrammarsFromGitHub.js](/scripts/pullGrammarsFromGitHub.js)

 ```ts
 export type Lang =
+  | 'JavaScriptReact'
+  | 'MagicPython'
+  | 'MagicRegExp'
+  | 'TypeScriptReact'
   | 'abap'
   | 'actionscript-3'
   | 'ada'
   | 'apex'
   | 'asm'
+  | 'asp-vb-net.tmlanguage.json'
+  | 'asp-vb-net.tmlanguage.json'
   | 'awk'
   | 'bat'
+  | 'batchfile'
   | 'c'
   | 'clojure'
   | 'cobol'
   | 'coffee'
+  | 'coffeescript'
+  | 'cpp.embedded.macro'
   | 'cpp'
   | 'crystal'
   | 'csharp'
+  | 'cshtml'
   | 'css'
   | 'd'
   | 'dart'
   | 'diff'
+  | 'docker'
   | 'dockerfile'
+  | 'edi'
+  | 'electronic-data-interchange'
   | 'elixir'
+  | 'elm-syntax'
   | 'elm'
   | 'erlang'
   | 'fortran'
+  | 'fortran_free-form'
   | 'fsharp'
   | 'git-commit'
   | 'git-rebase'
@@ -49,11 +64,15 @@ export type Lang =
   | 'haskell'
   | 'hcl'
   | 'hlsl'
+  | 'html-derivative'
   | 'html'
+  | 'ignore'
   | 'ini'
   | 'java'
   | 'javascript'
   | 'jinja-html'
+  | 'jsdoc.js.injection'
+  | 'jsdoc.ts.injection'
   | 'json'
   | 'jsonc'
   | 'jsonnet'
@@ -66,19 +85,23 @@ export type Lang =
   | 'log'
   | 'logo'
   | 'lua'
+  | 'make'
   | 'makefile'
   | 'markdown'
   | 'matlab'
   | 'nix'
+  | 'objective-c++'
   | 'objective-c'
   | 'ocaml'
   | 'pascal'
   | 'perl'
   | 'perl6'
   | 'php'
+  | 'platform'
   | 'pls'
   | 'postcss'
   | 'powershell'
+  | 'prolog.swi'
   | 'prolog'
   | 'pug'
   | 'puppet'
@@ -90,24 +113,35 @@ export type Lang =
   | 'rust'
   | 'sas'
   | 'sass'
+  | 'sassdoc'
   | 'scala'
   | 'scheme'
   | 'scss'
+  | 'searchResult'
   | 'shaderlab'
+  | 'shell-unix-bash'
   | 'shellscript'
   | 'smalltalk'
+  | 'solidity'
+  | 'soliditysec'
   | 'sql'
   | 'stylus'
   | 'svelte'
   | 'swift'
   | 'tcl'
   | 'toml'
+  | 'ts'
+  | 'ts'
   | 'tsx'
   | 'typescript'
   | 'vb'
   | 'viml'
+  | 'vue-generated'
+  | 'vue-postcss'
   | 'vue'
+  | 'vyper'
   | 'wasm'
+  | 'wat'
+  | 'wenyan'
   | 'xml'
   | 'xsl'
   | 'yaml'
diff --git a/packages/languages/data/JavaScriptReact.tmLanguage.json b/packages/languages/data/JavaScriptReact.tmLanguage.json
new file mode 100644
index 0000000..92dcef9

The above diff shows all the changes made to the current languages

Please let me know what corrections should be made, I very much appreciate this work, using tmLanguage for syntax highlighting absolves me of the sin of having to use highlight.js, so thank you for your work. Cheers

this feature branch adds solidity and vyper, langauges used in smart contract programming in
ethereum. it also adds a grammar for ASC X12 EDI transactions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant