VSCode Extension for Geode
Full-featured GQL and Cypher support for Geode in Visual Studio Code, with syntax highlighting, snippets, language server diagnostics, and query execution.
Features
Language Support
- Syntax Highlighting for GQL/Cypher via TextMate grammar
- Code Snippets for common query patterns
- Language Server for diagnostics, hover docs, and completions
Query Execution
- Run Query: Execute the current file (
Ctrl+Enter/Cmd+Enter) - Run Selection: Execute selected text (
Ctrl+Shift+Enter) - Explain Query: View execution plan
Editor Integration
- Status Bar: Connection status and LSP indicator
- Documentation Panel: Built-in GQL reference
- Context Menus: Right-click to run queries
Installation
Prerequisites
Geode must be installed and in your PATH:
git clone https://gitlab.com/devnw/codepros/geode/geode.git
cd geode && make build
export PATH="$PWD/zig-out/bin:$PATH"
Build and Install VSIX (Recommended for Testing)
npm install
npm run compile
npm run package
code --install-extension geode-gql-1.0.0.vsix
Development Mode (F5 Debugging)
- Open the repository in VS Code
- Run
npm install - Press
F5to launch Extension Development Host - Open a
.gqlfile in the new window
Using Make
make install
make dev
Usage
Keyboard Shortcuts
| Action | Windows/Linux | macOS |
|---|---|---|
| Run Query | Ctrl+Enter | Cmd+Enter |
| Run Selection | Ctrl+Shift+Enter | Cmd+Shift+Enter |
| Format Document | Shift+Alt+F | Shift+Option+F |
Commands (Command Palette)
Geode: Run GQL QueryGeode: Run Selected QueryGeode: Explain Query PlanGeode: Connect to Geode ServerGeode: Show GQL DocumentationGeode: Restart Language Server
Snippets
Common snippet prefixes include: match, matchw, matchr, create, merge, set, delete, vdist, vknn, groupby, case, shortest.
Configuration
{
"geode.lsp.enabled": true,
"geode.lsp.path": "geode",
"geode.server.host": "localhost",
"geode.server.port": 3141,
"geode.server.autoConnect": false,
"geode.query.timeout": 30000,
"geode.format.keywordCase": "upper"
}
Troubleshooting
LSP Not Starting
- Verify Geode is installed:
geode lsp --help - Check Output panel: View -> Output -> “Geode GQL”
- Verify
geode.lsp.path
No Syntax Highlighting
- Confirm file extension:
.gql,.cypher,.gcypher, or.pgql - Verify language mode shows “GQL” or “Cypher”
- Use Command Palette -> “Change Language Mode”
Query Execution Fails
- Ensure server is running:
geode serve - Check host/port settings
- Run
Geode: Connect to Geode Server
Supported File Types
| Extension | Language ID |
|---|---|
.gql | gql |
.gcypher | gql |
.pgql | gql |
.cypher | cypher |
Repository
- GitLab: devnw/geode/geode-vscode