You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli): add support for JetBrains editors during the editor setup question (#2204)
Closes#1987
This PR adds JetBrains editors as an option during the editor setup
step.
As of writing this, the PR simply writes the Oxc plugin ID to
`.idea/externalDependencies.xml`. I plan to go through editor settings
(for WebStorm at least) to evaluate which keys are relevant to Oxc and
should be set, hence the draft status.
## Up for debate
- Should the option be named "JetBrains (IntelliJ, WebStorm, etc)" or is
just "WebStorm"/"IntelliJ" enough in the menu?
- ~~The CLI also writes `intellij.vitejs` to the `externalDependencies`
file. Should this remain in the PR? I'm not confident it supports Vite+
properly.~~ Removed pending better integration from JetBrains' side
- Currently the system is a bit hacky given that all other editors read
JSON instead of XML. If this becomes a consistent problem (as in,
editors start having their own different file formats), then it may be
better to rewrite the system a bit so that the file type is
automatically detected from the file extension, and all that needs to be
supplied to the entry in EDITORS is a key noting the name of the file,
and an object describing the shape of the file, with the writing stage
formatting it to the expected file type inferred from the file extension
before putting it in the file.
- ~~It should not 100% work with merging with existing
externalDependencies.xml files yet (already having some changes lined up
to get this properly working)~~ turns out merging the XML configs is
extremely complicated!
- ~~Should the CLI also try and set up the JS runtime & package manager
options?~~ package manager is set to pnpm by default and it should point
to the Vite+ Node shim)
Copy file name to clipboardExpand all lines: docs/guide/ide-integration.md
+56Lines changed: 56 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,3 +100,59 @@ You can also manually set up the Zed config:
100
100
```
101
101
102
102
Setting `oxfmt.fmt.configPath` to `./vite.config.ts` keeps editor format-on-save aligned with the `fmt` block in your Vite+ config. The full generated config covers additional languages (CSS, HTML, JSON, Markdown, etc.) — run `vp create` or `vp migrate` to get the complete file written automatically.
103
+
104
+
## JetBrains (IntelliJ, WebStorm, etc...)
105
+
106
+
For the best Vite+ experience with JetBrains IDEs such as IntelliJ & WebStorm, install the [Oxc](https://plugins.jetbrains.com/plugin/27061-oxc) plugin from the JetBrains marketplace.
107
+
108
+
When you create or migrate a project, Vite+ prompts you to choose whether you want the editor config written for JetBrains IDEs.
109
+
110
+
::: tip Vite+ does not merge with existing config files
111
+
Due to some complexities with merging XML files, Vite+ currently does not merge your current files if the files already exist.
112
+
You'll be given the opportunity to replace any existing files, instead of merging.
113
+
:::
114
+
115
+
You can also manually set up the IDE configuration to match your Vite+ setup:
"javascript.nodejs.core.library.configured.version": "24.18.0", // Replace with your selected Node.js version
135
+
"javascript.nodejs.core.library.typings.version": "24.13.3", // Replace with the version of @types/node that corresponds to your runtime (or omit if you don't want it)
Often, `.idea` folders are gitignored in a project, even the `externalDependencies.xml` file. Adding the `.idea/.gitignore` file with the following content will help ensure that it is present:
0 commit comments