When opening global rule markdown files located in ~/.gemini/config/rules/, Antigravity IDE falls back to the default Monaco raw Markdown text editor rather than routing the file through the dedicated Rule Editor (antigravity.ruleEditor) webview. In contrast, workspace rules inside <workspace>/.agents/rules/ correctly open in the custom GUI Rule Editor.
Steps to Reproduce
- Create or open any rule markdown file located in
~/.gemini/config/rules/(e.g.,~/.gemini/config/rules/python-standards.md). - Observe that the file opens in the default Monaco raw Markdown editor.
- Right-click the tab or press
Ctrl+Shift+P→ View: Reopen Editor With…. - Observe that “Rule Editor” is missing from the list of available custom editors.
- Open any workspace-level rule (e.g.,
<project-root>/.agents/rules/my-rule.md) and observe that it automatically opens in the custom Rule Editor with dedicated GUI fields (Activation Mode, Glob Pattern / Description, and Content).
Observed Behavior
- Global Rules Fallback: Global rule files (
~/.gemini/config/rules/*.md) open strictly as raw Markdown text files. - Asymmetrical Custom Editor Registration: The custom Rule Editor webview is completely inaccessible for global rules, even via the “Reopen Editor With…” picker.
Expected Behavior
- Files matching
~/.gemini/config/rules/**/*.mdand~/.gemini/rules/**/*.mdshould automatically open in the GUI Rule Editor, matching the behavior of workspace rules. - “Rule Editor” should be registered as an available custom editor for all rule directories recognized by the Antigravity engine.
Root Cause Analysis (Code References)
Inspection of the built-in Antigravity extension manifest:
resources/app/extensions/antigravity/package.json
Under contributes.customEditors:
"customEditors": [
{
"viewType": "antigravity.workflowEditor",
"displayName": "Workflow Editor",
"selector": [
{ "filenamePattern": "**/.agent/workflows/**/*.md" },
{ "filenamePattern": "**/_agent/workflows/**/*.md" },
{ "filenamePattern": "**/.agents/workflows/**/*.md" },
{ "filenamePattern": "**/_agents/workflows/**/*.md" },
{ "filenamePattern": "**/.gemini/jetski*/global_workflows/*.md" },
{ "filenamePattern": "**/.gemini/antigravity*/global_workflows/*.md" }
],
"priority": "default"
},
{
"viewType": "antigravity.ruleEditor",
"displayName": "Rule Editor",
"selector": [
{ "filenamePattern": "**/.agent/rules/**/*.md" },
{ "filenamePattern": "**/_agent/rules/**/*.md" },
{ "filenamePattern": "**/.agents/rules/**/*.md" },
{ "filenamePattern": "**/_agents/rules/**/*.md" }
],
"priority": "default"
}
]
- Omission in
antigravity.ruleEditor: Whileantigravity.workflowEditorregisters global paths (**/.gemini/.../global_workflows/*.md),antigravity.ruleEditoronly accounts for workspace folder permutations (.agent,_agent,.agents,_agents). - Missing Global Path Selectors: Global rule directories (
**/.gemini/config/rules/**/*.mdand**/.gemini/rules/**/*.md) were omitted from the selector array.
Suggested Fix
Update contributes.customEditors for antigravity.ruleEditor in package.json to include the global rule directories:
{
"viewType": "antigravity.ruleEditor",
"displayName": "Rule Editor",
"selector": [
{ "filenamePattern": "**/.agent/rules/**/*.md" },
{ "filenamePattern": "**/_agent/rules/**/*.md" },
{ "filenamePattern": "**/.agents/rules/**/*.md" },
{ "filenamePattern": "**/_agents/rules/**/*.md" },
{ "filenamePattern": "**/.gemini/config/rules/**/*.md" },
{ "filenamePattern": "**/.gemini/rules/**/*.md" }
],
"priority": "default"
}
Verified User Workaround
Injecting editor associations into the user settings.json resolves the issue immediately:
"workbench.editorAssociations": {
"**/.gemini/config/rules/**/*.md": "antigravity.ruleEditor",
"**/.gemini/rules/**/*.md": "antigravity.ruleEditor"
}
Related Issue (Bonus)
“Copy path” button in User Settings > Customizations fails silently on Windows:
- Location: Settings panel under both “Skills” and “Rules” cards.
- Symptom: Clicking the copy icon triggers the “Copied” tooltip state, but nothing is written to the system clipboard.
- Cause: Embedded Electron webview calling
navigator.clipboard.writeText()without active focus or IPC delegation, and virtual rule items (user_global) passing unresolved identifiers rather than file paths.
Environment
- IDE: Antigravity IDE 2.0.3+
- OS: Windows 11 (High-DPI)