|
1 | | -# ZenStack VS Code Extension |
| 1 | +# ZenStack V3 VS Code Extension |
2 | 2 |
|
3 | | -[ZenStack](https://zenstack.dev) is a toolkit that simplifies the development of a web app's backend. It enhances [Prisma ORM](https://prisma.io) with flexible Authorization and auto-generated, type-safe APIs/hooks, simplifying full-stack development. |
| 3 | +[ZenStack](https://zenstack.dev) is the modern data layer for TypeScript applications. It provides a data modeling language, a type-safe ORM with built-in access control, and other utilities that help you streamline full-stack development. This VS Code extension provides code editing helpers for authoring ZenStack's schema files (`.zmodel` files). |
4 | 4 |
|
5 | | -This VS Code extension provides code editing helpers for authoring ZenStack's schema files (.zmodel files). |
| 5 | +Use this extension if you are using ZenStack v3.x, otherwise use the [original extension](https://marketplace.visualstudio.com/items?itemName=zenstack.zenstack) that works with v2.x. See [Configuration](#configuration) for how to use both versions side by side. |
6 | 6 |
|
7 | 7 | ## Features |
8 | 8 |
|
9 | | -- Syntax highlighting of `*.zmodel` files |
| 9 | +- Syntax highlighting |
| 10 | +- Inline error reporting |
| 11 | +- Go-to definition |
| 12 | +- Hover documentation |
| 13 | +- Code section folding |
10 | 14 |
|
11 | | - - In case the schema file is not recognized automatically, add the following to your settings.json file: |
| 15 | +## Configuration |
12 | 16 |
|
13 | | - ```json |
14 | | - "files.associations": { |
15 | | - "*.zmodel": "zmodel" |
16 | | - }, |
17 | | - ``` |
| 17 | +### Side by side with the original ZenStack extension |
18 | 18 |
|
19 | | -- Auto formatting |
| 19 | +If you have the [original ZenStack v2 extension](https://marketplace.visualstudio.com/items?itemName=zenstack.zenstack) installed, it may compete with this extension on handling `.zmodel` files. In this case, add the following settings to your `.vscode/settings.json` file to specify which extension should handle `.zmodel` files. |
20 | 20 |
|
21 | | - - To automatically format on save, add the following to your settings.json file: |
| 21 | +To let this extension handle `.zmodel` files, add: |
22 | 22 |
|
23 | | - ```json |
24 | | - "editor.formatOnSave": true |
25 | | - ``` |
| 23 | +```json |
| 24 | +"files.associations": { |
| 25 | + "*.zmodel": "zmodel-v3" |
| 26 | +}, |
| 27 | +``` |
26 | 28 |
|
27 | | - - To enable formatting in combination with prettier, add the following to your settings.json file: |
28 | | - ```json |
29 | | - "[zmodel]": { |
30 | | - "editor.defaultFormatter": "zenstack.zenstack" |
31 | | - }, |
32 | | - ``` |
| 29 | +To let the v2 extension handle `.zmodel` files, add: |
33 | 30 |
|
34 | | -- Inline error reporting |
35 | | -- Go-to definition |
36 | | -- Hover documentation |
37 | | -- Code section folding |
| 31 | +```json |
| 32 | +"files.associations": { |
| 33 | + "*.zmodel": "zmodel" |
| 34 | +}, |
| 35 | +``` |
| 36 | + |
| 37 | +### Auto formatting |
| 38 | + |
| 39 | +To automatically format on save, add the following to your `.vscode/settings.json` file: |
| 40 | + |
| 41 | +```json |
| 42 | +"editor.formatOnSave": true |
| 43 | +``` |
| 44 | + |
| 45 | +To enable formatting in combination with prettier, add the following to your `.vscode/settings.json` file: |
| 46 | + |
| 47 | +```json |
| 48 | +"[zmodel-v3]": { |
| 49 | + "editor.defaultFormatter": "zenstack.zenstack-v3" |
| 50 | +}, |
| 51 | +``` |
38 | 52 |
|
39 | 53 | ## Links |
40 | 54 |
|
41 | | -- [Home](https://zenstack.dev) |
42 | | -- [Documentation](https://zenstack.dev/docs) |
| 55 | +- [Home](https://zenstack.dev/v3) |
| 56 | +- [Documentation](https://zenstack.dev/docs/3.x) |
43 | 57 | - [Community chat](https://discord.gg/Ykhr738dUe) |
44 | 58 | - [Twitter](https://twitter.com/zenstackhq) |
45 | | -- [Blog](https://dev.to/zenstack) |
| 59 | +- [Blog](https://zenstack.dev/blog) |
46 | 60 |
|
47 | 61 | ## Community |
48 | 62 |
|
|
0 commit comments