https://github.com/vshaxe/vscode-extern
VS Code API externs for Haxe
https://github.com/vshaxe/vscode-extern
externs haxe visual-studio-code vscode
Last synced: 3 months ago
JSON representation
VS Code API externs for Haxe
- Host: GitHub
- URL: https://github.com/vshaxe/vscode-extern
- Owner: vshaxe
- License: mit
- Created: 2016-05-03T13:54:47.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-05-11T23:35:39.000Z (8 months ago)
- Last Synced: 2025-05-12T00:25:33.111Z (8 months ago)
- Topics: externs, haxe, visual-studio-code, vscode
- Language: Haxe
- Homepage: http://vshaxe.github.io/vscode-extern/
- Size: 2.78 MB
- Stars: 41
- Watchers: 6
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Visual Studio Code API externs for Haxe
[](https://github.com/vshaxe/vscode-extern/actions?query=workflow%3ACI)
[](https://lib.haxe.org/p/vscode)
[](https://lib.haxe.org/p/vscode)
[](LICENSE.md)
This extern library makes it possible to write extensions for [Visual Studio Code](https://code.visualstudio.com/)
using [Haxe](https://haxe.org/).
VS Code API version: **1.97**
**NOTE**: Requires Haxe 4.3 or later
## Usage
Global functions and variables from the `vscode` namespace are available through `Vscode` top-level class,
while types defined in `vscode` namespace are located in the `vscode` package. The node.js API externs are
provided by the [hxnodejs](https://github.com/HaxeFoundation/hxnodejs) library.
~~The current "proposed" APIs are provided via `VscodeProposed` top-level class for the `vscode` namespace
and the `vscode.proposed` package.~~
VS Code expects a .js module that exports the `activate` function that will be called upon
extension activation. In Haxe this is done using the `@:expose` metdata.
Example:
```haxe
class HelloHaxe {
@:expose("activate")
static function activate(context:vscode.ExtensionContext) {
Vscode.window.showInformationMessage("Hello from Haxe!");
}
}
```
compile with:
```
haxe -lib vscode -js hellohaxe.js HelloHaxe
```
For a complete extension example, check the [example/](https://github.com/vshaxe/vscode-extern/tree/master/example) directory inside this repository.
For generated extern API documentation, proceed [here](http://vshaxe.github.io/vscode-extern/).
For general information about how to extend Visual Studio code,
check [their documentation](https://code.visualstudio.com/docs/extensions/overview).