diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..c3d95be --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,70 @@ +# Copilot / AI agent instructions for the Kusto Explorer VS Code repo + +These instructions guide AI coding agents (and the developers driving them) when working **on this +codebase**. They are not the end-user KQL assistant prompt — that lives in +[`src/Client/instructions.md`](../src/Client/instructions.md) and is shipped to users at runtime. Keep +the two separate. + +For the full "why" behind everything below, read [`ARCHITECTURE.md`](../ARCHITECTURE.md). When a change +contradicts these rules, prefer the architecture doc and update both. + +## What this project is + +A VS Code extension that mimics the desktop **Kusto Explorer** app: edit multi-query `.kql` files, run +queries, and view results as tables and charts. Scope is intentionally **partial**; the roadmap is +driven by community feedback, not a fixed plan. Don't invent features — match how the desktop app feels +and prefer small, focused changes. + +## Architecture rules an agent must respect + +- **Two processes, on purpose.** A TypeScript extension host (`src/Client`) talks to a C# .NET + language server (`src/Server`) over LSP (StreamJsonRpc on stdio) plus custom `kusto/*` JSON-RPC + methods. KQL parsing/analysis lives in the **C# server** because the native `Kusto.Language` parser + is ~50x faster than the JS translation. **Do not** reimplement KQL parsing/analysis in TypeScript, + and add cross-process calls through the existing LSP / `kusto/*` seam — not new side channels. +- **Data model vs. UI component split.** Each feature is usually two modules: a testable + `*Manager`-style **data model** (state + logic, no VS Code UI) and a `*Panel` / `*Editor` / `*Provider` + **UI component**. Put new logic where it can be unit-tested without a webview. A filename like + `panel`, `editor`, `viewer`, or `statusBar` means it's the UI half. +- **Provider model for result content.** The results editor delegates visually distinct content + (tabular, chart, query text) to providers that each emit HTML into their own `
`. Charts sit + behind a single `IChartProvider` seam with multiple implementations (`plotly`, `timePivot`, `graph`) + joined by `compositeChartProvider`. Add new result/chart surfaces behind this seam — don't bolt them + onto the editor. +- **Webview house style.** Webview UIs build an HTML **string** with inline `