├── .gitignore
├── .vscode
├── launch.json
├── settings.json
└── tasks.json
├── .vscodeignore
├── CHANGELOG.md
├── LICENSE_1_0.txt
├── README.ja.md
├── README.md
├── _config.yml
├── hellos
├── hello.c
├── hello.coffee
├── hello.cpp
├── hello.cr
├── hello.cs
├── hello.cxx
├── hello.d
├── hello.erl
├── hello.ex
├── hello.exs
├── hello.go
├── hello.groovy
├── hello.gvy
├── hello.hs
├── hello.java
├── hello.js
├── hello.lazy
├── hello.lisp
├── hello.lua
├── hello.ml
├── hello.nim
├── hello.pas
├── hello.php
├── hello.pl
├── hello.pony
├── hello.py
├── hello.rb
├── hello.rill
├── hello.rs
├── hello.scala
├── hello.sh
├── hello.sql
├── hello.swift
└── hello.vim
├── images
├── wandhex.1024.png
├── wandhex.128.png
└── wandhex.ico
├── package-lock.json
├── package.json
├── source
└── extension.ts
├── tsconfig.json
└── tslint.json
/.gitignore:
--------------------------------------------------------------------------------
1 | out
2 | node_modules
3 | .history
4 | desktop.ini
5 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | // A launch configuration that compiles the extension and then opens it inside a new window
2 | {
3 | "version": "0.1.0",
4 | "configurations": [
5 | {
6 | "name": "Launch Extension",
7 | "type": "extensionHost",
8 | "request": "launch",
9 | "runtimeExecutable": "${execPath}",
10 | "args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
11 | "stopOnEntry": false,
12 | "sourceMaps": true,
13 | "outFiles": [ "${workspaceRoot}/out/source/**/*.js" ],
14 | "preLaunchTask": "npm"
15 | }
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | // Place your settings in this file to overwrite default and user settings.
2 | {
3 | "files.exclude": {
4 | "out": false // set this to true to hide the "out" folder with the compiled JS files
5 | },
6 | "search.exclude": {
7 | "out": true // set this to false to include "out" folder in search results
8 | },
9 | "typescript.tsdk": "./node_modules/typescript/lib",
10 | "workbench.colorCustomizations": {
11 | "titleBar.foreground": "#FFF6DE",
12 | "titleBar.background": "#967825",
13 | "statusBarItem.hoverForeground": "#100018",
14 | "minimap.background": "#00000088",
15 | "activityBar.foreground": "#83D7F5",
16 | "activityBar.background": "#00090D",
17 | "activityBar.inactiveForeground": "#006254",
18 | "activityBarBadge.foreground": "#000162",
19 | "activityBarBadge.background": "#A4A5FF",
20 | "statusBar.foreground": "#ECE784",
21 | "statusBar.background": "#6A6401",
22 | "statusBarItem.hoverBackground": "#3B530C",
23 | "statusBarItem.remoteForeground": "#B4FF91",
24 | "statusBarItem.remoteBackground": "#307F0C",
25 | "statusBar.debuggingForeground": "#000000",
26 | "statusBar.debuggingBackground": "#A09B37"
27 | } // we want to use the TS server from our node_modules folder to control its version
28 | }
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | // Available variables which can be used inside of strings.
2 | // ${workspaceRoot}: the root folder of the team
3 | // ${file}: the current opened file
4 | // ${fileBasename}: the current opened file's basename
5 | // ${fileDirname}: the current opened file's dirname
6 | // ${fileExtname}: the current opened file's extension
7 | // ${cwd}: the current working directory of the spawned process
8 |
9 | // A task runner that calls a custom npm script that compiles the extension.
10 | {
11 | "version": "2.0.0",
12 |
13 | // we want to run npm
14 | "command": "npm",
15 |
16 | // we run the custom script "compile" as defined in package.json
17 | "args": ["run", "compile", "--loglevel", "silent"],
18 |
19 | // The tsc compiler is started in watching mode
20 | "isWatching": true,
21 |
22 | // use the standard tsc in watch mode problem matcher to find compile problems in the output.
23 | "problemMatcher": "$tsc-watch",
24 | "tasks": [
25 | {
26 | "label": "npm",
27 | "type": "shell",
28 | "command": "npm",
29 | "args": [
30 | "run",
31 | "compile",
32 | "--loglevel",
33 | "silent"
34 | ],
35 | "isBackground": true,
36 | "problemMatcher": "$tsc-watch",
37 | "group": {
38 | "_id": "build",
39 | "isDefault": false
40 | }
41 | }
42 | ]
43 | }
--------------------------------------------------------------------------------
/.vscodeignore:
--------------------------------------------------------------------------------
1 | .vscode/**
2 | .vscode-test/**
3 | out/test/**
4 | test/**
5 | source/**
6 | **/*.map
7 | .gitignore
8 | tsconfig.json
9 | vsc-extension-quickstart.md
10 | _config.yml
11 | images/wandhex.1024.png
12 | images/wandhex.ico
13 | .history/**
14 | tslint.json
15 | desktop.ini
16 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | All notable changes to the "wandbox-vscode" extension will be documented in this file.
4 |
5 | Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
6 |
7 | ## 3.0.1 - 2022-07-16
8 |
9 | ### Added
10 |
11 | - Also released on [github.com](https://github.com/wraith13/wandbox-vscode/releases)
12 | - VSIX download link in README.md
13 |
14 | ### Security
15 |
16 | - `npm audit fix --force`
17 |
18 | ## 3.0.0 - 2020-03-24
19 |
20 | ### Fixed
21 |
22 | - Fixed issue that Settings menu disappears instantly after entering ( [issue #15](https://github.com/wraith13/wandbox-vscode/issues/15) )
23 |
24 | ### Changed
25 |
26 | - DOC: Changed description that how to install in README.
27 | - Minimum VS Code version: 1.9.1 -> 1.43.0
28 |
29 | ### Security
30 |
31 | - `CVE-2020-7598`
32 | - `npm audit fix --force`
33 |
34 | ## 2.2.3 - 2018-01-05
35 |
36 | ### Fixed
37 |
38 | - Fixed issue that stdin option dose not work on windows.
39 |
40 | ## 2.2.2 - 2017-10-17
41 |
42 | ### Fixed
43 |
44 | - Fixed issue that multiple files dose not work with saved file. ( [issue #12](https://github.com/wraith13/wandbox-vscode/issues/12) )
45 |
46 | ## 2.2.1 - 2017-07-16
47 |
48 | ### Fixed
49 |
50 | - Fixed issue that `Wandbox: New` command dose not work without current text document.
51 |
52 | ## 2.2.0 - 2017-04-07
53 |
54 | ### Added
55 |
56 | - Added `Wandbox: New` command.
57 |
58 | ### Deprecated
59 |
60 | - `Wandbox: Hello` command.
61 |
62 | ### Fixed
63 |
64 | - Fixed perl comment symbol in Hello, world!
65 |
66 | ## 2.1.7 - 2017-03-25
67 |
68 | ### Added
69 |
70 | - Supported Nim
71 |
72 | ## 2.1.6 - 2017-03-24
73 |
74 | ### Added
75 |
76 | - Supported Crystal
77 |
78 | ## 2.1.5 - 2017-03-23
79 |
80 | ### Added
81 |
82 | - Supported Pony
83 | - DOC: Added a wandbox-builder link in README
84 |
85 | ### Changed
86 |
87 | - Changed wandbox server address to a [new server](https://wandbox.org/). ( old url is http://melpon.org/wandbox/ )
88 |
89 | ## 2.1.4 - 2017-03-20
90 |
91 | ### Fixed
92 |
93 | - DOC: Fixed a Date in Change Log
94 |
95 | ## 2.1.3 - 2017-03-20
96 |
97 | ### Fixed
98 |
99 | - Fixed issue that it doesn't set language mode to hello world document with `Wandbox: Hello` command.
100 | - Fixed issue that it volatiles settings.
101 |
102 | ## 2.1.2 - 2017-03-17
103 |
104 | ### Added
105 |
106 | - Supported OCaml
107 | - Supported Go lang
108 | - DOC: Contributed to Tutorial secttion in README
109 | - DOC: Contributed to Extension Settings secttion in README
110 | - DOC: Keyboard shortcut Settings secttion in README
111 |
112 | ### Fixed
113 |
114 | - Changed all internal command name( example: `extension.invokeWandbox` → `wandbox.run` )
115 |
116 | ### Deprecated
117 |
118 | - All internal command name like as `extension.*`
119 |
120 | ## 2.1.1 - 2017-03-04
121 |
122 | ### Added
123 |
124 | - DOC: README in Japanese
125 | - DOC: Tutorial secttion in README
126 |
127 | ### Fixed
128 |
129 | - Fixed issue that it doesn't write "Canceled" to log when to cancel `Wandbox: Set Options` command.
130 |
131 |
132 | ## 2.1.0 - 2017-03-03
133 |
134 | ### Added
135 |
136 | - Added `Wandbox: Show History` command.
137 | - Added `Wandbox: Clear History` command.
138 | - Added `wandbox.maxHistorySize` setting.
139 |
140 |
141 | ## 2.0.1 - 2017-02-28
142 |
143 | ### Fixed
144 |
145 | - Fixed issue that additionals doesn't work.
146 | - Fixed issue that error handling in additionals and stdin doesn't work.
147 |
148 |
149 | ## 2.0.0 - 2017-02-27
150 |
151 | ### Added
152 |
153 | - Added `wandbox.Servers` setting.
154 | - Added `wandbox.emoji` setting.
155 | - Added `wandbox.languageMapping` setting.
156 | - Added `wandbox.extensionLanguageMapping` setting.
157 | - DOC: VSMarketplaceBadge.
158 | - DOC: Screenshots.
159 |
160 | ### Changed
161 |
162 | - Changed to quick pick based UI for to easy use.
163 | - Default compiler selection was changed to follows wandbox server .
164 | - Writes "Canceled" in log when a command is canceled by user operation.
165 | - Changed `wandbox.languageCompilerMapping` default setting to null.
166 | - Changed `wandbox.extensionCompilerMapping` default setting to null.
167 | - Changed PHP's hello, world! file ( https://github.com/wraith13/wandbox-vscode/pull/3 )
168 |
169 | ### Fixed
170 |
171 | - Fixed issue that reset settings without intention when to open untitled documents.
172 |
173 | ### Removed
174 |
175 | - Removed `wandbox.defaultServer` setting. ( You can use `wandbox.Servers` setting. )
176 | - Removed `Wandbox: Show Compilers` command. ( You can use `Wandbox: Set Compilers` command or `Wandbox: Show Raw JSON` command. )
177 | - Removed `Wandbox: Show Options` command. ( You can use `Wandbox: Set Options` command or `Wandbox: Show Raw JSON` command. )
178 | - Removed `Wandbox: Set Additional Files` command. ( You can use `Wandbox: Set Options` command. )
179 | - Removed `Wandbox: Set StdIn` command. ( You can use `Wandbox: Set Options` command. )
180 | - Removed `Wandbox: Set Compiler Option Raw` command. ( You can use `Wandbox: Set Options` command. )
181 | - Removed `Wandbox: Set Runtime Option Raw` command. ( You can use `Wandbox: Set Options` command. )
182 |
183 |
184 | ## 1.1.0 - 2017-02-07
185 |
186 | ### Added
187 |
188 | - Added `Wandbox: Hello Command` ( with `wandbox.helloWolrdFiles` setting ).
189 | - Added `wandbox.simplifyPostData` setting.
190 |
191 | ### Changed
192 |
193 | - Update a compiler mapping table for current Wandbox.
194 | - Included a post file in the POST data on log.
195 |
196 | ### Fixed
197 |
198 | - Fixed issue that zombie settings on untitled documents.
199 | - Fixed issue that showing old json cache.
200 | - Fixed issue that not showing license in marketplace.
201 | - DOC: Swift → Apple Swift (in description)
202 |
203 | ### Removed
204 |
205 | - Removed unnecessary files from package.
206 |
207 | ## 1.0.5 - 2017-02-07
208 |
209 | ### Added
210 |
211 | - `wandbox.outputChannelName` setting
212 |
213 | ### Changed
214 |
215 | - optimize output when wandbox server return error.
216 |
217 | ### Fixed
218 |
219 | - DOC:(typo) wandbox → Wandbox (in description)
220 | - DOC:(typo) wandbox.defaultSerer → wandbox.defaultServer (in README)
221 |
222 | ## 1.0.4 - 2017-02-05
223 |
224 | ### Changed
225 |
226 | - Show Compilers command: grouping Compilers by language.
227 | - DOC: Added available languages to description for search in marketplace.
228 | - DOC: Added link to Wandbox API Reference in Show Commands section at README.
229 |
230 | ## 1.0.3 - 2017-02-04
231 |
232 | ### Fixed
233 |
234 | - Fixed crash some command when show a extension detail.
235 | - Reset Settings command: Remove the trash at the end of the title.
236 |
237 | ### Changed
238 |
239 | - DOC: Added available languages in Features section at README.
240 |
241 | ## 1.0.2 - 2017-02-04
242 |
243 | ### Changed
244 |
245 | - default C compiler clang-3.3-c → clang-head-c
246 | - DOC: description for search in marketplace.
247 |
248 | ## 1.0.1 - 2017-02-03
249 |
250 | ### Fixed
251 |
252 | - DOC: http://wandbox.fetus.jp/ → https://wandbox.fetus.jp/
253 |
254 | ## 1.0.0 - 2017-02-03
255 |
256 | ### Added
257 |
258 | - Initial release of wandbox-vscode.
259 |
260 | ## [Unreleased]
261 |
262 | ## 0.0.0 - 2017-01-21
263 |
264 | ### Added
265 |
266 | - Start this project.
--------------------------------------------------------------------------------
/LICENSE_1_0.txt:
--------------------------------------------------------------------------------
1 | Boost Software License - Version 1.0 - August 17th, 2003
2 |
3 | Permission is hereby granted, free of charge, to any person or organization
4 | obtaining a copy of the software and accompanying documentation covered by
5 | this license (the "Software") to use, reproduce, display, distribute,
6 | execute, and transmit the Software, and to prepare derivative works of the
7 | Software, and to permit third-parties to whom the Software is furnished to
8 | do so, all subject to the following:
9 |
10 | The copyright notices in the Software and this entire statement, including
11 | the above license grant, this restriction and the following disclaimer,
12 | must be included in all copies of the Software, in whole or in part, and
13 | all derivative works of the Software, unless such copies or derivative
14 | works are solely in the form of machine-executable object code generated by
15 | a source language processor.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 | DEALINGS IN THE SOFTWARE.
24 |
--------------------------------------------------------------------------------
/README.ja.md:
--------------------------------------------------------------------------------
1 | # wandbox-vscode ( [🇬🇧 English](https://github.com/wraith13/wandbox-vscode/blob/master/README.md) )
2 |
3 | [  ](https://marketplace.visualstudio.com/items?itemName=wraith13.wandbox-vscode)
4 |
5 | [Wandbox](https://wandbox.org)([GitHub](https://github.com/melpon/wandbox/)) はソーシャルコンパレーションサービスです。このエクステンションは Visual Studio Code の為の Wandbox フロントエンドです。
6 |
7 | > Wandbox は [@melpon](https://github.com/melpon)( 🐕 犬) が個人的に無償(自腹)で提供しているサービスです。
8 | > このサービスが提供され続ける為、このサービスに高負荷をかけないようにしてください。
9 | > [あなたはスポンサーになることもできます。](https://gist.github.com/melpon/8f5d7a8e991ed466d09cf887bd8d92ce)
10 |
11 | ## 機能
12 |
13 | wandbox-vscode はコンパイル、実行、シェアを行う為のいくつかのコマンドをコマンドパレット上で提供します。
14 |
15 | > コマンドパレットはキーボードショートカットで表示できます。
16 | >
17 | > Mac: F1 or Shift+Command+P
18 | >
19 | > Windows and Linux: F1 or Shift+Ctrl+P
20 |
21 | 現在 wandbox で利用可能な言語 :
22 | Bash script, C, C#, C++, CoffeeScript, CPP, Crystal, D, Elixir, Erlang, Go, Groovy, Haskell, Java, JavaScript, Lazy K, Lisp, Lua, Nim, OCaml, Pascal, Perl, PHP, Pony, Python, Rill, Ruby, Rust, Scala, SQL, Apple Swift, Vim script
23 |
24 | ## チュートリアル
25 |
26 | ### 0. ⬇️ wandbox-vscodeのインストール:
27 |
28 | VS Code の拡張サイドバーを出して(Mac:Command+Shift+X, Windows and Linux: Ctrl+Shift+X)、 `wandbox-vscode` とタイプし Enter キーを押下し、Install をクリックします。インストールが終わったら VS Code を再起動してください。
29 |
30 | ### 1. ✨️ 新規"Hello, World!"を開く:
31 |
32 | コマンドパレットを出して(Mac:F1 or Shift+Command+P, Windows and Linux: F1 or Shift+Ctrl+P)、 `Wandbox: New` コマンドを実行し、適当な "Hello, World!" コードを選択します。
33 |
34 | > 👉 その他の方法で開いたファイルでも構いません。
35 |
36 | ### 2. 🚀 wandbox上でのコンパイルと実行:
37 |
38 | またコマンドパレットを出して、 `Wandbox: Run` コマンドを実行します。
39 |
40 | ### 3. 🔗 シェアURLの作成:
41 |
42 | コマンドパレットから `Wandbox: Share` コマンドを実行します。
43 |
44 | > 👉 自動的にシェアURLを開く挙動は `wandbox.autoOpenShareUrl` の設定で無効化できます。
45 |
46 | ### 4. 📅 シェアURLの履歴表示:
47 |
48 | コマンドパレットから `Wandbox: History` コマンドを実行します。
49 |
50 | > 👉 `wandbox.maxHistorySize` の設定で保存する履歴の数を指定できます。
51 |
52 | ### 5. 🔧 次のステップ:
53 |
54 | `Wandbox: Set Compiler` コマンドでコンパイラを変更できますし、 `Wandbox: Set Options` コマンドで様々なコンパイルオプションを指定できまのでいろいろ試してみてください。
55 |
56 | > 👉 オプションの内容は選択されているコンパイラによって大幅に変わります。
57 |
58 | また settings.json で wandbox-vscode の[各種設定](#エクステンションの設定)を変更したり、 keybindings.json で wandbox-vscode のコマンドに[キーボードショートカット](#キーボードショートカットの設定)を割り当てる事もできます。
59 |
60 | ## スクリーンショット
61 |
62 | ### コマンドリスト
63 |
64 | 
65 |
66 | ### 言語
67 |
68 | 
69 | 
70 |
71 | ### コンパイラ
72 |
73 | 
74 |
75 | ### オプション
76 |
77 | 
78 | 
79 |
80 | ## メインコマンド
81 |
82 | * `Wandbox: Run` : カレントのドキュメントを wandbox で実行します
83 | * `Wandbox: Share` : シェアURLを作成します
84 |
85 | > 👉 自動的にシェアURLを開く挙動は `wandbox.autoOpenShareUrl` の設定で無効化できます。
86 |
87 | * `Wandbox: New` : 新規 "Hello, World!" を開きます
88 | * `Wandbox: Hello` : 新規 "Hello, World!" を開きます
89 |
90 | > ⚠️ 本家 Wandbox が同機能に対応した為、`Wandbox: New` を新設し `Wandbox: Hello` は非推奨となりました。
91 |
92 | ## 表示コマンド
93 |
94 | * `Wandbox: Show Raw JSON` : wandbox の仕様情報を生の JSON で表示します
95 |
96 | > 👉 参照: [Wandbox API Reference](https://github.com/melpon/wandbox/blob/master/kennel2/API.rst)
97 |
98 | * `Wandbox: Show Web Site` : wandbox web サイトを開きます
99 | * `Wandbox: Show Settings` : wandbox-vscode の全ての設定表示します。
100 | * `Wandbox: Show History` : シェア履歴を表示します。
101 |
102 | > 👉 `wandbox.maxHistorySize` の設定で保存する履歴の数を指定できます。
103 |
104 | ## 消去コマンド
105 |
106 | * `Wandbox: Clear History` : シェア履歴を消去します。
107 |
108 | ## 設定コマンド
109 |
110 | 全ての設定コマンドはカレントのドキュメントに対して行われます。
111 | 全ての設定コマンドの効果は Visual Studio Code を次回起動した時には消えています。
112 |
113 | * `Wandbox: Set Server` : wandboxサーバーURLを設定します。
114 |
115 | > 👉 [`https://wandbox.fetus.jp/`](https://wandbox.fetus.jp/) を使うこともできます。この Wandbox サーバーには非常に多くの PHP コンパイラがあります。
116 | > Wandbox は [@fetus-hina](https://github.com/fetus-hina) が個人的に無償(自腹)で提供しているサービスです。
117 | > このサービスが提供され続ける為、このサービスに高負荷をかけないようにしてください。
118 |
119 | * `Wandbox: Set Compiler` : コンパイラを設定します。
120 | * `Wandbox: Set Options` : コンパイルオプションを設定します。
121 | * `Wandbox: Set Settings JSON` : JSON で一時的な設定をします。
122 | * `Wandbox: Reset Settings` : 全ての一時的な設定をリセットします。
123 |
124 |
125 | ## エクステンションの設定
126 |
127 | [`settings.json`](https://code.visualstudio.com/docs/customization/userandworkspace#_creating-user-and-workspace-settings)( Mac: Command+,, Windows / Linux: ファイル → 基本設定 → 設定 ) で次の設定ができます。
128 |
129 | * `wandbox.Servers`: wandboxサーバーURLリスト ( 最初のURLがデフォルト wandboxサーバーURLになります。 )
130 | * `wandbox.simplifyPostData`: postデータを表示の際に簡素化します
131 | * `wandbox.autoOpenShareUrl`: シェアURL作成時に自動的にそのURLを開きます
132 | * `wandbox.outputChannelName`: 出力チャンネル名
133 | * `wandbox.languageMapping`: vscodeでの言語に対しwandboxでの言語を設定します
134 | * `wandbox.languageCompilerMapping`: 言語に対してコンパイラを設定します
135 | * `wandbox.extensionLanguageMapping`: ファイル拡張子に対して言語を設定します
136 | * `wandbox.extensionCompilerMapping`: ファイル拡張子に対してコンパイラを設定します
137 | * `wandbox.options`: コンパイラに対してオプションを設定します
138 | * `wandbox.compilerOptionRaw`: コンパイラに対して生のオプションを設定します
139 | * `wandbox.runtimeOptionRaw`: コンパイラに対して生の実行時オプションを設定します
140 | * `wandbox.helloWolrdFiles`: hello world ファイルを設定
141 | * `wandbox.maxHistorySize`: 最大履歴サイズを設定
142 | * `wandbox.emoji`: 絵文字を設定
143 |
144 | > 👉 あなたの環境のフォントが貧相な場合は次のような設定にしてください。
145 | >```json
146 | > "wandbox.emoji": {
147 | > "stamp": null,
148 | > "error": null,
149 | > "warning": null,
150 | > "hint": null,
151 | > "signal": null,
152 | > "link": null,
153 | > "lap": null,
154 | > "new": null,
155 | > "checkedBox": "[o]",
156 | > "uncheckedBox": "[_]",
157 | > "checkedRadio": "(o)",
158 | > "uncheckedRadio": "(_)",
159 | > "edit": null,
160 | > "menuSeparator": "---------------------------------------------"
161 | > }
162 | >```
163 | >
164 | > Mac での `wandbox.emoji` 設定のスクリーンショット ( 参考用 )
165 | >
166 | > 
167 |
168 | ## キーボードショートカットの設定
169 |
170 | wandbox-vscode のコマンドには初期状態ではキーボードショートカットが割り当てられていませんが、
171 | [`keybindings.json`](https://code.visualstudio.com/docs/customization/keybindings#_customizing-shortcuts)( Mac: Code → 基本設定 → キーボード ショートカット, Windows / Linux: ファイル → 基本設定 → キーボード ショートカット) でキーボードショートカットを割り当てる事ができます。
172 |
173 | `keybindings.json` で指定するコマンド名はコマンドパレット上で入力する名前は異なりますので、下の対応表を見て設定してください。
174 |
175 | |コマンドパレット上|keybindings.json上|
176 | |-|-|
177 | |`Wandbox: Run`|`wandbox.run`|
178 | |`Wandbox: Share`|`wandbox.share`|
179 | |`Wandbox: Hello`|`wandbox.hello`|
180 | |`Wandbox: Show Raw JSON`|`wandbox.showListJson`|
181 | |`Wandbox: Show Web Site`|`wandbox.showWeb`|
182 | |`Wandbox: Show Settings`|`wandbox.showSettings`|
183 | |`Wandbox: Show History`|`wandbox.showHistory`|
184 | |`Wandbox: Clear History`|`wandbox.clearHistory`|
185 | |`Wandbox: Set Server`|`wandbox.setFileServer`|
186 | |`Wandbox: Set Compiler`|`wandbox.setFileCompiler`|
187 | |`Wandbox: Set Options`|`wandbox.setFileOptions`|
188 | |`Wandbox: Set Settings JSON`|`wandbox.setFileSettingJson`|
189 | |`Wandbox: Reset Settings`|`wandbox.resetFileSettings`|
190 |
191 | > ⚠️ `extention.*` のようなコマンド名は非推奨となりました。
192 |
193 | ## リリースノート
194 |
195 | [marketplace](https://marketplace.visualstudio.com/items/wraith13.wandbox-vscode/changelog) あるいは [github](https://github.com/wraith13/wandbox-vscode/blob/master/CHANGELOG.md) の ChangLog を参照してください。
196 |
197 |
198 | ## "Wandbox に俺の好きなコンパイラがないぞ!"
199 |
200 | 問題ありません! あなたは [wandbox](https://github.com/melpon/wandbox/) にプルリクエストを投げることができます!
201 |
202 | > [wandbox-builder](https://github.com/melpon/wandbox-builder) も参照してください。
203 |
204 | ## サポート
205 |
206 | [GitHub Issues](https://github.com/wraith13/wandbox-vscode/issues)
207 |
208 | ## ライセンス
209 |
210 | [Boost Software License](https://github.com/wraith13/wandbox-vscode/blob/master/LICENSE_1_0.txt)
211 |
212 | ## 謝辞
213 |
214 | Thanks [@melpon](https://github.com/melpon)( 🐕 犬) and [@kikairoya](https://github.com/kikairoya)( 🐂 牛) for awesome compilation service!
215 |
216 | Thanks [@fetus-hina](https://github.com/fetus-hina)( 👶 baby) for a PHP specialized wandbox service!
217 |
218 | Thanks [@rhysd](https://github.com/rhysd)( 🐕 犬) for your support in TypeScript!
219 |
220 | Thanks [@chomado](https://github.com/chomado)( 👧 girl) for a great extension icon!
221 |
222 | ## リンク
223 |
224 | [Wandbox関連プロジェクト](https://github.com/search?p=1&q=wandbox&type=Repositories&utf8=✓)
225 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # wandbox-vscode ( [🇯🇵 Japanese](https://github.com/wraith13/wandbox-vscode/blob/master/README.ja.md) )
2 |
3 | [  ](https://marketplace.visualstudio.com/items?itemName=wraith13.wandbox-vscode)
4 |
5 | [Wandbox](https://wandbox.org)([GitHub](https://github.com/melpon/wandbox/)) is a social compilation service. This extension is Wandbox front-end for Visual Studio Code.
6 |
7 | > Wandbox is provided from [@melpon](https://github.com/melpon)( 🐕 dog) as a personal voluntary service.
8 | > For keep this service, please do not put a high load on this service.
9 | > [You can be a sponsor of the wandbox.](https://gist.github.com/melpon/8f5d7a8e991ed466d09cf887bd8d92ce)( [In English by a third party](https://gist.github.com/Cryolite/85ac45cd0d586e84db230ebf49e18c32) )
10 |
11 | ## Features
12 |
13 | wandbox-vscode provide several commands in the Command Palette for compile, run, share.
14 |
15 | > You can show Command Palette by keyboard-shortcuts.
16 | >
17 | > Mac: F1 or Shift+Command+P
18 | >
19 | > Windows and Linux: F1 or Shift+Ctrl+P
20 |
21 | Available languages on wandbox at now :
22 | Bash script, C, C#, C++, CoffeeScript, CPP, Crystal, D, Elixir, Erlang, Go, Groovy, Haskell, Java, JavaScript, Lazy K, Lisp, Lua, Nim, OCaml, Pascal, Perl, PHP, Pony, Python, Rill, Ruby, Rust, Scala, SQL, Apple Swift, Vim script
23 |
24 |
25 | ## Tutorial
26 |
27 | ### 0. ⬇️ Install wandbox-vscode:
28 |
29 | Show extension side bar within VS Code(Mac:Command+Shift+X, Windows and Linux: Ctrl+Shift+X), type `wandbox-vscode` and press Enter and click Install. Restart VS Code when installation is completed.
30 |
31 | ### 1. ✨️ Open new "Hello, World!":
32 |
33 | Launch Command Palette(Mac:F1 or Shift+Command+P, Windows and Linux: F1 or Shift+Ctrl+P), Execute `Wandbox: New` command and select a "Hello, World!" code as you like.
34 |
35 | > 👉 You can also open files in other ways.
36 |
37 | ### 2. 🚀 Compile & Run on wandbox:
38 |
39 | Launch Command Palette again, Execute `Wandbox: Run` command.
40 |
41 | ### 3. 🔗 Make share URL:
42 |
43 | Execute `Wandbox: Share` command from Command Palette.
44 |
45 | > 👉 You can disable to auto open share url by `wandbox.autoOpenShareUrl` setting.
46 |
47 | ### 4. 📅 Show share URL history:
48 |
49 | Execute `Wandbox: History` command from Command Palette.
50 |
51 | > 👉 You can change max history size by `wandbox.maxHistorySize` setting.
52 |
53 | ### 5. 🔧 Next step:
54 |
55 | You can change compiler by `Wandbox: Set Compiler` command. And you can specify various options by `Wandbox: Set Options` command.
56 |
57 | > 👉 Option repertory depends a selected compiler.
58 |
59 | You can change [settings](#extension-settings) by `settings.json`. And you can apply [keyboard shortcuts](#keyboard-shortcut-settings) by `keybindings.json`.
60 |
61 | Enjoy!
62 |
63 | ## Screenshots
64 |
65 | ### command list
66 |
67 | 
68 |
69 | ### languages
70 |
71 | 
72 | 
73 |
74 | ### compilers
75 |
76 | 
77 |
78 | ### options
79 |
80 | 
81 | 
82 |
83 | ## Main Commands
84 |
85 | * `Wandbox: Run` : run a current document on wandbox
86 | * `Wandbox: Share` : make a share url
87 |
88 | > 👉 You can disable to auto open share url by `wandbox.autoOpenShareUrl` setting.
89 |
90 | * `Wandbox: New` : open new "Hello, World!"
91 | * `Wandbox: Hello` : open new "Hello, World!"
92 |
93 | > ⚠️ Because the Wandbox corresponds to the same function, the `[ho
94 | Since Wandbox was compatible with the same function, `Wandbox: New` is made. And this `Wandbox: Hello` command is deprecated now.
95 |
96 | ## Show Commands
97 |
98 | * `Wandbox: Show Raw JSON` : show a wandbox specs as raw JSON
99 |
100 | > 👉 see [Wandbox API Reference](https://github.com/melpon/wandbox/blob/master/kennel2/API.rst)
101 |
102 | * `Wandbox: Show Web Site` : open wandbox web site
103 | * `Wandbox: Show Settings` : show all wandbox-vscode settings
104 | * `Wandbox: Show History` : show share history
105 |
106 | > 👉 You can change to max history size by `wandbox.maxHistorySize` setting.
107 |
108 | ## Clear Commands
109 |
110 | * `Wandbox: Clear History` : clear share history
111 |
112 | ## Setting Commands
113 |
114 | Target of all setting commands is a current document.
115 | Effect of all setting commands expires with next Visual Studio Code process.
116 |
117 | * `Wandbox: Set Server` : set a wandbox server url
118 |
119 | > 👉 You can use [`https://wandbox.fetus.jp/`](https://wandbox.fetus.jp/) . This Wandbox server has a wide variety of PHP compilers.
120 | > This Wandbox server is provided from [@fetus-hina](https://github.com/fetus-hina) as a personal voluntary service.
121 | > For keep this service, please do not put a high load on this service.
122 |
123 | * `Wandbox: Set Compiler` : set a compiler
124 | * `Wandbox: Set Options` : set options for compile
125 | * `Wandbox: Set Settings JSON` : set all temporary settings by JSON
126 | * `Wandbox: Reset Settings` : reset all temporary settings
127 |
128 | ## Extension Settings
129 |
130 | This extension contributes the following settings by [`settings.json`](https://code.visualstudio.com/docs/customization/userandworkspace#_creating-user-and-workspace-settings)( Mac: Command+,, Windows / Linux: File -> Preferences -> User Settings ):
131 |
132 | * `wandbox.Servers`: wandbox server url list ( first one is default wandbox server url )
133 | * `wandbox.simplifyPostData`: simplify post data when showing
134 | * `wandbox.autoOpenShareUrl`: when make a share url, auto open it
135 | * `wandbox.outputChannelName`: output channel name
136 | * `wandbox.languageMapping`: set language in wandbox by language in vscode
137 | * `wandbox.languageCompilerMapping`: set compiler by language
138 | * `wandbox.extensionLanguageMapping`: set language by file extension
139 | * `wandbox.extensionCompilerMapping`: set compiler by file extension
140 | * `wandbox.options`: set options by compiler
141 | * `wandbox.compilerOptionRaw`: set raw option by compiler
142 | * `wandbox.runtimeOptionRaw`: set raw runtime option by compiler
143 | * `wandbox.helloWolrdFiles`: set hello world files
144 | * `wandbox.maxHistorySize`: set max share history size
145 | * `wandbox.emoji`: set emoji
146 |
147 | > 👉 You can set following if your environment's font is poor.
148 | >```json
149 | > "wandbox.emoji": {
150 | > "stamp": null,
151 | > "error": null,
152 | > "warning": null,
153 | > "hint": null,
154 | > "signal": null,
155 | > "link": null,
156 | > "lap": null,
157 | > "new": null,
158 | > "checkedBox": "[o]",
159 | > "uncheckedBox": "[_]",
160 | > "checkedRadio": "(o)",
161 | > "uncheckedRadio": "(_)",
162 | > "edit": null,
163 | > "menuSeparator": "---------------------------------------------"
164 | > }
165 | >```
166 | >
167 | > `wandbox.emoji` setting's screenshot in Mac ( for reference )
168 | >
169 | > 
170 |
171 | ## Keyboard shortcut Settings
172 |
173 | In default, wandbox-vscode's commands doesn't apply keyboard shortcuts. Althogh,
174 | you can apply keyboard shortcuts by [`keybindings.json`](https://code.visualstudio.com/docs/customization/keybindings#_customizing-shortcuts)
175 | ( Mac: Code -> Preferences -> Keyboard Shortcuts, Windows / Linux: File -> Preferences -> Keyboard Shortcuts).
176 |
177 | Command name on `keybindings.json` is diffarent from on Command Pallete. See below table.
178 |
179 | |on Command Pallete|on keybindings.json|
180 | |-|-|
181 | |`Wandbox: Run`|`wandbox.run`|
182 | |`Wandbox: Share`|`wandbox.share`|
183 | |`Wandbox: Hello`|`wandbox.hello`|
184 | |`Wandbox: Show Raw JSON`|`wandbox.showListJson`|
185 | |`Wandbox: Show Web Site`|`wandbox.showWeb`|
186 | |`Wandbox: Show Settings`|`wandbox.showSettings`|
187 | |`Wandbox: Show History`|`wandbox.showHistory`|
188 | |`Wandbox: Clear History`|`wandbox.clearHistory`|
189 | |`Wandbox: Set Server`|`wandbox.setFileServer`|
190 | |`Wandbox: Set Compiler`|`wandbox.setFileCompiler`|
191 | |`Wandbox: Set Options`|`wandbox.setFileOptions`|
192 | |`Wandbox: Set Settings JSON`|`wandbox.setFileSettingJson`|
193 | |`Wandbox: Reset Settings`|`wandbox.resetFileSettings`|
194 |
195 | > ⚠️ Command name like as `extention.*` is deprecated.
196 |
197 | ## Release Notes
198 |
199 | see ChangLog on [marketplace](https://marketplace.visualstudio.com/items/wraith13.wandbox-vscode/changelog) or [github](https://github.com/wraith13/wandbox-vscode/blob/master/CHANGELOG.md)
200 |
201 |
202 | ## "Wandbox has not my favorite compiler!"
203 |
204 | No probrem! You can pull request to [wandbox](https://github.com/melpon/wandbox/)!
205 |
206 | > see [wandbox-builder](https://github.com/melpon/wandbox-builder)
207 |
208 | ## Support
209 |
210 | [GitHub Issues](https://github.com/wraith13/wandbox-vscode/issues)
211 |
212 | ## License
213 |
214 | [Boost Software License](https://github.com/wraith13/wandbox-vscode/blob/master/LICENSE_1_0.txt)
215 |
216 | ## Download VSIX file ( for VS Code compatible softwares )
217 |
218 | [Releases · wraith13/wandbox-vscode](https://github.com/wraith13/wandbox-vscode/releases)
219 |
220 | ## Acknowledgments
221 |
222 | Thanks [@melpon](https://github.com/melpon)( 🐕 dog) and [@kikairoya](https://github.com/kikairoya)( 🐂 bull) for awesome compilation service!
223 |
224 | Thanks [@fetus-hina](https://github.com/fetus-hina)( 👶 baby) for a PHP specialized wandbox service!
225 |
226 | Thanks [@rhysd](https://github.com/rhysd)( 🐕 dog) for your support in TypeScript!
227 |
228 | Thanks [@chomado](https://github.com/chomado)( 👧 girl) for a great extension icon!
229 |
230 | ## link
231 |
232 | [Wandbox related projects](https://github.com/search?p=1&q=wandbox&type=Repositories&utf8=✓)
233 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-cayman
--------------------------------------------------------------------------------
/hellos/hello.c:
--------------------------------------------------------------------------------
1 | // This file is a "Hello, world!" in C language for wandbox-vscode.
2 | #include
3 | #include
4 |
5 | int main(void)
6 | {
7 | puts("Hello, Wandbox!");
8 | return EXIT_SUCCESS;
9 | }
10 |
11 | // C language references:
12 | // https://msdn.microsoft.com/library/fw5abdx6.aspx
13 | // https://www.gnu.org/software/gnu-c-manual/
14 |
--------------------------------------------------------------------------------
/hellos/hello.coffee:
--------------------------------------------------------------------------------
1 | # This file is a "Hello, world!" in CoffeeScript for wandbox-vscode.
2 | console.log "Hello, Wandbox!"
3 |
4 | # CoffeeScript reference
5 | # http://coffeescript.org
6 |
--------------------------------------------------------------------------------
/hellos/hello.cpp:
--------------------------------------------------------------------------------
1 | // This file is a "Hello, world!" in C++ language for wandbox-vscode.
2 | #include
3 | #include
4 |
5 | int main()
6 | {
7 | std::cout << "Hello, Wandbox!" << std::endl;
8 | return EXIT_SUCCESS;
9 | }
10 |
11 | // C++ language references:
12 | // https://msdn.microsoft.com/library/3bstk3k5.aspx
13 | // http://www.cplusplus.com/
14 | // https://isocpp.org/
15 | // http://www.open-std.org/jtc1/sc22/wg21/
16 |
17 | // Boost libraries references:
18 | // http://www.boost.org/doc/
19 |
--------------------------------------------------------------------------------
/hellos/hello.cr:
--------------------------------------------------------------------------------
1 | # This file is a "Hello, world!" in Crystal language for wandbox-vscode.
2 |
3 | puts "Hello, Wandbox!"
4 |
5 | # Crystal language references:
6 | # - https://crystal-lang.org/
7 | # - http://ja.crystal-lang.org/
8 |
--------------------------------------------------------------------------------
/hellos/hello.cs:
--------------------------------------------------------------------------------
1 | // This file is a "Hello, world!" in C# language for wandbox-vscode.
2 | using System;
3 |
4 | namespace Wandbox
5 | {
6 | class VSCode
7 | {
8 | static void Main()
9 | {
10 | Console.WriteLine("Hello, Wandbox!");
11 | }
12 | }
13 | }
14 |
15 | // C# language references:
16 | // https://msdn.microsoft.com/library/618ayhy6.aspx
17 |
--------------------------------------------------------------------------------
/hellos/hello.cxx:
--------------------------------------------------------------------------------
1 | // This file is a "Hello, world!" in C++ language for wandbox-vscode.
2 | #include
3 | #include
4 |
5 | int main()
6 | {
7 | std::cout << "Hello, Wandbox!" << std::endl;
8 | return EXIT_SUCCESS;
9 | }
10 |
11 | // C++ language references:
12 | // https://msdn.microsoft.com/library/3bstk3k5.aspx
13 | // http://www.cplusplus.com/
14 | // https://isocpp.org/
15 | // http://www.open-std.org/jtc1/sc22/wg21/
16 |
17 | // Boost libraries references:
18 | // http://www.boost.org/doc/
19 |
--------------------------------------------------------------------------------
/hellos/hello.d:
--------------------------------------------------------------------------------
1 | #!/usr/bin/rdmd
2 | // This file is a "Hello, world!" in D language for wandbox-vscode.
3 | import std.stdio;
4 |
5 | void main()
6 | {
7 | writeln("Hello, Wandbox!");
8 | }
9 |
10 | // D language references:
11 | // https://dlang.org
12 | // http://www.kmonos.net/alang/d/ ( Japanese )
13 |
--------------------------------------------------------------------------------
/hellos/hello.erl:
--------------------------------------------------------------------------------
1 |
2 | % This file is a "Hello, world!" in CoffeeScript for wandbox-vscode.
3 |
4 | main(_) ->
5 | io:format("Hello, Wandbox!~n").
6 |
7 | % Erlang Reference
8 | % http://erlang.org/doc/reference_manual/users_guide.html
9 |
--------------------------------------------------------------------------------
/hellos/hello.ex:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env elixir
2 | # This file is a "Hello, world!" in Elixir language for wandbox-vscode.
3 | defmodule Wandbox do
4 |
5 | def vscode do
6 | IO.puts "Hello, Wandbox!"
7 | end
8 | end
9 |
10 | Wandbox.vscode
11 |
12 | # Elixir language references:
13 | # http://elixir-lang.org
14 |
--------------------------------------------------------------------------------
/hellos/hello.exs:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env elixir
2 | # This file is a "Hello, world!" in Elixir language for wandbox-vscode.
3 | defmodule Wandbox do
4 |
5 | def vscode do
6 | IO.puts "Hello, Wandbox!"
7 | end
8 | end
9 |
10 | Wandbox.vscode
11 |
12 | # Elixir language references:
13 | # http://elixir-lang.org
14 |
--------------------------------------------------------------------------------
/hellos/hello.go:
--------------------------------------------------------------------------------
1 | // This file is a "Hello, world!" in Go language for wandbox-vscode.
2 | package main
3 |
4 | import (
5 | "fmt"
6 | )
7 |
8 | func main() {
9 | fmt.Println("Hello, Wandbox!")
10 | }
11 |
12 | // Go language references:
13 | // https://golang.org/pkg/
14 |
--------------------------------------------------------------------------------
/hellos/hello.groovy:
--------------------------------------------------------------------------------
1 | // This file is a "Hello, world!" in Groovy language for wandbox-vscode.
2 |
3 | println "Hello Wandbox!"
4 |
5 | // Groovy language references:
6 | // http://groovy-lang.org/
7 |
--------------------------------------------------------------------------------
/hellos/hello.gvy:
--------------------------------------------------------------------------------
1 | // This file is a "Hello, world!" in Groovy language for wandbox-vscode.
2 |
3 | println "Hello Wandbox!"
4 |
5 | // Groovy language references:
6 | // http://groovy-lang.org/
7 |
--------------------------------------------------------------------------------
/hellos/hello.hs:
--------------------------------------------------------------------------------
1 | -- This file is a "Hello, world!" in Haskell language for wandbox-vscode.
2 |
3 | main = putStrLn "Hello, Wandbox!"
4 |
5 | -- Haskell language references:
6 | -- https://www.haskell.org/
7 | -- https://wiki.haskell.org/
8 |
--------------------------------------------------------------------------------
/hellos/hello.java:
--------------------------------------------------------------------------------
1 | // This file is a "Hello, world!" in Java language for wandbox-vscode.
2 |
3 | class WandboxVSCode
4 | {
5 | public static void main(String[] args)
6 | {
7 | System.out.println("Hello, Wandbox!");
8 | }
9 | }
10 |
11 | // Java language references:
12 | // http://docs.oracle.com/javase
13 |
--------------------------------------------------------------------------------
/hellos/hello.js:
--------------------------------------------------------------------------------
1 | // This file is a "Hello, world!" in JavaScript for wandbox-vscode.
2 |
3 | console.log("Hello, Wandbox!");
4 |
5 | // JavaScript references:
6 | // https://developer.mozilla.org/docs/Web/JavaScript
7 | // https://msdn.microsoft.com/library/d1et7k7c(v=vs.94).aspx
8 |
--------------------------------------------------------------------------------
/hellos/hello.lazy:
--------------------------------------------------------------------------------
1 | # This file is a "Hello, world!" in Lazy K language for wandbox-vscode.
2 |
3 | `k````s``s`ks``s`kk``s`ks``s`k`sik`kk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk`ki````s``s`ks``s`kk``s`ks``s`k`sik`kk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk`ki````s``s`ks``s`kk``s`ks``s`k`sik`kk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk`ki````s``s`ks``s`kk``s`ks``s`k`sik`kk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk`ki````s``s`ks``s`kk``s`ks``s`k`sik`kk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk`ki````s``s`ks``s`kk``s`ks``s`k`sik`kk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk`ki````s``s`ks``s`kk``s`ks``s`k`sik`kk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk`ki````s``s`ks``s`kk``s`ks``s`k`sik`kk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk`ki````s``s`ks``s`kk``s`ks``s`k`sik`kk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk`ki````s``s`ks``s`kk``s`ks``s`k`sik`kk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk`ki````s``s`ks``s`kk``s`ks``s`k`sik`kk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk`ki````s``s`ks``s`kk``s`ks``s`k`sik`kk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk`ki````s``s`ks``s`kk``s`ks``s`k`sik`kk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk`ki````s``s`ks``s`kk``s`ks``s`k`sik`kk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk`ki````s``s`ks``s`kk``s`ks``s`k`sik`kk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk`ki````s``s`ks``s`kk``s`ks``s`k`sik`kk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk``s``s`ksk`ki````ssk``s`k``ss`s``sskk```s``s`ks``s`kk``s`ks``s`k`sik`kk```sii```sii``s``s`kski
4 |
5 | # Lazy K language references:
6 | # https://tromp.github.io/cl/lazy-k.html
7 |
8 | # Echo encoder
9 | # https://github.com/susisu/js-sandbox/blob/master/lazy-k/encoder.js
10 | # Transpiler
11 | # https://github.com/susisu/js-sandbox/blob/master/lazy-k/transpiler.js
12 |
--------------------------------------------------------------------------------
/hellos/hello.lisp:
--------------------------------------------------------------------------------
1 | ; This file is a "Hello, world!" in Lisp language for wandbox-vscode.
2 |
3 | (prin1 "Hello, Wandbox!")
4 |
5 | ; Lisp language references:
6 | ; https://www.cs.cmu.edu/Groups/AI/html/cltl/cltl2.html
7 | ; https://www.gnu.org/software/emacs/manual/elisp.html
8 |
--------------------------------------------------------------------------------
/hellos/hello.lua:
--------------------------------------------------------------------------------
1 | -- This file is a "Hello, world!" in Lua language for wandbox-vscode.
2 |
3 | print "Hello, Wandbox!"
4 |
5 | -- Lua language references:
6 | -- https://www.lua.org/
7 |
--------------------------------------------------------------------------------
/hellos/hello.ml:
--------------------------------------------------------------------------------
1 | (* This file is a "Hello, world!" in OCaml language for wandbox-vscode. *)
2 |
3 | print_endline "Hello, Wandbox!"
4 |
5 | (* OCaml language references:
6 | https://ocaml.org/
7 | *)
8 |
--------------------------------------------------------------------------------
/hellos/hello.nim:
--------------------------------------------------------------------------------
1 | # This file is a "Hello, world!" in Nim language for wandbox-vscode.
2 |
3 | echo "Hello, Wandbox!"
4 |
5 | # Nim language references:
6 | # https://nim-lang.org/
7 | # https://nim-lang.org/docs/manual.html
--------------------------------------------------------------------------------
/hellos/hello.pas:
--------------------------------------------------------------------------------
1 | // This file is a "Hello, world!" in Pascal language for wandbox-vscode.
2 |
3 | program Hello(output);
4 | begin
5 | writeln('Hello, Wandbox!')
6 | end.
7 |
8 | // Pascal language references:
9 | // http://www.freepascal.org/
10 | // http://www.gnu-pascal.de/gpc/
11 |
--------------------------------------------------------------------------------
/hellos/hello.php:
--------------------------------------------------------------------------------
1 |
5 | env.out.print("Hello, Wandbox!")
6 |
7 | // Pony language references:
8 | // http://www.ponylang.org/
--------------------------------------------------------------------------------
/hellos/hello.py:
--------------------------------------------------------------------------------
1 | # This file is a "Hello, world!" in Python language for wandbox-vscode.
2 |
3 | print("Hello, world!")
4 |
5 | # Python language references:
6 | # https://www.python.org
7 |
--------------------------------------------------------------------------------
/hellos/hello.rb:
--------------------------------------------------------------------------------
1 | # This file is a "Hello, world!" in Ruby language for wandbox-vscode.
2 |
3 | puts "Hello, Wandbox!"
4 |
5 | # Ruby language references:
6 | # https://docs.ruby-lang.org/
7 |
--------------------------------------------------------------------------------
/hellos/hello.rill:
--------------------------------------------------------------------------------
1 | // This file is a "Hello, world!" in Rill language for wandbox-vscode.
2 | import std.stdio;
3 |
4 | def main() {
5 | "Hello, Wandbox!".print();
6 | }
7 |
8 | // Rill language references:
9 | // https://github.com/yutopp/rill
10 |
--------------------------------------------------------------------------------
/hellos/hello.rs:
--------------------------------------------------------------------------------
1 | // This file is a "Hello, world!" in Rust language for wandbox-vscode.
2 |
3 | fn main()
4 | {
5 | println!("Hello, Wandbox!");
6 | }
7 |
8 | // Rust language references:
9 | // https://www.rust-lang.org/
10 |
--------------------------------------------------------------------------------
/hellos/hello.scala:
--------------------------------------------------------------------------------
1 | // This file is a "Hello, world!" in Scala language for wandbox-vscode.
2 |
3 | object WandboxVSCode
4 | {
5 | def main(args: Array[String])
6 | {
7 | println("Hello, Wandbox!")
8 | }
9 | }
10 |
11 | // Scala language references:
12 | // http://www.scala-lang.org
13 |
--------------------------------------------------------------------------------
/hellos/hello.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # This file is a "Hello, world!" in Bash script for wandbox-vscode.
3 | echo Hello, Wandbox!
4 |
5 | # Bash script reference
6 | # https://www.gnu.org/software/bash/manual/bashref.html
7 | # http://shellscript.sunone.me ( Japanese )
8 |
--------------------------------------------------------------------------------
/hellos/hello.sql:
--------------------------------------------------------------------------------
1 | -- This file is a "Hello, world!" in SQL for wandbox-vscode.
2 |
3 | SELECT 'Hello, Wandbox!';
4 |
5 | -- SQL references:
6 | -- https://www.mysql.com
7 | -- https://msdn.microsoft.com/library/dn198336.aspx
--------------------------------------------------------------------------------
/hellos/hello.swift:
--------------------------------------------------------------------------------
1 | // This file is a "Hello, world!" in Apple Swift language for wandbox-vscode.
2 |
3 | print("Hello, Wandbox!");
4 |
5 | // Apple Swift language references:
6 | // http://www.apple.com/swift/
7 |
--------------------------------------------------------------------------------
/hellos/hello.vim:
--------------------------------------------------------------------------------
1 | " This file is a "Hello, world!" in Vim script language for wandbox-vscode.
2 |
3 | echo "Hello, Wandbox!"
4 |
5 | " Vim script language references:
6 | " http://www.vim.org
7 | " http://vim-jp.org/vimdoc-ja/ ( Japanese )
8 |
--------------------------------------------------------------------------------
/images/wandhex.1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wraith13/wandbox-vscode/3ff2a2e17241c9dad4e4ed3e9dc3970571dab725/images/wandhex.1024.png
--------------------------------------------------------------------------------
/images/wandhex.128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wraith13/wandbox-vscode/3ff2a2e17241c9dad4e4ed3e9dc3970571dab725/images/wandhex.128.png
--------------------------------------------------------------------------------
/images/wandhex.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wraith13/wandbox-vscode/3ff2a2e17241c9dad4e4ed3e9dc3970571dab725/images/wandhex.ico
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "wandbox-vscode",
3 | "displayName": "wandbox-vscode",
4 | "description": "Wandbox(compile & run & share service) client for VSCode. Available languages: Bash script, C, C#, C++, CoffeeScript, CPP, Crystal, D, Elixir, Erlang, Go, Groovy, Haskell, Java, JavaScript, Lazy K, Lisp, Lua, Nim, OCaml, Pascal, Perl, PHP, Pony, Python, Rill, Ruby, Rust, Scala, SQL, Apple Swift, Vim script",
5 | "icon": "images/wandhex.128.png",
6 | "version": "3.0.1",
7 | "publisher": "wraith13",
8 | "license": "SEE LICENSE IN LICENSE_1_0.txt",
9 | "engines": {
10 | "vscode": "^1.61.0"
11 | },
12 | "galleryBanner": {
13 | "color": "#d6e685",
14 | "theme": "light"
15 | },
16 | "bugs": {
17 | "url": "https://github.com/wraith13/wandbox-vscode/issues"
18 | },
19 | "homepage": "https://github.com/wraith13/wandbox-vscode/blob/master/README.md",
20 | "repository": {
21 | "type": "git",
22 | "url": "https://github.com/wraith13/wandbox-vscode.git"
23 | },
24 | "categories": [
25 | "Other"
26 | ],
27 | "keywords": [
28 | "wandbox",
29 | "compile",
30 | "run",
31 | "share"
32 | ],
33 | "activationEvents": [
34 | "onCommand:extension.invokeWandbox",
35 | "onCommand:extension.shareWandbox",
36 | "onCommand:extension.helloWandbox",
37 | "onCommand:extension.showWandboxListJson",
38 | "onCommand:extension.showWandboxWeb",
39 | "onCommand:extension.showWandboxSettings",
40 | "onCommand:extension.showHistory",
41 | "onCommand:extension.clearHistory",
42 | "onCommand:extension.setWandboxFileServer",
43 | "onCommand:extension.setWandboxFileCompiler",
44 | "onCommand:extension.setWandboxFileOptions",
45 | "onCommand:extension.setWandboxFileSettingJson",
46 | "onCommand:extension.resetWandboxFileSettings",
47 | "onCommand:wandbox.run",
48 | "onCommand:wandbox.share",
49 | "onCommand:wandbox.new",
50 | "onCommand:wandbox.hello",
51 | "onCommand:wandbox.showListJson",
52 | "onCommand:wandbox.showWeb",
53 | "onCommand:wandbox.showSettings",
54 | "onCommand:wandbox.showHistory",
55 | "onCommand:wandbox.clearHistory",
56 | "onCommand:wandbox.setFileServer",
57 | "onCommand:wandbox.setFileCompiler",
58 | "onCommand:wandbox.setFileOptions",
59 | "onCommand:wandbox.setFileSettingJson",
60 | "onCommand:wandbox.resetFileSettings"
61 | ],
62 | "main": "./out/source/extension",
63 | "contributes": {
64 | "configuration": {
65 | "title": "Wandbox configuration",
66 | "properties": {
67 | "wandbox.Servers": {
68 | "type": "array",
69 | "default": [
70 | "https://wandbox.org/",
71 | "https://wandbox.fetus.jp/"
72 | ],
73 | "description": "wandbox server url list ( first one is default wandbox server url )"
74 | },
75 | "wandbox.simplifyPostData": {
76 | "type": "boolean",
77 | "default": true,
78 | "description": "simplify post data when showing"
79 | },
80 | "wandbox.autoOpenShareUrl": {
81 | "type": "boolean",
82 | "default": true,
83 | "description": "when make a share url, auto open it"
84 | },
85 | "wandbox.outputChannelName": {
86 | "type": "string",
87 | "default": "Wandbox",
88 | "description": "output channel name"
89 | },
90 | "wandbox.languageMapping": {
91 | "type": "object",
92 | "default": {
93 | "bat": null,
94 | "clojure": null,
95 | "coffeescript": "CoffeeScript",
96 | "c": "C",
97 | "cpp": "C++",
98 | "crystal": "Crystal",
99 | "csharp": "C#",
100 | "css": null,
101 | "diff": null,
102 | "dockerfile": null,
103 | "fsharp": null,
104 | "git-commit": null,
105 | "git-rebase": null,
106 | "go": "Go",
107 | "groovy": "Groovy",
108 | "handlebars": null,
109 | "html": null,
110 | "ini": null,
111 | "java": "Java",
112 | "javascript": "JavaScript",
113 | "json": null,
114 | "less": null,
115 | "lua": "Lua",
116 | "makefile": null,
117 | "markdown": null,
118 | "nim": null,
119 | "objective-c": null,
120 | "perl": "Perl",
121 | "perl6": null,
122 | "php": "PHP",
123 | "powershell": null,
124 | "jade": null,
125 | "pony": "Pony",
126 | "python": "Python",
127 | "r": null,
128 | "razor": null,
129 | "ruby": "Ruby",
130 | "rust": "Rust",
131 | "scss": null,
132 | "sass": null,
133 | "shaderlab": null,
134 | "shellscript": "Bash script",
135 | "sql": "SQL",
136 | "swift": "Swift",
137 | "typescript": null,
138 | "vb": null,
139 | "xml": null,
140 | "xsl": null,
141 | "yaml": null
142 | },
143 | "description": "set language in wandbox by language in vscode"
144 | },
145 | "wandbox.languageCompilerMapping": {
146 | "type": "object",
147 | "default": {
148 | "C": null,
149 | "CoffeeScript": null,
150 | "Crystal": null,
151 | "C++": null,
152 | "C#": null,
153 | "D": null,
154 | "Erlang": null,
155 | "Elixir": null,
156 | "Go": null,
157 | "Groovy": null,
158 | "Haskell": null,
159 | "Java": null,
160 | "JavaScript": null,
161 | "Lazy K": null,
162 | "Lisp": null,
163 | "Lua": null,
164 | "Nim": null,
165 | "OCaml": null,
166 | "Pascal": null,
167 | "PHP": null,
168 | "Perl": null,
169 | "Pony": null,
170 | "Python": null,
171 | "Ruby": null,
172 | "Rill": null,
173 | "Rust": null,
174 | "Scala": null,
175 | "Bash script": null,
176 | "SQL": null,
177 | "Swift": null,
178 | "Vim script": null
179 | },
180 | "description": "set compiler by language"
181 | },
182 | "wandbox.extensionCompilerMapping": {
183 | "type": "object",
184 | "default": {
185 | "c": null,
186 | "coffee": null,
187 | "cpp": null,
188 | "cr": null,
189 | "cs": null,
190 | "cxx": null,
191 | "d": null,
192 | "erl": null,
193 | "ex": null,
194 | "exs": null,
195 | "go": null,
196 | "groovy": null,
197 | "gvy": null,
198 | "hs": null,
199 | "java": null,
200 | "js": null,
201 | "lazy": null,
202 | "lisp": null,
203 | "lua": null,
204 | "ml": null,
205 | "nim": null,
206 | "pas": null,
207 | "php": null,
208 | "pl": null,
209 | "pony": null,
210 | "py": null,
211 | "rb": null,
212 | "rill": null,
213 | "rs": null,
214 | "scala": null,
215 | "sh": null,
216 | "sql": null,
217 | "swift": null,
218 | "vim": null
219 | },
220 | "description": "set compiler by file extension"
221 | },
222 | "wandbox.extensionLanguageMapping": {
223 | "type": "object",
224 | "default": {
225 | "c": "C",
226 | "coffee": "CoffeeScript",
227 | "cpp": "C++",
228 | "cr": "Crystal",
229 | "cs": "C#",
230 | "cxx": "C++",
231 | "d": "D",
232 | "erl": "Erlang",
233 | "ex": "Elixir",
234 | "exs": "Elixir",
235 | "go": "Go",
236 | "groovy": "Groovy",
237 | "gvy": "Groovy",
238 | "hs": "Haskell",
239 | "java": "Java",
240 | "js": "JavaScript",
241 | "lazy": "Lazy K",
242 | "lisp": "Lisp",
243 | "lua": "Lua",
244 | "ml": "OCaml",
245 | "nim": "Nim",
246 | "pas": "Pascal",
247 | "php": "PHP",
248 | "pl": "Perl",
249 | "pony": "Pony",
250 | "py": "Python",
251 | "rb": "Ruby",
252 | "rill": "Rill",
253 | "rs": "Rust",
254 | "scala": "Scala",
255 | "sh": "Bash script",
256 | "sql": "SQL",
257 | "swift": "Swift",
258 | "vim": "Vim script"
259 | },
260 | "description": "set compiler by file extension"
261 | },
262 | "wandbox.options": {
263 | "type": "object",
264 | "default": {
265 | "compiler(example)": "option1,option2"
266 | },
267 | "description": "set options by compiler"
268 | },
269 | "wandbox.compilerOptionRaw": {
270 | "type": "object",
271 | "default": {
272 | "compiler(example)": "raw compile option text"
273 | },
274 | "description": "set raw option by compiler"
275 | },
276 | "wandbox.runtimeOptionRaw": {
277 | "type": "object",
278 | "default": {
279 | "compiler(example)": "raw runtime option text"
280 | },
281 | "description": "set raw runtime option by compiler"
282 | },
283 | "wandbox.helloWolrdFiles": {
284 | "type": "array",
285 | "default": [],
286 | "description": "set hello world files"
287 | },
288 | "wandbox.emoji": {
289 | "type": "object",
290 | "default": {
291 | "stamp": "🐾",
292 | "error": "🚫",
293 | "warning": "⚠️",
294 | "hint": "👉",
295 | "signal": "🚦",
296 | "link": "🔗",
297 | "lap": "🏁",
298 | "new": "✨️",
299 | "checkedBox": "☑️",
300 | "uncheckedBox": "⬜️",
301 | "checkedRadio": "🔘",
302 | "uncheckedRadio": "⚪️",
303 | "edit": "✒️",
304 | "menuSeparator": "─────────────────────────────────────────────"
305 | },
306 | "description": "set emoji"
307 | },
308 | "wandbox.maxHistorySize": {
309 | "type": "integer",
310 | "default": 256,
311 | "description": "set max share history size"
312 | }
313 | }
314 | },
315 | "commands": [
316 | {
317 | "command": "wandbox.run",
318 | "title": "Run",
319 | "category": "Wandbox"
320 | },
321 | {
322 | "command": "wandbox.share",
323 | "title": "Share",
324 | "category": "Wandbox"
325 | },
326 | {
327 | "command": "wandbox.new",
328 | "title": "New",
329 | "category": "Wandbox"
330 | },
331 | {
332 | "command": "wandbox.hello",
333 | "title": "Hello",
334 | "category": "Wandbox"
335 | },
336 | {
337 | "command": "wandbox.showListJson",
338 | "title": "Show Raw JSON",
339 | "category": "Wandbox"
340 | },
341 | {
342 | "command": "wandbox.showWeb",
343 | "title": "Show Web Site",
344 | "category": "Wandbox"
345 | },
346 | {
347 | "command": "wandbox.showSettings",
348 | "title": "Show Settings",
349 | "category": "Wandbox"
350 | },
351 | {
352 | "command": "wandbox.showHistory",
353 | "title": "Show History",
354 | "category": "Wandbox"
355 | },
356 | {
357 | "command": "wandbox.clearHistory",
358 | "title": "Clear History",
359 | "category": "Wandbox"
360 | },
361 | {
362 | "command": "wandbox.setFileServer",
363 | "title": "Set Server",
364 | "category": "Wandbox"
365 | },
366 | {
367 | "command": "wandbox.setFileCompiler",
368 | "title": "Set Compiler",
369 | "category": "Wandbox"
370 | },
371 | {
372 | "command": "wandbox.setFileOptions",
373 | "title": "Set Options",
374 | "category": "Wandbox"
375 | },
376 | {
377 | "command": "wandbox.setFileSettingJson",
378 | "title": "Set Settings JSON",
379 | "category": "Wandbox"
380 | },
381 | {
382 | "command": "wandbox.resetFileSettings",
383 | "title": "Reset Settings",
384 | "category": "Wandbox"
385 | }
386 | ]
387 | },
388 | "scripts": {
389 | "vscode:prepublish": "tsc -p ./",
390 | "compile": "tsc -watch -p ./",
391 | "lint": "eslint source --ext ts"
392 | },
393 | "devDependencies": {
394 | "@types/node": "^8.10.25",
395 | "@types/request": "^2.48.3",
396 | "@types/vscode": "^1.61.0",
397 | "@typescript-eslint/eslint-plugin": "^4.31.1",
398 | "@typescript-eslint/parser": "^4.31.1",
399 | "eslint": "^7.32.0",
400 | "typescript": "^4.4.3"
401 | }
402 | }
403 |
--------------------------------------------------------------------------------
/source/extension.ts:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | // The module 'vscode' contains the VS Code extensibility API
3 | // Import the module and reference it with the alias vscode in your code below
4 | import * as vscode from 'vscode';
5 | import * as https from 'https';
6 | import { IncomingMessage } from 'http';
7 | import * as fs from 'fs';
8 |
9 | module rx
10 | {
11 | export const get = (url: string): Thenable<{ error: any, response: IncomingMessage, body: string }> => new Promise
12 | (
13 | resolve => https.get
14 | (
15 | url,
16 | response =>
17 | {
18 | let body = "";
19 | response.setEncoding("UTF-8");
20 | response.on("data", chunk => body += chunk);
21 | response.on("end", () => resolve({ error:undefined, response, body}));
22 | }
23 | )
24 | );
25 | export const execute = (options : https.RequestOptions, data?: string | Buffer | Uint8Array)
26 | : Thenable<{ error : any, response : IncomingMessage, body : string}> => new Promise
27 | (
28 | resolve =>
29 | {
30 | const request = https.request
31 | (
32 | options,
33 | response =>
34 | {
35 | let body = "";
36 | response.setEncoding("UTF-8");
37 | response.on("data", chunk => body += chunk);
38 | response.on("end", () => resolve({ error:undefined, response, body}));
39 | }
40 | );
41 | if (data)
42 | {
43 | request.write(data);
44 | }
45 | request.end();
46 | }
47 | );
48 | }
49 |
50 | module fx
51 | {
52 | export const readdir = (path : string)
53 | : Thenable<{ error : NodeJS.ErrnoException, files : string[] }> => new Promise
54 | (
55 | resolve => fs.readdir
56 | (
57 | path,
58 | (error : NodeJS.ErrnoException, files : string[]) => resolve
59 | (
60 | {
61 | error,
62 | files
63 | }
64 | )
65 | )
66 | );
67 |
68 | export const exists = (path : string) : Thenable => new Promise
69 | (
70 | resolve => fs.exists
71 | (
72 | path,
73 | exists => resolve(exists)
74 | )
75 | );
76 |
77 | export const readFile = (path : string)
78 | : Thenable<{ err : NodeJS.ErrnoException, data : Buffer }> =>new Promise
79 | (
80 | resolve => fs.readFile
81 | (
82 | path,
83 | (err : NodeJS.ErrnoException, data : Buffer) => resolve({ err, data })
84 | )
85 | );
86 | }
87 |
88 | module WandboxVSCode
89 | {
90 | const extentionName = "wandbox-vscode";
91 | let context: vscode.ExtensionContext;
92 | const fileSetting = { };
93 |
94 | const stripDirectory = (path : string) : string =>path
95 | .split('\\').reverse()[0]
96 | .split('/').reverse()[0];
97 |
98 | const getConfiguration = (key ?: string) : type =>
99 | {
100 | const configuration = vscode.workspace.getConfiguration("wandbox");
101 | return key ?
102 | configuration[key]:
103 | configuration;
104 | };
105 | const openNewTextDocument = async (language : string) : Promise =>
106 | await vscode.workspace.openTextDocument({ language });
107 |
108 | const openNewCodeDocument = async (language : string, compiler : string, code : string) : Promise =>
109 | {
110 | const languageMapping = getConfiguration("languageMapping");
111 | const vscodeLang =
112 | (
113 | Object
114 | .keys(languageMapping)
115 | .map
116 | (
117 | vscodeLang =>
118 | ({
119 | vscodeLang,
120 | language:languageMapping[vscodeLang]
121 | })
122 | )
123 | .find(i => i.language === language) ||
124 | { vscodeLang:null }
125 | )
126 | .vscodeLang || "";
127 | console.log("vscodeLang:" +vscodeLang);
128 | const document = await openNewTextDocument(vscodeLang);
129 | const textEditor = await vscode.window.showTextDocument(document);
130 | textEditor.edit
131 | (
132 | (editBuilder: vscode.TextEditorEdit) =>
133 | {
134 | editBuilder.insert(new vscode.Position(0,0), code);
135 | }
136 | );
137 | const fileName = document.fileName;
138 | if (compiler)
139 | {
140 | fileSetting[fileName] = fileSetting[fileName] || {};
141 | fileSetting[fileName]['compiler'] = compiler;
142 | }
143 | };
144 |
145 | class HistoryEntry
146 | {
147 | public timestamp : Date;
148 | public language : string;
149 | public compiler : string;
150 | public shareUrl : string;
151 | }
152 |
153 | const getHistory = async () : Promise =>
154 | await context.globalState.get("history", []);
155 | const updateHistory = async (history : HistoryEntry[]) : Promise =>
156 | await context.globalState.update("history", history);
157 |
158 | const emoji = (key : string) : string =>
159 | {
160 | let result : string = getConfiguration("emoji")[key];
161 | if (result)
162 | {
163 | result += " ";
164 | }
165 | else
166 | {
167 | result = "";
168 | }
169 | return result;
170 | };
171 |
172 | module OutputChannel
173 | {
174 | let outputChannel :vscode.OutputChannel;
175 |
176 | export const makeSure = () :vscode.OutputChannel =>
177 | {
178 | if (!outputChannel)
179 | {
180 | outputChannel = vscode.window.createOutputChannel
181 | (
182 | getConfiguration("outputChannelName")
183 | );
184 | }
185 | else
186 | {
187 | appendLine('');
188 | }
189 | return outputChannel;
190 | };
191 |
192 | export const bowWow = () : void =>
193 | {
194 | show();
195 | appendLine(`${emoji("stamp")}Bow-wow! ${new Date().toString()}`);
196 | };
197 |
198 | export const show = () : void =>
199 | outputChannel.show(true);
200 | export const appendLine = (value : string) : void =>
201 | outputChannel.appendLine(value);
202 |
203 | export const appendJson = (value : any) : void =>
204 | OutputChannel.appendLine(JSON.stringify(value, null, 4));
205 |
206 | export const canceled = () : void =>
207 | appendLine(`Canceled`);
208 | }
209 |
210 | module WandboxServer
211 | {
212 | export const getServer = () : string =>
213 | {
214 | let result : string;
215 | const setting = fileSetting[WorkSpace.getCurrentFilename()];
216 | if (setting)
217 | {
218 | result = setting.server;
219 | }
220 | if (!result)
221 | {
222 | result = getConfiguration("Servers")[0];
223 | }
224 | return result;
225 | };
226 |
227 | const getUrl = () :string =>
228 | {
229 | let result : string = getServer();
230 | if (result.endsWith("/"))
231 | {
232 | result = result.substr(0, result.length -1);
233 | }
234 | return result;
235 | };
236 |
237 | export const getWebUrl = () :string =>
238 | getUrl() +`/?from=${extentionName}`;
239 |
240 | export const getList = async () : Promise => new Promise
241 | (
242 | async (resolve, reject) =>
243 | {
244 | const requestUrl = getUrl() +`/api/list.json?from=${extentionName}`;
245 | OutputChannel.appendLine(`HTTP GET ${requestUrl}`);
246 | const { error, response, body } = await rx.get
247 | (
248 | requestUrl,
249 | );
250 | OutputChannel.appendLine(`statusCode: ${response.statusCode}`);
251 | if (error)
252 | {
253 | OutputChannel.appendLine(`${emoji("error")}error: ${error}`);
254 | reject(error);
255 | }
256 | else
257 | if (response.statusCode === 200)
258 | {
259 | resolve(list[getUrl()] = JSON.parse(body));
260 | }
261 | }
262 | );
263 |
264 | const list : {[name : string] : any[] } = { };
265 |
266 | export const makeSureList = () : Promise => new Promise
267 | (
268 | async (resolve) =>
269 | {
270 | const key = getUrl();
271 | if (!list[key])
272 | {
273 | await getList();
274 | }
275 | resolve(list[key]);
276 | }
277 | );
278 |
279 | export const getTemplate = async (templateName : string) : Promise => new Promise
280 | (
281 | async (resolve, reject) =>
282 | {
283 | const requestUrl = getUrl() +`/api/template/${templateName}`;
284 | OutputChannel.appendLine(`HTTP GET ${requestUrl}`);
285 | const { error, response, body } = await rx.get
286 | (
287 | requestUrl,
288 | );
289 | OutputChannel.appendLine(`statusCode: ${response.statusCode}`);
290 | if (error)
291 | {
292 | OutputChannel.appendLine(`${emoji("error")}error: ${error}`);
293 | reject(error);
294 | }
295 | else
296 | if (response.statusCode === 200)
297 | {
298 | resolve(templates[templateName] = JSON.parse(body));
299 | }
300 | }
301 | );
302 |
303 | const templates : {[name : string] : any[] } = { };
304 |
305 | export const makeSureTempate = (templateName : string) : Promise => new Promise
306 | (
307 | async (resolve) =>
308 | {
309 | if (!templates[templateName])
310 | {
311 | await getTemplate(templateName);
312 | }
313 | resolve(templates[templateName]);
314 | }
315 | );
316 |
317 | const buildCompileJson = (json : { }) : { } =>
318 | {
319 | const document : vscode.TextDocument = json['code'];
320 | let additionals : string[];
321 | const setting = fileSetting[document.fileName];
322 | if (setting)
323 | {
324 | additionals = setting['codes'];
325 | }
326 | const simplifyPostData = getConfiguration("simplifyPostData");
327 | if (simplifyPostData)
328 | {
329 | // 簡素化
330 | json['code'] = document.fileName;
331 | if (additionals)
332 | {
333 | json['codes'] = additionals.map(i => `'${i}' as '${stripDirectory(i)}'`).join(',');
334 | }
335 |
336 | OutputChannel.appendJson(json);
337 | }
338 | if (additionals)
339 | {
340 | json['codes'] = additionals.map
341 | (
342 | filename =>
343 | ({
344 | 'file': stripDirectory(filename),
345 | 'code': vscode.workspace.textDocuments
346 | .find(document => filename === document.fileName)
347 | .getText()
348 | })
349 | );
350 | }
351 | if (json['stdin'])
352 | {
353 | json['stdin'] = vscode.workspace.textDocuments
354 | .find(document => json['stdin'] === document.fileName)
355 | .getText();
356 | }
357 | json['code'] = document.getText();
358 | json['from'] = extentionName;
359 | if (!simplifyPostData)
360 | {
361 | OutputChannel.appendJson(json);
362 | }
363 |
364 | return json;
365 | };
366 |
367 | const appendHistory = async (compiler : string, shareUrl : string) : Promise =>
368 | {
369 | const history = await getHistory();
370 | const maxHistorySize = Math.max(0, getConfiguration("maxHistorySize"));
371 | if (maxHistorySize || history.length)
372 | {
373 | history.push
374 | (
375 | {
376 | timestamp: new Date(),
377 | language: (await makeSureList()).find(i => i.name === compiler).language,
378 | compiler,
379 | shareUrl,
380 | }
381 | );
382 | while(maxHistorySize < history.length)
383 | {
384 | history.shift();
385 | }
386 | await updateHistory(history);
387 | }
388 | };
389 |
390 | export const compile = async (json : { }) : Promise =>
391 | {
392 | const requestUrl = getUrl() +`/api/compile.json`;
393 | OutputChannel.appendLine(`HTTP POST ${requestUrl}`);
394 |
395 | const startAt = new Date();
396 | const requestArgs =vscode.Uri.parse(requestUrl);
397 | const { error, response, body } = await rx.execute
398 | (
399 | {
400 | protocol: `${requestArgs.scheme}:`,
401 | host: requestArgs.authority,
402 | path: requestArgs.path,
403 | // query: requestArgs.query, 🔥
404 | method: 'POST',
405 | headers:
406 | {
407 | //'Content-Type': 'application/json',
408 | 'User-Agent': extentionName
409 | },
410 | },
411 | JSON.stringify(buildCompileJson(json))
412 | );
413 | const endAt = new Date();
414 | if (response.statusCode)
415 | {
416 | OutputChannel.appendLine(`HTTP statusCode: ${response.statusCode}`);
417 | }
418 | if (!error && response.statusCode === 200)
419 | {
420 | const result = JSON.parse(body);
421 | if (result.status)
422 | {
423 | OutputChannel.appendLine(`status: ${result.status}`);
424 | }
425 | if (result.signal)
426 | {
427 | OutputChannel.appendLine(`${emoji("signal")}signal: ${result.signal}`);
428 | }
429 | if (result.compiler_output)
430 | {
431 | OutputChannel.appendLine('compiler_output: ');
432 | OutputChannel.appendLine(result.compiler_output);
433 | }
434 | if (result.compiler_error)
435 | {
436 | OutputChannel.appendLine(`${emoji("error")}compiler_error: `);
437 | OutputChannel.appendLine(result.compiler_error);
438 | }
439 | //result.compiler_message
440 | //merged messages compiler_output and compiler_error
441 | if (result.program_output)
442 | {
443 | OutputChannel.appendLine('program_output: ');
444 | OutputChannel.appendLine(result.program_output);
445 | }
446 | if (result.program_error)
447 | {
448 | OutputChannel.appendLine(`${emoji("error")}program_error: `);
449 | OutputChannel.appendLine(result.program_error);
450 | }
451 | //result.program_message
452 | //merged messages program_output and program_error
453 | //result.permlink && outputChannel.appendLine(`${emoji("link")}permlink: ${result.permlink}`);
454 | if (result.url)
455 | {
456 | OutputChannel.appendLine(`${emoji("link")}url: ${result.url}`);
457 | if (getConfiguration("autoOpenShareUrl"))
458 | {
459 | vscode.commands.executeCommand
460 | (
461 | 'vscode.open',
462 | vscode.Uri.parse(result.url)
463 | );
464 | }
465 | await appendHistory(json['compiler'], result.url);
466 | }
467 |
468 | }
469 | else
470 | {
471 | if (body)
472 | {
473 | OutputChannel.appendLine(body);
474 | }
475 | if (error)
476 | {
477 | OutputChannel.appendLine(`${emoji("error")}error: ${error}`);
478 | }
479 | }
480 | OutputChannel.appendLine(`${emoji("lap")}time: ${(endAt.getTime() -startAt.getTime()) /1000} s`);
481 | };
482 | }
483 |
484 | module WorkSpace
485 | {
486 | export const IsOpenFiles = (files : string[]) : boolean =>
487 | {
488 | const notFoundFiles = files.filter
489 | (
490 | file => !vscode.workspace.textDocuments.find(document => file === document.fileName)
491 | );
492 | notFoundFiles.forEach
493 | (
494 | file => OutputChannel.appendLine
495 | (
496 | `${emoji("error")}Not found file: ${file} ( If opened, show this file once. And keep to open it.)`
497 | )
498 | );
499 | return notFoundFiles.length <= 0;
500 | };
501 |
502 | export const getActiveDocument = () :vscode.TextDocument =>
503 | {
504 | const activeTextEditor = vscode.window.activeTextEditor;
505 | if (null !== activeTextEditor && undefined !== activeTextEditor)
506 | {
507 | const document = activeTextEditor.document;
508 | if (null !== document && undefined !== document)
509 | {
510 | return document;
511 | }
512 | }
513 | return null;
514 | };
515 |
516 | export const getCurrentFilename = () : string =>
517 | {
518 | let result : string;
519 | const document = getActiveDocument();
520 | if (null !== document)
521 | {
522 | result = document.fileName;
523 | }
524 | if (!result)
525 | {
526 | result = "wandbox-vscode:default";
527 | }
528 | return result;
529 | };
530 |
531 | export const getTextFiles = () : string[] =>
532 | vscode.workspace.textDocuments
533 | .filter
534 | (
535 | i =>
536 | 0 === i.fileName.indexOf("Untitled") ||
537 | 0 <= i.fileName.indexOf("/") ||
538 | 0 <= i.fileName.indexOf("\\")
539 | )
540 | .map(i => i.fileName)
541 | .filter((value, i, self) => self.indexOf(value) === i);
542 |
543 | export const showJson = async (titile : string, json : any) : Promise =>
544 | {
545 | const provider = vscode.workspace.registerTextDocumentContentProvider
546 | (
547 | 'wandbox-vscode-json',
548 | new class implements vscode.TextDocumentContentProvider
549 | {
550 | provideTextDocumentContent(_uri: vscode.Uri, _token: vscode.CancellationToken)
551 | : string | Thenable
552 | {
553 | return JSON.stringify(json, null, 4);
554 | }
555 | }
556 | );
557 | const date = new Date(); // 結果がキャッシュされないようにする為
558 | const stamp = date.getFullYear().toString()
559 | +("0" +(date.getMonth() +1).toString()).slice(-2)
560 | +("0" +date.getDate().toString()).slice(-2)
561 | +"-"
562 | +("0" +date.getHours().toString()).slice(-2)
563 | +("0" +date.getMinutes().toString()).slice(-2)
564 | +("0" +date.getSeconds().toString()).slice(-2);
565 | vscode.window.showTextDocument
566 | (
567 | await vscode.workspace.openTextDocument
568 | (
569 | vscode.Uri.parse(`wandbox-vscode-json://wandbox-vscode/${stamp}/${titile}.json`)
570 | )
571 | );
572 | provider.dispose();
573 | };
574 | }
575 |
576 | const getLanguageNameFromSetting = async (vscodeLang? :string, fileName? :string) : Promise =>
577 | {
578 | let result : string;
579 | if (!result && fileName && fileSetting[fileName])
580 | {
581 | result = fileSetting[fileName].language;
582 | }
583 | if (!result && vscodeLang)
584 | {
585 | result = getConfiguration("languageMapping")[vscodeLang];
586 | }
587 | if (!result && fileName)
588 | {
589 | result = getConfiguration("extensionLanguageMapping")[fileName.split('.').reverse()[0]];
590 | }
591 | if (result)
592 | {
593 | if (!(await WandboxServer.makeSureList()).find(i => i.language === result))
594 | {
595 | // 構造上、ここでメッセージを出すと複数回同じメッセージが出てしまう。
596 | //OutputChannel.appendLine(`${emoji("warning")}Unknown language! : ${result}`);
597 | result = null;
598 | }
599 | }
600 | return result;
601 | };
602 |
603 | const getLanguageList = async (selectedLanguage? :string) : Promise =>
604 | ((await WandboxServer.makeSureList()) || [])
605 | .map(i => i.language)
606 | .filter((value, i, self) => self.indexOf(value) === i)
607 | .sort()
608 | .map
609 | (
610 | i =>
611 | ({
612 | label: emoji(selectedLanguage === i ? "checkedRadio": "uncheckedRadio") +i,
613 | "description": null,
614 | "detail": null,
615 | "value": i
616 | })
617 | );
618 |
619 | const queryLanguageNameToUser = async (vscodeLang? :string, fileName? :string) : Promise =>
620 | {
621 | let result : string;
622 | const selectedLanguage = await getLanguageNameFromSetting(vscodeLang, fileName);
623 | const select : any = await vscode.window.showQuickPick
624 | (
625 | getLanguageList(selectedLanguage),
626 | {
627 | placeHolder: "Select a language",
628 | }
629 | );
630 | if (select)
631 | {
632 | result = select.value;
633 | if (fileName)
634 | {
635 | fileSetting[fileName] = fileSetting[fileName] || {};
636 | fileSetting[fileName].language = result;
637 | }
638 | }
639 | return result;
640 | };
641 |
642 | const getLanguageName = async (vscodeLang? :string, fileName? :string) : Promise =>
643 | await getLanguageNameFromSetting(vscodeLang, fileName) ||
644 | await queryLanguageNameToUser(vscodeLang, fileName);
645 |
646 | const getWandboxCompilerName = async (vscodeLang :string, fileName :string) : Promise =>
647 | {
648 | let result : string;
649 | const list = await WandboxServer.makeSureList();
650 | const setting = fileSetting[fileName];
651 | if (setting)
652 | {
653 | result = setting.compiler;
654 | }
655 | if (!result && fileName)
656 | {
657 | result = getConfiguration("extensionCompilerMapping")[fileName.split('.').reverse()[0]];
658 | }
659 | if (result)
660 | {
661 | if (!list.find(i => i.name === result))
662 | {
663 | OutputChannel.appendLine(`${emoji("error")}Unknown compiler! : ${result}`);
664 | result = null;
665 | }
666 | }
667 | if (!result)
668 | {
669 | const language = await getLanguageName(vscodeLang, fileName);
670 | if (language)
671 | {
672 | result = getConfiguration("languageCompilerMapping")[language] ||
673 | list.find(i => i.language === language).name;
674 | }
675 | }
676 | return result;
677 | };
678 |
679 | const getOptions = async (vscodeLang :string, fileName :string) : Promise =>
680 | {
681 | let result : string;
682 | const setting = fileSetting[fileName];
683 | if (setting)
684 | {
685 | result = setting.options;
686 | }
687 | if (!result)
688 | {
689 | const compilerName = await getWandboxCompilerName(vscodeLang, fileName);
690 | if (compilerName)
691 | {
692 | result = getConfiguration("options")[compilerName];
693 | }
694 | if (!result)
695 | {
696 | result =
697 | (
698 | (await WandboxServer.makeSureList())
699 | .find(i => i.name === compilerName).switches || []
700 | )
701 | .map
702 | (
703 | item =>
704 | item.options ? item.default:
705 | item.default ? item.name:
706 | null
707 | )
708 | .filter(i => i)
709 | .join(",");
710 | }
711 | }
712 |
713 | return result;
714 | };
715 |
716 | const showWandboxSettings = () : Promise =>
717 | WorkSpace.showJson
718 | (
719 | "setting",
720 | {
721 | "basicSetting": getConfiguration(),
722 | "fileSetting": fileSetting
723 | }
724 | );
725 |
726 | const showWandboxWeb = () : Thenable =>
727 | vscode.commands.executeCommand
728 | (
729 | 'vscode.open',
730 | vscode.Uri.parse(WandboxServer.getWebUrl())
731 | );
732 |
733 | const showWandboxListJson = async () : Promise =>
734 | WorkSpace.showJson
735 | (
736 | "list",
737 | await WandboxServer.getList()
738 | );
739 |
740 | const showHistory = async () : Promise =>
741 | {
742 | const history = await getHistory();
743 | history.forEach(entry => OutputChannel.appendLine(`${entry.timestamp}\t${entry.shareUrl}\t${entry.language}\t${entry.compiler}\t`));
744 | OutputChannel.appendLine(`${history.length} share urls`);
745 | };
746 |
747 | const clearHistory = async () : Promise =>
748 | {
749 | if ("Yes" === await vscode.window.showWarningMessage("Are you sure to clear share history?", "Yes"))
750 | {
751 | updateHistory([]);
752 | OutputChannel.appendLine(`Cleared share history.`);
753 | }
754 | else
755 | {
756 | OutputChannel.canceled();
757 | }
758 | };
759 |
760 | const setSetting = async (name : string, dialog : () => Promise) : Promise =>
761 | {
762 | const document = WorkSpace.getActiveDocument();
763 | if (null !== document)
764 | {
765 | const fileName = document.fileName;
766 | const value = await dialog();
767 | if (undefined !== value)
768 | {
769 | fileSetting[fileName] = fileSetting[fileName] || {};
770 | if (value)
771 | {
772 | if ('codes' === name)
773 | {
774 | const newFiles = JSON.parse(value);
775 | fileSetting[fileName][name] = newFiles;
776 | OutputChannel.appendLine(`Set ${name} "${newFiles.join('","')}" for "${fileName}"`);
777 | }
778 | else
779 | if (name)
780 | {
781 | try
782 | {
783 | fileSetting[fileName][name] = JSON.parse(`"${value}"`);
784 | OutputChannel.appendLine(`Set ${name} "${value}" for "${fileName}"`);
785 | }
786 | catch(Err)
787 | {
788 | OutputChannel.appendLine(`${emoji("error")}${Err}`);
789 | }
790 | }
791 | else
792 | {
793 | try
794 | {
795 | fileSetting[fileName] = JSON.parse(value);
796 | OutputChannel.appendLine(`Set settings for "${fileName}"`);
797 | OutputChannel.appendJson(fileSetting[fileName]);
798 | }
799 | catch(Err)
800 | {
801 | OutputChannel.appendLine(`${emoji("error")}${Err}`);
802 | }
803 | }
804 | }
805 | else
806 | {
807 | fileSetting[fileName][name] = null;
808 | OutputChannel.appendLine(`Reset ${name} for "${fileName}"`);
809 | }
810 | }
811 | else
812 | {
813 | OutputChannel.canceled();
814 | }
815 | }
816 | else
817 | {
818 | OutputChannel.appendLine(`${emoji("error")}No active text editor!`);
819 | }
820 | };
821 | const setSettingByInputBox = async (name : string, prompt : string) : Promise => setSetting
822 | (
823 | name,
824 | async () => await vscode.window.showInputBox({ prompt })
825 | );
826 |
827 | const setServerSetting = async () : Promise => await setSetting
828 | (
829 | 'server',
830 | async () : Promise =>
831 | {
832 | let result : string;
833 | const selectedServer = WandboxServer.getServer();
834 | const servers = getConfiguration("Servers");
835 | const list : any[] = servers.map
836 | (
837 | i =>
838 | ({
839 | label: emoji(selectedServer === i ? "checkedRadio": "uncheckedRadio") +i,
840 | "description": null,
841 | "detail": null,
842 | "value": i
843 | })
844 | );
845 | list[0].description = "default";
846 | const isOther = servers.indexOf(selectedServer) < 0;
847 | list.push
848 | (
849 | {
850 | label: emoji(isOther ? "checkedRadio": "uncheckedRadio") +"Other",
851 | "description": "enter a server url by manual",
852 | "detail": isOther ? selectedServer: null
853 | }
854 | );
855 | const select = await vscode.window.showQuickPick
856 | (
857 | list,
858 | {
859 | placeHolder: "Select a server",
860 | }
861 | );
862 | if (select)
863 | {
864 | if (select === list.reverse()[0])
865 | {
866 | result = await vscode.window.showInputBox({prompt : 'Enter a server url'});
867 | }
868 | else
869 | {
870 | result = select.value;
871 | }
872 | }
873 | return result;
874 | }
875 | );
876 |
877 | const getCompilerList = async (language : string) : Promise =>
878 | ((await WandboxServer.makeSureList()) || [])
879 | .filter(i => i.language === language)
880 | .map
881 | (
882 | i =>
883 | ({
884 | "label": i["display-name"] +" " +i["version"],
885 | "description": i["name"],
886 | "detail": null
887 | })
888 | );
889 |
890 | const setCompilerSetting = async () : Promise => await setSetting
891 | (
892 | 'compiler',
893 | async () : Promise =>
894 | {
895 | let result : string;
896 | const document = WorkSpace.getActiveDocument();
897 | const vscodeLang = document.languageId;
898 | const fileName = document.fileName;
899 | const language = await queryLanguageNameToUser(vscodeLang, fileName);
900 | if (language)
901 | {
902 | const compilerList = await getCompilerList(language);
903 | if (1 === compilerList.length)
904 | {
905 | result = compilerList[0].description;
906 | }
907 | else
908 | {
909 | let selectedCompiler = await getWandboxCompilerName(vscodeLang, fileName);
910 | if (!selectedCompiler || !compilerList.find(i => selectedCompiler === i.description))
911 | {
912 | selectedCompiler = compilerList[0].description;
913 | }
914 | for(const i of compilerList)
915 | {
916 | i.label = emoji(selectedCompiler === i.description ? "checkedRadio": "uncheckedRadio") +i.label;
917 | }
918 | const select = await vscode.window.showQuickPick
919 | (
920 | compilerList,
921 | {
922 | placeHolder: "Select a compiler",
923 | }
924 | );
925 | if (select)
926 | {
927 | result = select.description;
928 | }
929 | }
930 | }
931 | return result;
932 | }
933 | );
934 |
935 | const setAdditionalsSetting = async () => await setSetting
936 | (
937 | 'codes',
938 | async () : Promise =>
939 | {
940 | const document = WorkSpace.getActiveDocument();
941 | const setting = fileSetting[document.fileName] || {};
942 | let additionals = setting['codes'] || [];
943 | let result : string;
944 | const workspaceTextFiles = WorkSpace.getTextFiles();
945 | const select = await vscode.window.showQuickPick
946 | (
947 | [].concat
948 | (
949 | workspaceTextFiles
950 | .map
951 | (
952 | fileName =>
953 | ({
954 | label: emoji(0 <= additionals.indexOf(fileName) ? "checkedBox": "uncheckedBox") +stripDirectory(fileName),
955 | description: fileName,
956 | detail: document.fileName === fileName ? "this file itself": null
957 | })
958 | ),
959 | additionals
960 | .filter(fileName => !workspaceTextFiles.find(i => i === fileName))
961 | .map
962 | (
963 | fileName =>
964 | ({
965 | label: emoji("checkedBox") +stripDirectory(fileName),
966 | description: fileName,
967 | detail: `${emoji("error")}Not found file ( If opened, show this file once. And keep to open it.)`
968 | })
969 | ),
970 | {
971 | label: `${emoji("new")}new untitled document`,
972 | description: null,
973 | detail: null
974 | }
975 | ),
976 | {
977 | placeHolder: "Select a add file( or a remove file )",
978 | }
979 | );
980 | if (select)
981 | {
982 | if (select.description)
983 | {
984 | if (0 <= additionals.indexOf(select.description))
985 | {
986 | additionals = additionals.filter(value => select.description !== value);
987 | }
988 | else
989 | {
990 | additionals.push(select.description);
991 | }
992 | }
993 | else
994 | {
995 | const newDocument = await openNewTextDocument("");
996 | await vscode.window.showTextDocument(newDocument);
997 | additionals.push(newDocument.fileName);
998 | }
999 | result = JSON.stringify(additionals);
1000 | }
1001 | return result;
1002 | }
1003 | );
1004 |
1005 | const setStdInSetting = async () => await setSetting
1006 | (
1007 | 'stdin',
1008 | async () : Promise =>
1009 | {
1010 | const document = WorkSpace.getActiveDocument();
1011 | const setting = fileSetting[document.fileName] || {};
1012 | const stdin : string = setting['stdin'];
1013 | const noStdIn : vscode.QuickPickItem =
1014 | {
1015 | label: emoji(!stdin ? "checkedRadio": "uncheckedRadio") +"no stdin",
1016 | description: null,
1017 | detail: null
1018 | };
1019 | const newUntitledDocument : vscode.QuickPickItem =
1020 | {
1021 | label: `${emoji("new")}new untitled document`,
1022 | description: null,
1023 | detail: null
1024 | };
1025 | const workspaceTextFiles = WorkSpace.getTextFiles();
1026 | const select = await vscode.window.showQuickPick
1027 | (
1028 | [].concat
1029 | (
1030 | noStdIn,
1031 | workspaceTextFiles.map
1032 | (
1033 | fileName =>
1034 | ({
1035 | label: emoji(stdin === fileName ? "checkedRadio": "uncheckedRadio") +stripDirectory(fileName),
1036 | description: fileName,
1037 | detail: document.fileName === fileName ? "this file itself": null
1038 | })
1039 | ),
1040 | (stdin && !workspaceTextFiles.find(fileName => stdin === fileName)) ?
1041 | {
1042 | label: emoji("checkedRadio") +stripDirectory(stdin),
1043 | description: stdin,
1044 | detail: `${emoji("error")}Not found file ( If opened, show this file once. And keep to open it.)`
1045 | }:
1046 | null,
1047 | newUntitledDocument
1048 | )
1049 | .filter(i => i),
1050 | {
1051 | placeHolder: "Select a file as a stdin",
1052 | }
1053 | );
1054 | let result : string = undefined;
1055 | if (select)
1056 | {
1057 | if (newUntitledDocument !== select)
1058 | {
1059 | if (noStdIn === select)
1060 | {
1061 | result = null;
1062 | }
1063 | else
1064 | {
1065 | result = select.description
1066 | .replace(/\\/g, "\\\\")
1067 | .replace(/\"/g, "\\\"");
1068 | }
1069 | }
1070 | else
1071 | {
1072 | const newDocument = await openNewTextDocument("");
1073 | await vscode.window.showTextDocument(newDocument);
1074 | result = newDocument.fileName;
1075 | }
1076 | }
1077 | return result;
1078 | }
1079 | );
1080 |
1081 | const setOptionsSetting = async () : Promise =>
1082 | {
1083 | const document = WorkSpace.getActiveDocument();
1084 | if (null !== document)
1085 | {
1086 | const languageId = document.languageId;
1087 | const fileName = document.fileName;
1088 | const compilerName = await getWandboxCompilerName
1089 | (
1090 | languageId,
1091 | fileName
1092 | );
1093 | if (compilerName)
1094 | {
1095 | const compiler = ( await WandboxServer.makeSureList())
1096 | .find(i => i.name === compilerName);
1097 | let options : string = await getOptions
1098 | (
1099 | languageId,
1100 | fileName
1101 | );
1102 | let setting = fileSetting[fileName];
1103 | if (setting && undefined !== setting['options'])
1104 | {
1105 | options = setting['options'];
1106 | }
1107 | let selectedOptionList = (options || "").split(",").filter(i => i);
1108 |
1109 | const optionList : any[] = [];
1110 | const separator =
1111 | {
1112 | label: "",
1113 | description: emoji("menuSeparator")
1114 | };
1115 | const AdditinalsMenuItem =
1116 | {
1117 | label: `${emoji("edit")}Select a add file( or a remove file )`,
1118 | description: "",
1119 | detail: setting && (setting['codes'] || []).join(', '),
1120 | };
1121 | optionList.push(AdditinalsMenuItem);
1122 | const stdInMenuItem =
1123 | {
1124 | label: `${emoji("edit")}Select a file as a stdin`,
1125 | description: "",
1126 | detail: setting && setting['stdin'],
1127 | };
1128 | optionList.push(stdInMenuItem);
1129 | const CompilerOptionRawMenuItem =
1130 | {
1131 | label: `${emoji("edit")}Set compiler option raw`,
1132 | description: "",
1133 | detail: setting && setting['compiler-option-raw'],
1134 | };
1135 | if (compiler['compiler-option-raw'])
1136 | {
1137 | optionList.push(CompilerOptionRawMenuItem);
1138 | }
1139 | const RuntimeOptionRawMenuItem =
1140 | {
1141 | label: `${emoji("edit")}Set runtime option raw`,
1142 | description: "",
1143 | detail: setting && setting['runtime-option-raw'],
1144 | };
1145 | if (compiler['runtime-option-raw'])
1146 | {
1147 | optionList.push(RuntimeOptionRawMenuItem);
1148 | }
1149 | let lastGroup = 0;
1150 | for(const item of (compiler.switches || []))
1151 | {
1152 | if (item.options)
1153 | {
1154 | optionList.push(separator);
1155 | for(const option of item.options)
1156 | {
1157 | optionList.push
1158 | (
1159 | {
1160 | label: emoji(0 <= selectedOptionList.indexOf(option.name) ? "checkedRadio": "uncheckedRadio") +option["display-name"],
1161 | description: option["display-flags"],
1162 | detail: null,
1163 | item,
1164 | option
1165 | }
1166 | );
1167 | }
1168 | lastGroup = 2;
1169 | }
1170 | else
1171 | {
1172 | if (1 !== lastGroup)
1173 | {
1174 | optionList.push(separator);
1175 | }
1176 | optionList.push
1177 | (
1178 | {
1179 | label: emoji(0 <= selectedOptionList.indexOf(item.name) ? "checkedBox": "uncheckedBox") +item["display-name"],
1180 | description: item["display-flags"],
1181 | detail: null,
1182 | item
1183 | }
1184 | );
1185 | lastGroup = 1;
1186 | }
1187 | }
1188 |
1189 | const select = await vscode.window.showQuickPick
1190 | (
1191 | optionList,
1192 | {
1193 | placeHolder: "Select a add option( or a remove option )",
1194 | }
1195 | );
1196 | if (select)
1197 | {
1198 | if (AdditinalsMenuItem === select)
1199 | {
1200 | setAdditionalsSetting();
1201 | }
1202 | else
1203 | if (stdInMenuItem === select)
1204 | {
1205 | setStdInSetting();
1206 | }
1207 | else
1208 | if (CompilerOptionRawMenuItem === select)
1209 | {
1210 | setRawOptionSetting('compiler-option-raw', 'Enter compiler option raw');
1211 | }
1212 | else
1213 | if (RuntimeOptionRawMenuItem === select)
1214 | {
1215 | setRawOptionSetting('runtime-option-raw', 'Enter runtime option raw');
1216 | }
1217 | else
1218 | if (select.item)
1219 | {
1220 | if (select.option)
1221 | {
1222 | for(const option of select.item.options)
1223 | {
1224 | selectedOptionList = selectedOptionList.filter(i => i !== option.name);
1225 | }
1226 | selectedOptionList.push(select.option.name);
1227 | }
1228 | else
1229 | {
1230 | const selected = 0 <= selectedOptionList.indexOf(select.item.name);
1231 | if (selected)
1232 | {
1233 | selectedOptionList = selectedOptionList.filter(i => i !== select.item.name);
1234 | }
1235 | else
1236 | {
1237 | selectedOptionList.push(select.item.name);
1238 | }
1239 | }
1240 |
1241 | try
1242 | {
1243 | setting = fileSetting[fileName] = fileSetting[fileName] || {};
1244 | setting['options'] = selectedOptionList.join(",");
1245 | OutputChannel.appendLine(`Set options "${setting['options']}" for "${fileName}"`);
1246 | }
1247 | catch(Err)
1248 | {
1249 | OutputChannel.appendLine(`${emoji("error")}${Err}`);
1250 | }
1251 | }
1252 | }
1253 | else
1254 | {
1255 | OutputChannel.canceled();
1256 | }
1257 | }
1258 | else
1259 | {
1260 | OutputChannel.canceled();
1261 | }
1262 | }
1263 | };
1264 |
1265 | const setRawOptionSetting = async (name : string, prompt : string) : Promise =>setSetting
1266 | (
1267 | name,
1268 | async () : Promise =>
1269 | {
1270 | let result : string;
1271 | const document = WorkSpace.getActiveDocument();
1272 | if (null !== document)
1273 | {
1274 | const languageId = document.languageId;
1275 | const fileName = document.fileName;
1276 | const compilerName = await getWandboxCompilerName
1277 | (
1278 | languageId,
1279 | fileName
1280 | );
1281 | if (compilerName)
1282 | {
1283 | const compiler = ( await WandboxServer.makeSureList())
1284 | .find(i => i.name === compilerName);
1285 | if (compiler && compiler[name])
1286 | {
1287 | result = await vscode.window.showInputBox({ prompt });
1288 | }
1289 | else
1290 | {
1291 | OutputChannel.appendLine(`${emoji("warning")}This compiler not accept "${name}".`);
1292 | }
1293 | }
1294 | }
1295 | return result;
1296 | }
1297 | );
1298 |
1299 | const resetWandboxFileSettings = () : void =>
1300 | {
1301 | const document = WorkSpace.getActiveDocument();
1302 | if (null !== document)
1303 | {
1304 | const fileName = document.fileName;
1305 | if (fileSetting[fileName])
1306 | {
1307 | delete fileSetting[fileName];
1308 | OutputChannel.appendLine(`Reset settings for "${fileName}"`);
1309 | }
1310 | else
1311 | {
1312 | OutputChannel.appendLine(`${emoji("warning")}Not found settings for "${fileName}"`);
1313 | }
1314 | }
1315 | else
1316 | {
1317 | OutputChannel.appendLine(`${emoji("error")}No active text editor!`);
1318 | }
1319 | };
1320 |
1321 | const invokeWandbox = async (args ?: any) : Promise =>
1322 | {
1323 | const document = WorkSpace.getActiveDocument();
1324 | if (null !== document)
1325 | {
1326 | const compilerName = await getWandboxCompilerName
1327 | (
1328 | document.languageId,
1329 | document.fileName
1330 | );
1331 | if (compilerName)
1332 | {
1333 | let additionals : string[];
1334 | const options : string = await getOptions
1335 | (
1336 | document.languageId,
1337 | document.fileName
1338 | );
1339 | let stdIn : string;
1340 | let compilerOptionRaw : string = getConfiguration("compilerOptionRaw")[compilerName];
1341 | let runtimeOptionRaw : string = getConfiguration("runtimeOptionRaw")[compilerName];
1342 | const setting = fileSetting[document.fileName];
1343 | if (setting)
1344 | {
1345 | additionals = setting['codes'];
1346 | stdIn = setting['stdin'];
1347 | if (undefined !== setting['compiler-option-raw'])
1348 | {
1349 | compilerOptionRaw = setting['compiler-option-raw'];
1350 | }
1351 | if (undefined !== setting['runtime-option-raw'])
1352 | {
1353 | runtimeOptionRaw = setting['runtime-option-raw'];
1354 | }
1355 | }
1356 |
1357 | const json =
1358 | {
1359 | compiler: compilerName,
1360 | code: document
1361 | };
1362 | if (additionals)
1363 | {
1364 | if (!WorkSpace.IsOpenFiles(additionals))
1365 | {
1366 | return;
1367 | }
1368 | // ログ表示用のダミー。実際にPOSTするデータはこの後で再設定。
1369 | json['codes'] = additionals.join(',');
1370 | }
1371 | if (options)
1372 | {
1373 | json['options'] = options;
1374 | }
1375 | if (stdIn)
1376 | {
1377 | if (!WorkSpace.IsOpenFiles([stdIn]))
1378 | {
1379 | return;
1380 | }
1381 | json['stdin'] = stdIn;
1382 | }
1383 | if (compilerOptionRaw)
1384 | {
1385 | json['compiler-option-raw'] = compilerOptionRaw;
1386 | }
1387 | if (runtimeOptionRaw)
1388 | {
1389 | json['runtime-option-raw'] = runtimeOptionRaw;
1390 | }
1391 | if (args && args.share)
1392 | {
1393 | json['save'] = true;
1394 | }
1395 | WandboxServer.compile(json);
1396 | }
1397 | else
1398 | {
1399 | OutputChannel.canceled();
1400 | }
1401 | }
1402 | else
1403 | {
1404 | OutputChannel.appendLine(`${emoji("error")}No active text editor!`);
1405 | }
1406 | };
1407 |
1408 | const getHelloWorldFiles = async () : Promise =>
1409 | {
1410 | const extensionPath = vscode.extensions.getExtension("wraith13.wandbox-vscode").extensionPath;
1411 | const userFiles = getConfiguration("helloWolrdFiles");
1412 | const { error, files } = await fx.readdir(`${extensionPath}/hellos`);
1413 | if (error)
1414 | {
1415 | OutputChannel.appendLine(emoji("error") +error.message);
1416 | }
1417 | const hello = "hello.";
1418 | return [].concat
1419 | (
1420 | userFiles.map
1421 | (
1422 | i =>
1423 | ({
1424 | "label": stripDirectory(i),
1425 | "description": i,
1426 | "detail": null
1427 | })
1428 | ),
1429 | (files || [])
1430 | .filter(i => i.startsWith(hello))
1431 | .map
1432 | (
1433 | i =>
1434 | ({
1435 | "label": i,
1436 | "description": `${extensionPath}/hellos/${i}`,
1437 | "detail": null
1438 | })
1439 | )
1440 | );
1441 | };
1442 |
1443 | const newWandbox = async () : Promise =>
1444 | {
1445 | let compilerName : string;
1446 | const language = await queryLanguageNameToUser();
1447 | if (language)
1448 | {
1449 | const compilerList = await getCompilerList(language);
1450 | if (1 === compilerList.length)
1451 | {
1452 | compilerName = compilerList[0].description;
1453 | }
1454 | else
1455 | {
1456 | const select = await vscode.window.showQuickPick
1457 | (
1458 | compilerList,
1459 | {
1460 | placeHolder: "Select a compiler",
1461 | }
1462 | );
1463 | if (select)
1464 | {
1465 | compilerName = select.description;
1466 | }
1467 | }
1468 | if (compilerName)
1469 | {
1470 | let templateName : string;
1471 | const compiler = ( await WandboxServer.makeSureList())
1472 | .find(i => i.name === compilerName);
1473 | if (1 === compiler.templates.length)
1474 | {
1475 | templateName = compiler.templates[0];
1476 | }
1477 | else
1478 | {
1479 | const select = await vscode.window.showQuickPick
1480 | (
1481 | compiler.templates,
1482 | {
1483 | placeHolder: "Select a template",
1484 | }
1485 | );
1486 | if (select)
1487 | {
1488 | templateName = select;
1489 | }
1490 | }
1491 | if (templateName)
1492 | {
1493 | await openNewCodeDocument
1494 | (
1495 | language,
1496 | compilerName,
1497 | ( await WandboxServer.makeSureTempate(templateName)).code
1498 | );
1499 | }
1500 | }
1501 | }
1502 | };
1503 |
1504 | const helloWandbox = async () : Promise =>
1505 | {
1506 | const select = await vscode.window.showQuickPick
1507 | (
1508 | getHelloWorldFiles(),
1509 | {
1510 | placeHolder: "Select a [hello, world!] file",
1511 | matchOnDescription: true
1512 | }
1513 | );
1514 | if (select)
1515 | {
1516 | const helloFilePath = select.description;
1517 | OutputChannel.appendLine(`${emoji("new")}Open a [hello, world!] as a new file. ( Source is "${helloFilePath}" )`);
1518 | if (await fx.exists(helloFilePath))
1519 | {
1520 | const { err, data } = await fx.readFile(helloFilePath);
1521 | if (err)
1522 | {
1523 | OutputChannel.appendLine(emoji("error") +err.message);
1524 | }
1525 | else
1526 | {
1527 | await openNewCodeDocument
1528 | (
1529 | await getLanguageName(null, helloFilePath),
1530 | await getWandboxCompilerName(undefined, helloFilePath),
1531 | data.toString()
1532 | );
1533 | }
1534 | }
1535 | else
1536 | {
1537 | OutputChannel.appendLine(`${emoji("error")} Unknown file extension!`);
1538 | OutputChannel.appendLine(`${emoji("hint")}You can set hello world files by [wandbox.helloWolrdFiles] setting.`);
1539 | }
1540 | }
1541 | else
1542 | {
1543 | OutputChannel.canceled();
1544 | }
1545 | };
1546 |
1547 | export const registerCommand = (aContext: vscode.ExtensionContext) : void =>
1548 | {
1549 | // oldCommand は deprecated な扱いで今後、削除予定。
1550 | context = aContext;
1551 | [
1552 | {
1553 | oldCommand: 'extension.showWandboxSettings',
1554 | command: 'wandbox.showSettings',
1555 | callback: showWandboxSettings
1556 | },
1557 | {
1558 | oldCommand: 'extension.showWandboxWeb',
1559 | command: 'wandbox.showWeb',
1560 | callback: showWandboxWeb
1561 | },
1562 | {
1563 | oldCommand: 'extension.showWandboxListJson',
1564 | command: 'wandbox.showListJson',
1565 | callback: showWandboxListJson
1566 | },
1567 | {
1568 | oldCommand: 'extension.showHistory',
1569 | command: 'wandbox.showHistory',
1570 | callback: showHistory
1571 | },
1572 | {
1573 | oldCommand: 'extension.clearHistory',
1574 | command: 'wandbox.clearHistory',
1575 | callback: clearHistory
1576 | },
1577 | {
1578 | oldCommand: 'extension.setWandboxFileServer',
1579 | command: 'wandbox.setFileServer',
1580 | callback: setServerSetting
1581 | },
1582 | {
1583 | oldCommand: 'extension.setWandboxFileCompiler',
1584 | command: 'wandbox.setFileCompiler',
1585 | callback: setCompilerSetting
1586 | },
1587 | {
1588 | oldCommand: 'extension.setWandboxFileOptions',
1589 | command: 'wandbox.setFileOptions',
1590 | callback: setOptionsSetting
1591 | },
1592 | {
1593 | oldCommand: 'extension.setWandboxFileSettingJson',
1594 | command: 'wandbox.setFileSettingJson',
1595 | callback: () => setSettingByInputBox(null, 'Enter settings JSON')
1596 | },
1597 | {
1598 | oldCommand: 'extension.resetWandboxFileSettings',
1599 | command: 'wandbox.resetFileSettings',
1600 | callback: resetWandboxFileSettings
1601 | },
1602 | {
1603 | oldCommand: 'extension.invokeWandbox',
1604 | command: 'wandbox.run',
1605 | callback: () => invokeWandbox()
1606 | },
1607 | {
1608 | oldCommand: 'extension.shareWandbox',
1609 | command: 'wandbox.share',
1610 | callback: () => invokeWandbox({ share: true })
1611 | },
1612 | {
1613 | oldCommand: null,
1614 | command: 'wandbox.new',
1615 | callback: newWandbox
1616 | },
1617 | {
1618 | oldCommand: 'extension.helloWandbox',
1619 | command: 'wandbox.hello',
1620 | callback: helloWandbox
1621 | }
1622 | ]
1623 | .forEach
1624 | (
1625 | i => context.subscriptions.concat
1626 | (
1627 | i.oldCommand && vscode.commands.registerCommand
1628 | (
1629 | i.oldCommand,
1630 | () =>
1631 | {
1632 | OutputChannel.makeSure();
1633 | OutputChannel.bowWow();
1634 | i.callback();
1635 | }
1636 | ),
1637 | vscode.commands.registerCommand
1638 | (
1639 | i.command,
1640 | () =>
1641 | {
1642 | OutputChannel.makeSure();
1643 | OutputChannel.bowWow();
1644 | i.callback();
1645 | }
1646 | )
1647 | )
1648 | );
1649 |
1650 | vscode.workspace.onDidCloseTextDocument
1651 | (
1652 | (document : vscode.TextDocument) =>
1653 | {
1654 | if
1655 | (
1656 | // ここで見つかる場合は本当には閉じられてない
1657 | !vscode.workspace.textDocuments
1658 | .find(i => i.fileName === document.fileName) &&
1659 | fileSetting[document.fileName]
1660 | )
1661 | {
1662 | //OutputChannel.appendLine(`delete fileSetting[${document.fileName}]`);
1663 | delete fileSetting[document.fileName];
1664 | }
1665 | }
1666 | );
1667 | };
1668 | }
1669 |
1670 | // this method is called when your extension is activated
1671 | // your extension is activated the very first time the command is executed
1672 | export const activate = (context: vscode.ExtensionContext) =>
1673 | WandboxVSCode.registerCommand(context);
1674 |
1675 | // this method is called when your extension is deactivated
1676 | export const deactivate = () => { };
1677 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "commonjs",
4 | "moduleResolution": "node",
5 | "declaration": false,
6 | "target": "es6",
7 | "outDir": "out",
8 | "lib": [
9 | "es6"
10 | ],
11 | "noImplicitAny": false,
12 | "strictNullChecks": false,
13 | "noFallthroughCasesInSwitch": true,
14 | "noImplicitReturns": true,
15 | "noImplicitThis": true,
16 | "noUnusedLocals": true,
17 | "noUnusedParameters": true,
18 | "noImplicitUseStrict": false,
19 | "sourceMap": true,
20 | "emitDecoratorMetadata": true,
21 | "experimentalDecorators": true,
22 | "forceConsistentCasingInFileNames": true,
23 | "traceResolution": false,
24 | "listFiles": false,
25 | "stripInternal": true,
26 | "skipDefaultLibCheck": true,
27 | "skipLibCheck": false,
28 | "pretty": false,
29 | "noEmitOnError": true,
30 | "rootDir": "."
31 | },
32 | "exclude": [
33 | "node_modules",
34 | ".vscode-test"
35 | ]
36 | }
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rules": {
3 | "no-string-throw": true,
4 | "no-unused-expression": true,
5 | "no-duplicate-variable": true,
6 | "curly": true,
7 | "class-name": true,
8 | "semicolon": [
9 | true,
10 | "always"
11 | ],
12 | "triple-equals": true
13 | },
14 | "defaultSeverity": "warning"
15 | }
16 |
--------------------------------------------------------------------------------