Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/antfu/wenyan-lang-vscode

文言 Wenyan Lang for VS Code
https://github.com/antfu/wenyan-lang-vscode

language snippets vscode wenyan wenyan-lang

Last synced: about 2 months ago
JSON representation

文言 Wenyan Lang for VS Code

Awesome Lists containing this project

README

        


logo


Visual Studio Marketplace Version
Visual Studio Marketplace Downloads
Visual Studio Marketplace Installs
Marketplace Trending Monthly


GitHub last commit
GitHub issues
GitHub stars


for 文言 Wenyan Lang, a programming language for the ancient Chinese.

![](https://github.com/antfu/wenyan-lang-vscode/raw/master/screenshots/demo-highlight.png)

### Compile & Execute

View the compiled Javascript side by side or Direct execute it.

> The [compiler](https://github.com/LingDong-/wenyan-lang/tree/master/build) is shipped with this extension, no installation required.

![](https://github.com/antfu/wenyan-lang-vscode/raw/master/screenshots/demo-execute.png)

### Punctuations Replacement

Punctuations will be automatically replaced to fit the language.

![](https://github.com/antfu/wenyan-lang-vscode/raw/master/screenshots/demo-punctuations.gif)

*You will get the result immediately, the delay is added for demostraction purpose*

### Snippets

You can write Wenyan quickly by using snippets:

![](https://github.com/antfu/wenyan-lang-vscode/raw/master/screenshots/demo-snippets.gif)

Here are some common snippets. For full list, check out [this file](https://github.com/antfu/wenyan-lang-vscode/blob/master/snippets/static.json).

| Triggers | Snippet |
| --- | --- |
| `if` | `若⋯者。⋯也。` |
| `else` | `若非。⋯也。` |
| `for` | `為是⋯遍。⋯云云。` |
| `break` | `乃止。` |
| `while` | `恆為是。⋯云云。` |
| `function` | `吾有一術。名之曰「⋯」。是術曰。` |
| `int` | `吾有一數。曰⋯。名之曰「⋯」。` |
| `str` | `吾有一言。曰「「⋯」」。名之曰「⋯」。` |
| `bool` | `吾有一爻。曰陰。名之曰「⋯」。` |
| `array` | `吾有一列。名之曰「⋯」。` |
| `object` | `吾有一物。名之曰「⋯」。` |

### [Wenyanizer](https://github.com/zxch3n/wenyanizer) by [@zxch3n](https://github.com/zxch3n)

From `v0.10.0`, we shipped support for compiling Javascript back to Wenyan. Thanks for @zxch3n's great work!

![](https://user-images.githubusercontent.com/11247099/71503497-64e05500-28b0-11ea-978a-782a9181f44d.png)

### Configurations

| Fields | Default | Note |
| --- | --- | --- |
| `wenyan-lang.executablePath` | built-in | Filepath to executable `wenyan.js` |
| `wenyan-lang.targetLanguage` | `javascript` | Target language that compiles to. Can be `javascript`, `python` or `ruby` |
| `wenyan-lang.runOnSave` | true | Execute the code on save |
| `wenyan-lang.romanizeMethod` | null | Romanize identifiers. The method can be `pinyin`, `baxter` or `unicode` |

## ToDo

- [x] Syntax Highlight
- [x] Snippets
- [x] Dynamic Snippets
- [x] Execute
- [x] Compile
- [x] Compile to Python
- [x] Rendering
- [ ] Code Completion
- [ ] Language Server

## License

[MIT License](https://github.com/antfu/wenyan-lang-vscode/blob/master/LICENSE) © 2019-2020 [Anthony Fu](https://github.com/antfu)