5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 07:21:32 +08:00
wails/website/docs/guides/ides.mdx
Misite Bao e9b2c15664
feat: optimize documentation website (#1849)
* fix(website): fix i18n configuration

* feat: add i18n file to auto generate code

* feat: move the crowdin configuration file to the website directory

* feat(website): add crowdin dependencies and scripts

* feat: add COC

* feat: use escape hatch syntax to wrap JSX code in MDX files

* feat: remove ach language

* feat: generate default language configuration

* feat: remove compare link

* feat: add COC link

* feat(website): update documentation

* feat: use escape hatch syntax to wrap JSX code in MDX files

* style: add prettier

* style: format mdx files

* chore: remove prettier command

* feat: update en docs

* feat: sync Chinese documents

* feat: update doc

* Update website/src/pages/coc.mdx

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2022-09-18 22:01:50 +10:00

132 lines
3.0 KiB
Plaintext

# IDEs
Wails aims to provide a great development experience. To that aim, we now support generating IDE specific configuration
to provide smoother project setup.
Currently, we support [Visual Studio Code](https://code.visualstudio.com/) but aim to support other IDEs such as Goland.
## Visual Studio Code
```mdx-code-block
<p className="text--center">
<img
src={require("@site/static/img/vscode.webp").default}
style={{ width: "75%" }}
/>
</p>
```
When generating a project using the `-ide vscode` flags, IDE files will be created alongside the other project files.
These files are placed into the `.vscode` directory and provide the correct configuration for debugging your application.
The 2 files generated are `tasks.json` and `launch.json`. Below are the files generated for the default vanilla project:
```json title="tasks.json"
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}"
},
"command": "go",
"args": [
"build",
"-tags",
"dev",
"-gcflags",
"all=-N -l",
"-o",
"build/bin/myproject.exe"
]
}
]
}
```
```json title="launch.json"
{
"version": "0.2.0",
"configurations": [
{
"name": "Wails: Debug myproject",
"type": "go",
"request": "launch",
"mode": "exec",
"program": "${workspaceFolder}/build/bin/myproject.exe",
"preLaunchTask": "build",
"cwd": "${workspaceFolder}",
"env": {}
}
]
}
```
### Configuring the install and build steps
The `tasks.json` file is simple for the default project as there is no `npm install` or `npm run build` step needed.
For projects that have a frontend build step, such as the svelte template, we would need to edit `tasks.json` to
add the install and build steps:
```json title="tasks.json"
{
"version": "2.0.0",
"tasks": [
{
"label": "npm install",
"type": "npm",
"script": "install",
"options": {
"cwd": "${workspaceFolder}/frontend"
},
"presentation": {
"clear": true,
"panel": "shared",
"showReuseMessage": false
},
"problemMatcher": []
},
{
"label": "npm run build",
"type": "npm",
"script": "build",
"options": {
"cwd": "${workspaceFolder}/frontend"
},
"presentation": {
"clear": true,
"panel": "shared",
"showReuseMessage": false
},
"problemMatcher": []
},
{
"label": "build",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}"
},
"command": "go",
"args": [
"build",
"-tags",
"dev",
"-gcflags",
"all=-N -l",
"-o",
"build/bin/vscode.exe"
],
"dependsOn": ["npm install", "npm run build"]
}
]
}
```
:::info Future Enhancement
In the future, we hope to generate a `tasks.json` that includes the install and build steps automatically.
:::