From b24421170a9b0c8cf12c856c0d9d9f94a46dbbca Mon Sep 17 00:00:00 2001 From: Qi Xiao Date: Sun, 5 Jun 2022 12:14:58 +0100 Subject: [PATCH] Add VS Code extension. --- .codespellrc | 1 + .gitignore | 2 - .vscode/launch.json | 13 ++ vscode/.gitignore | 2 + vscode/HACKING.md | 12 ++ vscode/README.md | 11 ++ vscode/elvish.tmLanguage.json | 117 ++++++++++++++++++ vscode/extension.js | 24 ++++ vscode/icon.png | Bin 0 -> 9047 bytes vscode/language-configuration.json | 24 ++++ vscode/package-lock.json | 192 +++++++++++++++++++++++++++++ vscode/package.json | 56 +++++++++ 12 files changed, 452 insertions(+), 2 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 vscode/.gitignore create mode 100644 vscode/HACKING.md create mode 100644 vscode/README.md create mode 100644 vscode/elvish.tmLanguage.json create mode 100644 vscode/extension.js create mode 100644 vscode/icon.png create mode 100644 vscode/language-configuration.json create mode 100644 vscode/package-lock.json create mode 100644 vscode/package.json diff --git a/.codespellrc b/.codespellrc index 128a5921..288ca8d8 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,2 +1,3 @@ [codespell] ignore-words-list = upto,nd,ba,doas,fo,struc,shouldbe,iterm,lates,testof +skip = ./vscode/node_modules diff --git a/.gitignore b/.gitignore index 2a310b95..9003e269 100644 --- a/.gitignore +++ b/.gitignore @@ -21,8 +21,6 @@ _testmain.go *.exe -/.vscode/ - # Project specific cover /_bin/ diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..bb307070 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,13 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Run Extension", + "type": "extensionHost", + "request": "launch", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}" + ], + } + ] +} diff --git a/vscode/.gitignore b/vscode/.gitignore new file mode 100644 index 00000000..42743f77 --- /dev/null +++ b/vscode/.gitignore @@ -0,0 +1,2 @@ +/node_modules +/*.vsix diff --git a/vscode/HACKING.md b/vscode/HACKING.md new file mode 100644 index 00000000..f2fdcd8d --- /dev/null +++ b/vscode/HACKING.md @@ -0,0 +1,12 @@ +# Developing the Visual Studio Code extension + +Follow these steps to run the extension from source: + +1. Install NPM dependencies: `npm install`. + +2. Open the repository root (**not** this directory) in VS Code, and choose + "Run Extension" from the + [debug side bar](https://code.visualstudio.com/docs/editor/debugging). + +See Visual Studio Code's documentation on +[developing language extensions](https://code.visualstudio.com/api/language-extensions/overview). diff --git a/vscode/README.md b/vscode/README.md new file mode 100644 index 00000000..1fc505e5 --- /dev/null +++ b/vscode/README.md @@ -0,0 +1,11 @@ +# Elvish for Visual Studio Code + +This extension provides support for [Elvish](https://elv.sh) in +[Visual Studio Code](https://code.visualstudio.com). + +Current functionalities: + +- Syntax highlighting and configuration (e.g. bracket pairs) + +- Error checking and basic autocompletion, using Elvish's builtin language + server diff --git a/vscode/elvish.tmLanguage.json b/vscode/elvish.tmLanguage.json new file mode 100644 index 00000000..9f5a05e1 --- /dev/null +++ b/vscode/elvish.tmLanguage.json @@ -0,0 +1,117 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "Elvish", + "scopeName": "source.elvish", + "fileTypes": [ + "elv" + ], + "patterns": [ + { + "name": "string.quoted.double.elvish", + "begin": "\"", + "end": "\"", + "patterns": [ + { + "name": "constant.character.escape.elvish", + "match": "\\\\." + } + ] + }, + { + "name": "string.quoted.single.elvish", + "begin": "'", + "end": "'" + }, + + { + "name": "comment.line.number-sign.elvish", + "begin": "#", + "end": "$" + }, + + { + "name": "variable.other.elvish", + "match": "\\$[\\w\\d_:~-]+" + }, + { + "match": "(?<=^|\\{ |\\{\t|\\(|\\||\\;)\\s*(var|set|tmp|del)((\\s+[\\w\\d_:~-]+)*)", + "captures": { + "1": { + "name": "keyword.other.elvish" + }, + "2": { + "name": "variable.other.elvish" + } + } + }, + { + "match": "(?<=^|\\{ |\\{\t|\\(|\\||\\;)\\s*(for)\\s+([\\w\\d_:~-]+)", + "captures": { + "1": { + "name": "keyword.control.elvish" + }, + "2": { + "name": "variable.other.elvish" + } + } + }, + { + "match": "}\\s+(catch|except)\\s+([\\w\\d_:~-]+)", + "captures": { + "1": { + "name": "keyword.control.elvish" + }, + "2": { + "name": "variable.other.elvish" + } + } + }, + + { + "match": "(?<=^|\\{ |\\{\t|\\(|\\||\\;)\\s*(nop|!=|!=s|%|\\*|\\+|-gc|-ifaddrs|-log|-override-wcwidth|-stack|-|/|<|<=|<=s||>=|>=s|>s|all|assoc|base|bool|break|call|cd|compare|constantly|continue|count|defer|deprecate|dissoc|drop|each|eawk|echo|eq|eval|exact-num|exec|exit|external|fail|fg|float64|from-json|from-lines|from-terminated|get-env|has-env|has-external|has-key|has-value|is|keys|kind-of|make-map|multi-error|nop|not-eq|not|ns|num|one|only-bytes|only-values|order|peach|pprint|print|printf|put|rand|randint|range|read-line|read-upto|repeat|repr|resolve|return|run-parallel|search-external|set-env|show|sleep|slurp|src|styled|styled-segment|take|tilde-abbr|time|to-json|to-lines|to-string|to-terminated|unset-env|use-mod|wcswidth)(?=[\\s)}<>;|&])", + "captures": { + "1": { + "name": "support.function" + } + } + }, + + { + "match": "(?<=^|\\{ |\\{\t|\\(|\\||\\;)\\s*(and|or|coalesce)(?=[\\s)}<>;|&])", + "captures": { + "1": { + "name": "keyword.operator.elvish" + } + } + }, + { + "match": "(?<=^|\\{ |\\{\t|\\(|\\||\\;)\\s*(use|var|set|tmp|del|pragma|fn)(?=[\\s)}<>;|&])", + "captures": { + "1": { + "name": "keyword.other.elvish" + } + } + }, + { + "match": "(?<=^|\\{ |\\{\t|\\(|\\||\\;)\\s*(while|for|try|if)(?=[\\s)}<>;|&])", + "captures": { + "1": { + "name": "keyword.control.elvish" + } + } + }, + { + "match": "}\\s+(elif|else|finally)\\s+([\\w\\d_:~-]+)", + "captures": { + "1": { + "name": "keyword.control.elvish" + } + } + }, + + { + "name": "keyword.operator.elvish", + "match": "[*?|&;<>()\\[\\]{}]" + } + ] +} \ No newline at end of file diff --git a/vscode/extension.js b/vscode/extension.js new file mode 100644 index 00000000..27760f9c --- /dev/null +++ b/vscode/extension.js @@ -0,0 +1,24 @@ +const { LanguageClient } = require("vscode-languageclient/node"); + +let client; + +function activate() { + client = new LanguageClient( + "elvish", + "Elvish Language Server", + { command: "elvish", args: ["-lsp"] }, + { documentSelector: [{ scheme: "file", language: "elvish" }] } + ); + client.start(); +} + +function deactivate() { + if (client) { + return client.stop(); + } +} + +module.exports = { + activate, + deactivate, +}; diff --git a/vscode/icon.png b/vscode/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..2899e68f442ab0a6ea543921791f1486530a746e GIT binary patch literal 9047 zcmZ`Xv=R9Z5K5Nffd+oK~cdflA!BAg=n1G%D003ewO*LZxfPh~i03Hmy+4@$w zfj4Y-6+IOIXi6o#a>N0jS)DbF^#CB03jh$Y0B`{|A+`Y^Ko|ga9RNTU2>>)c1)WCn z;0u_Oj)od=`|nfou`&~E!S~U$@&f>-_r*of<|rKgU&PKZq{&U3yZS^@xf zyS3C*OoNy93qyi!=d#g}W_FPKJ&&Q|t6)2#jU4Wt$!i zX9wMDs9AZo)m?LR*?sgir)EX2A?#1}v)>9jc%0imu-crBVOdyWQ5j+!9(yNZLpS4C zhr>53xJ1d<*O%5HwL1U#Mctsvv2V zL>-itFkAdOY~Ql%!xual*+$}EszoAkZT{?uDhQ?+&qv0Gy^*;i_V^~U3bzQx3@sYi zQ{YidpMXvp@I~b#ej(ZlzJ;0SSJDK-7J)0~N9pF8M&#v`XVMr-VXOhu^$aq!4EiOC zapzW7{i!N12FHO=cIUe!EFaO+#|Y<3G!uX_W2f9zvNC=ML)bf?8qCI-4e;RphOIn^ zFfOa@BK}5bszn0h47Vh>BKMoPrvNccB7)pv*$OB~XU)2Dy19o^oja9W=&$E`_x*G$o29oooy>chNgYZdBHbH;Dr*esAO?kbCUqU(@w z>|mOneiyBwoW5shdc}bq29u7x0!*9kFNsttg!&`b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k|pDtqpU zy*Gko!bs6~Y{8%w0aRm~JQuMF>l|Zo$iZr0Q$m_Xa|%Ie@RKYCp=`)Gl+h2|oW$?G zL=^T;8sZu2d`AfGbQTxz(A5ncR^3~Db|0?;`sjWHs(SHmJ+hNRn?61DD|$yG0;m}o zA+2y27XSLXO4C;m4&TCQ#y6J+!Lgw_fAv|cuEXY zRP!-GQ?cMX%F^_tT%pXg^iLfm&yFn(67q?3Rg5LDdov4>umbwQ%8owm@u4Z6!x$S^ zr;s}>p)=*(>-ajt$+{B5C}uirW-P%hW=8D`Vd$AaBjGuI+S_Iligr1jP+^{(&!T9R z5}I?Z^j%Rz!m?$m;1SiBbT?lx{XO&D3bm+8gaLG>{5F$n5T6sdQMu}TI9kqa^u-0c z<@H~6)-_3m(I4C7qb!?%l#}&?dR&5Xs^%=_@m)9+L(8S5aX=~o++-%m7L7_dsS2;Fi{}{Z)w(@-qk>kq2v|O-d$hyPlL{YwsL${^m!`div9n&H{@XcN!U; zDRUeq+G!wx;@tid02k3;;&G#$mneRu*t0?MSpYi*&xd)4Rba?evZhzO5_zxAhQEUU zcSH$urhg0J%%BWkUA`#JV<6h#4tKJO%;xcHe_ib%7g)t>KH6M%XbX*z@M()((jSHB zuP>k`41a_xhE=)Us#g-=33D*+ydh`HwW;~9i0B^mi{h|{;sml zzOLX65ET}Yz9%AbPgvYkR8&?%R90M=Usyy|Soq2IuHpab@Wk5%?iTX@cVKKY-UB<( z{nKFL?dBik=<5mu1qBJhy*&J!9erE{y?x#Df6LQ@LKdN>mj1?$L99N$-fnPDS62TJ zA6HhmkH0ej1Q%=^65%~H=iwPO7#r96X$(Nw2?d=ADcC7=GAW@HtZE4HeitZviz(~a n;_S%4_yFSo?ifO|L|YKpr6Kb_RF%jERRCJ*`f6`g9ismSq@&Bl literal 0 HcmV?d00001 diff --git a/vscode/language-configuration.json b/vscode/language-configuration.json new file mode 100644 index 00000000..d5dfbd99 --- /dev/null +++ b/vscode/language-configuration.json @@ -0,0 +1,24 @@ +{ + "comments": { + "lineComment": "#", + }, + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + "autoClosingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ], + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ] +} \ No newline at end of file diff --git a/vscode/package-lock.json b/vscode/package-lock.json new file mode 100644 index 00000000..1fc436cf --- /dev/null +++ b/vscode/package-lock.json @@ -0,0 +1,192 @@ +{ + "name": "elvish", + "version": "0.19.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "elvish", + "version": "0.19.0", + "dependencies": { + "vscode-languageclient": "^7.0.0" + }, + "engines": { + "vscode": "^1.65.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/vscode-jsonrpc": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz", + "integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg==", + "engines": { + "node": ">=8.0.0 || >=10.0.0" + } + }, + "node_modules/vscode-languageclient": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.0.0.tgz", + "integrity": "sha512-P9AXdAPlsCgslpP9pRxYPqkNYV7Xq8300/aZDpO35j1fJm/ncize8iGswzYlcvFw5DQUx4eVk+KvfXdL0rehNg==", + "dependencies": { + "minimatch": "^3.0.4", + "semver": "^7.3.4", + "vscode-languageserver-protocol": "3.16.0" + }, + "engines": { + "vscode": "^1.52.0" + } + }, + "node_modules/vscode-languageserver-protocol": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz", + "integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==", + "dependencies": { + "vscode-jsonrpc": "6.0.0", + "vscode-languageserver-types": "3.16.0" + } + }, + "node_modules/vscode-languageserver-types": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz", + "integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA==" + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + }, + "dependencies": { + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "requires": { + "lru-cache": "^6.0.0" + } + }, + "vscode-jsonrpc": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz", + "integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg==" + }, + "vscode-languageclient": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.0.0.tgz", + "integrity": "sha512-P9AXdAPlsCgslpP9pRxYPqkNYV7Xq8300/aZDpO35j1fJm/ncize8iGswzYlcvFw5DQUx4eVk+KvfXdL0rehNg==", + "requires": { + "minimatch": "^3.0.4", + "semver": "^7.3.4", + "vscode-languageserver-protocol": "3.16.0" + } + }, + "vscode-languageserver-protocol": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz", + "integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==", + "requires": { + "vscode-jsonrpc": "6.0.0", + "vscode-languageserver-types": "3.16.0" + } + }, + "vscode-languageserver-types": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz", + "integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA==" + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } +} diff --git a/vscode/package.json b/vscode/package.json new file mode 100644 index 00000000..a65fb180 --- /dev/null +++ b/vscode/package.json @@ -0,0 +1,56 @@ +{ + "name": "elvish", + "displayName": "Elvish", + "description": "Elvish language support for Visual Studio Code", + "version": "0.1.0", + "publisher": "elves", + "license": "BSD-2-Clause", + "icon": "icon.png", + "repository": { + "type": "git", + "url": "https://github.com/elves/elvish" + }, + "engines": { + "vscode": "^1.65.0" + }, + "categories": [ + "Programming Languages" + ], + "activationEvents": [ + "onLanguage:elvish" + ], + "main": "./extension.js", + "contributes": { + "languages": [{ + "id": "elvish", + "aliases": ["Elvish", "elvish"], + "extensions": [".elv"], + "configuration": "./language-configuration.json" + }], + "grammars": [{ + "language": "elvish", + "scopeName": "source.elvish", + "path": "./elvish.tmLanguage.json" + }], + "configuration": { + "title": "Elvish", + "properties": { + "elvish.trace.server": { + "type": "string", + "enum": [ + "off", + "messages", + "verbose" + ], + "default": "off", + "description": "Trace communication between VS Code and the Elvish language server. Trace messages are shown in the Elvish Language Server output channel." + } + } + } + }, + "scripts": { + }, + "dependencies": { + "vscode-languageclient": "^7.0.0" + } +} \ No newline at end of file