Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Code StyleNew to Visual Studio Code? Get it now.
Code Style

Code Style

System CN

|
10 installs
| (1) | Free
Format code using Eclipse formatter settings (supports code style exported from IntelliJ IDEA).
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Code Style (VS Code Extension)

中文说明

该扩展通过 code.style.settings.url 指定的 Eclipse 格式化 XML(可由 IntelliJ IDEA 导出)来格式化代码。

使用方式

  1. 在设置中配置 code.style.settings.url(URL 或本地路径)。
  2. 按需启用各语言格式化开关:
    • code.style.format.enable.java
    • code.style.format.enable.javascript
    • code.style.format.enable.typescript
    • code.style.format.enable.html
    • code.style.format.enable.jsp
    • code.style.format.enable.jspx
    • code.style.format.enable.vue
    • code.style.format.enable.php

全文格式化与选区格式化

  • 全文格式化

    • 使用 VS Code 命令 Format Document(或命令 Code Style: Format Document)。
    • 扩展会基于 code.style.settings.url 对整个文件进行格式化。
  • 选区格式化

    • 先选中代码,再执行 VS Code 命令 Format Selection。
    • 扩展仅格式化选中内容。
    • Java 选区按语句模式格式化;JS/TS/HTML/JSP/JSPX/Vue 选区按对应语言流程格式化。

VSIX 安装说明

  • 安装或更新 VSIX 后,扩展会弹出提示,建议点击 Reload Window(重新加载窗口),以便立即应用本地化信息。
  • 若未立即刷新,也可手动执行命令:Developer: Reload Window。

English

This extension formats code using the Eclipse formatter XML configured by code.style.settings.url (can be exported from IntelliJ IDEA).

Usage

  1. Set code.style.settings.url (URL or local path).
  2. Enable formatting toggles for the languages you need:
    • code.style.format.enable.java
    • code.style.format.enable.javascript
    • code.style.format.enable.typescript
    • code.style.format.enable.html
    • code.style.format.enable.jsp
    • code.style.format.enable.jspx
    • code.style.format.enable.vue
    • code.style.format.enable.php

Whole Document vs Selected Range

  • Whole document formatting

    • Use VS Code command Format Document (or Code Style: Format Document).
    • The extension formats the full file using rules mapped from code.style.settings.url.
  • Selected range formatting

    • Select a code block, then run Format Selection.
    • Only the selected text is formatted.
    • Java selections use statement mode; JS/TS/HTML/JSP/JSPX/Vue selections follow their language-specific pipeline.

VSIX installation note

  • After installing/updating via VSIX, the extension prompts you to click Reload Window so localization updates apply immediately.
  • If not refreshed yet, run Developer: Reload Window manually.

Development

  • Build the bundled Java formatter runtime once:
    • npm run build:formatter
  • Compile the extension:
    • npm run compile
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft