Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>G1 CodeNew to Visual Studio Code? Get it now.
G1 Code

G1 Code

G1Code

|
39 installs
| (0) | Free
Sync and upload G1 custom code from VS Code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

G1 Code

G1 Code is a VS Code extension for maintaining G1 custom code files.

Features

  • Upload the current editor file to G1.
  • Upload files from the Explorer context menu.
  • Sync custom code from G1 into the current workspace.
  • Upload resource/ files through the G1 resource endpoint.
  • Maintain dependency-aware custom JavaScript modules through a root-level g1.modules.json file.

Custom JavaScript Modules

Domains can opt in selected global callback scripts without changing legacy scripts. Add g1.modules.json at the workspace root:

{
  "version": 1,
  "modules": [
    {
      "id": "domain_common",
      "phase": "core-ready",
      "dependsOn": []
    },
    {
      "id": "domain_portal",
      "phase": "index-ready",
      "dependsOn": ["domain_common"]
    }
  ]
}

The extension validates the basic JSON structure before upload. G1 performs the authoritative checks for missing code, missing dependencies and dependency cycles. Scripts not listed in the manifest keep their legacy behavior.

Workspace Settings

Create or update .vscode/settings.json in the custom-code workspace:

{
  "settings.serverAddress": "https://dev.gainit.cn",
  "settings.domain": "your_domain",
  "settings.token": "your_g1_token"
}

Commands

  • G1 Code: Upload To G1
  • G1 Code: Sync from G1

Notes

When syncing from G1, existing local files with different content are renamed with a .local suffix before the server version is written.

Select the workspace root when performing a full sync. The extension sends an empty server directory for the selected root and only sends relative paths for selected subdirectories; local absolute paths are never sent as G1 directories.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft