From 958ca2d74469a6d624da4edcc2ab369c9b58da91 Mon Sep 17 00:00:00 2001 From: Gourav Bansal Date: Thu, 28 May 2026 17:30:25 +0530 Subject: [PATCH 1/2] feat(jetbrains): in-IDE Welcome + Marketplace listing & custom pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Marketplace surfaces: - plugin.xml : rewrite the listing as a rich, accurate product page (Features / Providers & Models / Privacy & Security / Quick start / Links). Drops the outdated "early scaffold" copy. - docs/marketplace/: standalone markdown for JetBrains Marketplace Custom Pages — Quickstart, Providers & Models, Privacy & Security, FAQ. Paste each into the Marketplace vendor UI. In-IDE Welcome (chat tool window): - Show a Welcome card in the empty transcript until the user has a provider key configured (env-var keys count as configured). - "Configure provider" CTA runs the existing in-chat configure flow via a new `configureProvider` bridge message. - "Learn more" opens the GitHub repo via BrowserUtil through a new `openUrl` bridge message. - Welcome auto-hides on the first message and after a successful configure. Verified: compileKotlin + test + buildPlugin + verifyPlugin all SUCCESSFUL; plugin Compatible against IC-252. Co-Authored-By: Claude Opus 4.7 --- .../toolwindow/CodeSetuToolWindowFactory.kt | 21 ++++ .../src/main/resources/META-INF/plugin.xml | 55 +++++++++- .../src/main/resources/webview/chat.html | 101 ++++++++++++++++++ docs/marketplace/README.md | 20 ++++ docs/marketplace/faq.md | 72 +++++++++++++ docs/marketplace/privacy-and-security.md | 68 ++++++++++++ docs/marketplace/providers-and-models.md | 86 +++++++++++++++ docs/marketplace/quickstart.md | 93 ++++++++++++++++ 8 files changed, 511 insertions(+), 5 deletions(-) create mode 100644 docs/marketplace/README.md create mode 100644 docs/marketplace/faq.md create mode 100644 docs/marketplace/privacy-and-security.md create mode 100644 docs/marketplace/providers-and-models.md create mode 100644 docs/marketplace/quickstart.md diff --git a/apps/jetbrains/src/main/kotlin/ai/codesetu/toolwindow/CodeSetuToolWindowFactory.kt b/apps/jetbrains/src/main/kotlin/ai/codesetu/toolwindow/CodeSetuToolWindowFactory.kt index 932224e..0d2f15e 100644 --- a/apps/jetbrains/src/main/kotlin/ai/codesetu/toolwindow/CodeSetuToolWindowFactory.kt +++ b/apps/jetbrains/src/main/kotlin/ai/codesetu/toolwindow/CodeSetuToolWindowFactory.kt @@ -12,6 +12,7 @@ import ai.codesetu.settings.CodeSetuModelCatalog import ai.codesetu.settings.CodeSetuSettingsState import ai.codesetu.settings.providerDefaults import ai.codesetu.settings.resolveCodeSetuModel +import com.intellij.ide.BrowserUtil import com.intellij.openapi.Disposable import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.application.ReadAction @@ -98,6 +99,11 @@ class CodeSetuChatPanel(private val project: Project) : Disposable { when (obj["type"]?.jsonPrimitive?.contentOrNull) { "ready" -> onReady() "selectModel" -> showModelPicker() + "configureProvider" -> ApplicationManager.getApplication().invokeLater { configureProvider() } + "openUrl" -> { + val url = obj["url"]?.jsonPrimitive?.contentOrNull ?: return + ApplicationManager.getApplication().invokeLater { BrowserUtil.browse(url) } + } "sendMessage" -> { val text = obj["text"]?.jsonPrimitive?.contentOrNull ?: return val include = obj["includeIdeContext"]?.jsonPrimitive?.booleanOrNull ?: true @@ -272,6 +278,7 @@ class CodeSetuChatPanel(private val project: Project) : Disposable { CodeSetuSettingsState.getInstance().setApiKey(token) } pushModelLabel() + pushWelcome() } private fun pushModelLabel() { @@ -303,9 +310,23 @@ class CodeSetuChatPanel(private val project: Project) : Disposable { ready = true pending.forEach { executeJs(it) } pending.clear() + pushWelcome() } } + // The welcome panel shows on first use, when no provider key is configured. + // Once the user has a key (or sends a message), it stays hidden for the + // session. + private fun pushWelcome() { + push(message("welcome") { put("show", !isConfigured()) }) + } + + private fun isConfigured(): Boolean { + if (CodeSetuSettingsState.getInstance().getApiKey().isNotBlank()) return true + return sequenceOf("CODESETU_API_KEY", "SARVAM_API_KEY", "HF_TOKEN") + .any { !System.getenv(it).isNullOrBlank() } + } + private fun executeJs(json: String) { browser.cefBrowser.executeJavaScript("window.__codesetuReceive($json)", browser.cefBrowser.url ?: "", 0) } diff --git a/apps/jetbrains/src/main/resources/META-INF/plugin.xml b/apps/jetbrains/src/main/resources/META-INF/plugin.xml index 7c991c4..9d05303 100644 --- a/apps/jetbrains/src/main/resources/META-INF/plugin.xml +++ b/apps/jetbrains/src/main/resources/META-INF/plugin.xml @@ -4,11 +4,56 @@ CodeSetu Maintainers
- This plugin is in early scaffold. Source: github.com/getcodesetu/codesetu - · Community: Discord +

CodeSetu — Open-source AI coding assistant for JetBrains IDEs

+ +

+ A privacy-aware, multi-provider Copilot / Cursor alternative for Indian developers, + enterprises, public-sector teams, and air-gapped deployments. + Bring your own model. +

+ +

What you get

+
    +
  • Chat tool window — streamed, markdown-rendered replies with rendered code blocks, in a polished CodeSetu webview.
  • +
  • Selected-code actions — Explain, Refactor, Write Tests, Fix Bug, Add Docs, right from the editor context menu.
  • +
  • Repo-aware context — active file, selection, and cursor neighborhood are attached automatically (toggleable per message).
  • +
  • In-chat provider & model switcher — change providers, base URLs, and models without leaving the chat.
  • +
  • Workspace skills & checks — drop .codesetu/skills/*.md and .codesetu/checks/*.md files; they are folded into the system prompt.
  • +
  • Multi-turn conversation history — kept per session.
  • +
+ +

Works with

+
    +
  • Sarvam — Indic-aware hosted models.
  • +
  • Hugging Face — the hosted router (router.huggingface.co/v1), your dedicated Inference Endpoints, or self-hosted TGI. Any served chat model (Llama, Qwen, DeepSeek, Mistral, Gemma…) with your hf_… token.
  • +
  • OpenAI-compatible — Ollama, vLLM, SGLang, OpenRouter, LM Studio, any compatible endpoint.
  • +
  • Self-hosted & air-gapped — bring your own URL. No outbound calls beyond the provider you configure.
  • +
+ +

Privacy & security

+
    +
  • API keys live in the OS PasswordSafe (keychain) — never in plaintext settings XML.
  • +
  • Common secret files (.env*, *.pem, *.key, secrets/, …) are excluded from auto-collected workspace context.
  • +
  • No CodeSetu telemetry. Your prompts go only to the provider you configured.
  • +
  • 100% open-source under Apache 2.0.
  • +
+ +

Quick start

+
    +
  1. Install the plugin and restart the IDE.
  2. +
  3. Open the CodeSetu tool window (right dock).
  4. +
  5. Click the provider · model chip in the composer → Configure provider / endpoint… → pick Sarvam, Hugging Face, or OpenAI-compatible, paste your key, and start chatting.
  6. +
+ +

Selected-code actions: right-click any selection → Explain / Refactor / Write Tests / Fix Bug / Add Docs with CodeSetu.

+ +

Links

+ ]]>
+
@@ -471,6 +555,9 @@ const includeContext = document.getElementById("include-context"); const modelChip = document.getElementById("model-chip"); const modelLabel = document.getElementById("model-label"); + const welcome = document.getElementById("welcome"); + const welcomeConfigure = document.getElementById("welcome-configure"); + const welcomeDocs = document.getElementById("welcome-docs"); let activeAssistantMessage; let activeAssistantRaw = ""; @@ -589,6 +676,8 @@ message.textContent = text; } transcript.appendChild(message); + // First real message hides the welcome panel for the rest of the session. + welcome.hidden = true; message.scrollIntoView({ block: "end", behavior: "smooth" }); return message; } @@ -623,6 +712,14 @@ post({ type: "selectModel" }); }); + welcomeConfigure.addEventListener("click", () => { + post({ type: "configureProvider" }); + }); + + welcomeDocs.addEventListener("click", () => { + post({ type: "openUrl", url: "https://github.com/getcodesetu/codesetu" }); + }); + document.addEventListener("click", (event) => { const target = event.target; if (!(target instanceof Element)) { @@ -681,6 +778,10 @@ modelLabel.textContent = message.text; } + if (message.type === "welcome") { + welcome.hidden = !message.show; + } + if (message.type === "busy") { const isBusy = Boolean(message.value); send.disabled = isBusy; diff --git a/docs/marketplace/README.md b/docs/marketplace/README.md new file mode 100644 index 0000000..3a19174 --- /dev/null +++ b/docs/marketplace/README.md @@ -0,0 +1,20 @@ +# JetBrains Marketplace pages + +Standalone markdown sources for the **JetBrains Marketplace Custom Pages** under +the CodeSetu vendor profile. Paste each file into the corresponding page on +[plugins.jetbrains.com](https://plugins.jetbrains.com) (the Marketplace UI +accepts markdown). + +These pages complement the plugin listing description (which is rendered from +`apps/jetbrains/src/main/resources/META-INF/plugin.xml`). The listing is the +landing page; these are deeper docs. + +| File | Suggested page title | +| -------------------------------------------------- | -------------------- | +| [quickstart.md](quickstart.md) | Quickstart | +| [providers-and-models.md](providers-and-models.md) | Providers & Models | +| [privacy-and-security.md](privacy-and-security.md) | Privacy & Security | +| [faq.md](faq.md) | FAQ | + +Keep these in sync with the plugin description and `INSTALL.md` when you ship a +release. diff --git a/docs/marketplace/faq.md b/docs/marketplace/faq.md new file mode 100644 index 0000000..8875cba --- /dev/null +++ b/docs/marketplace/faq.md @@ -0,0 +1,72 @@ +# FAQ + +## Do I need an account or subscription with CodeSetu? + +No. CodeSetu is open-source (Apache 2.0) and free. You bring your own model +(hosted or local) and your own provider key. + +## Which JetBrains IDEs are supported? + +Anything on the IntelliJ Platform `since-build` 252 or later (IDEA 2025.2+, +and the matching versions of PyCharm, WebStorm, GoLand, Rider, Android Studio, +etc.). The chat tool window uses JCEF, which is bundled with these IDEs. + +## Where is my API key stored? + +In the OS **PasswordSafe** (Keychain on macOS, Credential Manager on Windows, +KWallet / Secret Service on Linux). Never in the plugin's settings XML in +plaintext. Env vars (`SARVAM_API_KEY`, `HF_TOKEN`, `CODESETU_API_KEY`) are also +supported. + +## Does the plugin send any data anywhere besides my provider? + +No. There is no telemetry, no analytics, no third-party endpoints. Every +network call goes to the **Base URL** you configured. + +## Can I use it offline / air-gapped? + +Yes — point **Base URL** at your internal endpoint (TGI, vLLM, Ollama, a +private OpenAI-compatible gateway). Hosted-model defaults are only defaults. + +## Which Hugging Face models work? + +Any chat-capable model **currently served** by an inference provider on the +Hugging Face router (Llama, Qwen, DeepSeek, Mistral, Gemma, …) — bring your +`hf_…` token. For a model not on the router, deploy it to a dedicated Inference +Endpoint (or TGI / vLLM) and point CodeSetu's base URL at it. Embedding, image, +audio, and raw base models won't work as chat — that's a property of the model. + +## Which Ollama / vLLM model should I use? + +Anything you've pulled / served. A practical first pick for coding: +`qwen2.5-coder:7b` on Ollama or a 32B+ Qwen-Coder model on vLLM. Larger is +better for refactors and explanations; smaller is faster for inline use. + +## How do I switch models or providers without restarting? + +Click the **`provider · model` chip** in the composer. The menu has: + +- **⚙ Configure provider / endpoint…** — switch provider and set base + URL / model / token. +- **Enter a custom model id…** — type any model id for the current provider. +- A list of **curated models** for the current provider. + +The next message uses the new model. + +## Does it work with multi-turn conversations? + +Yes — the chat keeps a rolling per-session history. Older turns are dropped +once the transcript grows past a character budget, so long sessions don't +overflow your context window. + +## Why does it ask me to "Include IDE context"? + +For coding questions, the assistant is much more useful with your active file + +selection. The toggle lets you opt out per message — useful for general +questions where you don't want any file content sent to the provider. + +## Where do I report bugs / ask for features? + +[GitHub Issues](https://github.com/getcodesetu/codesetu/issues) for bugs and +feature requests. [Discord](https://discord.gg/sjVKU8cpC6) for chat. Security +disclosures: `SECURITY.md` in the repository. diff --git a/docs/marketplace/privacy-and-security.md b/docs/marketplace/privacy-and-security.md new file mode 100644 index 0000000..c00e4d5 --- /dev/null +++ b/docs/marketplace/privacy-and-security.md @@ -0,0 +1,68 @@ +# Privacy & Security + +CodeSetu is positioned for Indian developers, enterprises, public-sector teams, +and air-gapped deployments — so privacy and security aren't an afterthought. +This page describes exactly what the plugin does with your data and your keys. + +--- + +## API keys + +- Stored in the OS **PasswordSafe** (the IntelliJ Platform CredentialStore that + wraps macOS Keychain / Windows Credential Manager / KWallet / Secret Service). +- **Never** written to the plugin settings XML in plaintext. +- A one-time migration moves any legacy plaintext key out of the settings XML + into PasswordSafe on first run after upgrade. +- You can also supply keys via environment variables (`SARVAM_API_KEY`, + `HF_TOKEN`, `CODESETU_API_KEY`) if you prefer not to enter them into the IDE + at all. + +## Where your prompts go + +- Your prompts and your IDE context are sent **only to the provider you + configured** (the `Base URL` in CodeSetu settings). Nothing is sent to + CodeSetu maintainers. +- The plugin makes **no other network calls**. There is no telemetry, no + metrics service, no usage beacon. + +## What gets sent as "context" + +When **Include IDE context** is on (toggleable per message via the `+` menu in +the composer), each message includes: + +- The path, language, and contents of the **active editor file** (with very + long files trimmed in the middle). +- The current **selection**. +- A **cursor neighborhood** (a few thousand characters around the caret). + +The plugin **excludes likely-secret files** from any auto-collected workspace +snippets: + +- `.env*` +- `*.pem`, `*.key`, `*.pfx`, `*.p12` +- `secrets/**`, `.aws/**` +- `id_rsa*` +- Common build directories (`node_modules`, `dist`, `build`, `.git`) + +If you don't want any of this, untoggle **Include IDE context** in the +composer's `+` menu before sending. + +## Workspace skills & checks + +Files under `.codesetu/skills/*.md` and `.codesetu/checks/*.md` in your +workspace are folded into the system prompt for each chat message. This is the +only place workspace content is read for prompts (besides the active editor +context above). Keep secrets out of these files. + +## Air-gapped use + +Point **Base URL** at your internal gateway (TGI / vLLM / Ollama / a private +OpenAI-compatible proxy). The plugin will only talk to that URL. Hosted-model +defaults are _defaults_, not requirements — you can replace them. + +## Open source + +Apache 2.0. Source at +[github.com/getcodesetu/codesetu](https://github.com/getcodesetu/codesetu). +Audit, fork, or self-host. Security disclosures: see `SECURITY.md` in the +repository. diff --git a/docs/marketplace/providers-and-models.md b/docs/marketplace/providers-and-models.md new file mode 100644 index 0000000..fa9557a --- /dev/null +++ b/docs/marketplace/providers-and-models.md @@ -0,0 +1,86 @@ +# Providers & Models + +CodeSetu is **bring-your-own-model**. It speaks OpenAI's `/v1/chat/completions` +shape, so anything that exposes that endpoint works — hosted, self-hosted, or +on a network you control. + +You configure the provider, base URL, model, and key from the chat tool window +(click the **`provider · model` chip** → **Configure provider / endpoint…**) or +under **Settings → CodeSetu**. + +--- + +## Built-in providers + +### Sarvam + +Indic-aware hosted models from Sarvam AI. + +| Field | Value | +| -------- | --------------------------------------------------- | +| Base URL | `https://api.sarvam.ai/v1` | +| Model | `sarvam-30b` (default) | +| Auth | Sarvam API key | +| Env vars | `SARVAM_API_KEY`, `SARVAM_BASE_URL`, `SARVAM_MODEL` | + +### Hugging Face + +Any **served, chat-capable** model on the Hugging Face Hub — through the hosted +router, your own dedicated Inference Endpoint, or self-hosted TGI. + +| Field | Value | +| ------------------- | --------------------------------------------------------- | +| Base URL (router) | `https://router.huggingface.co/v1` | +| Base URL (endpoint) | `https://.endpoints.huggingface.cloud/v1` | +| Model | any Hub repo id, e.g. `meta-llama/Llama-3.3-70B-Instruct` | +| Auth | Hugging Face token (`hf_…`) | +| Env vars | `HF_TOKEN`, `HF_BASE_URL`, `HF_MODEL` | + +**Curated picks** offered in the in-chat model menu: + +- `meta-llama/Llama-3.3-70B-Instruct` +- `Qwen/Qwen2.5-72B-Instruct` +- `Qwen/Qwen2.5-Coder-32B-Instruct` +- `deepseek-ai/DeepSeek-V3-0324` +- `meta-llama/Llama-3.1-8B-Instruct` +- `google/gemma-2-27b-it` +- `mistralai/Mistral-Small-24B-Instruct-2501` + +You can always type a **custom model id** for anything else (or for a model +deployed to your own endpoint). + +### OpenAI-compatible (Ollama, vLLM, SGLang, OpenRouter, LM Studio, local) + +Anything that exposes `/v1/chat/completions`. + +| Field | Value | +| -------- | --------------------------------------------------------------------------------------- | +| Base URL | e.g. `http://localhost:11434/v1` (Ollama), `https://openrouter.ai/api/v1`, your own URL | +| Model | e.g. `qwen2.5-coder:7b`, `llama3.1:8b`, an OpenRouter id, … | +| Auth | the endpoint's API key (`ollama` for local Ollama) | +| Env vars | `CODESETU_API_KEY`, `CODESETU_BASE_URL`, `CODESETU_MODEL` | + +--- + +## What "any model" means — the honest boundary + +- **Chat with any served chat-capable LLM.** Llama, Qwen, DeepSeek, Mistral, + Gemma, etc. — anything an inference provider currently exposes on the + Hugging Face router, or that you deploy yourself. +- **Not every model on the Hub.** Models nobody is currently serving aren't + reachable via the router; you'd need to deploy them yourself (dedicated + endpoint or TGI/vLLM). +- **Only chat-capable models.** Embedding models, image / audio / diffusion + models, and raw base models without a chat template won't work in chat — + that's a property of the model itself. + +For anything not on the router, run TGI / vLLM / Ollama and point CodeSetu's +base URL at it. + +--- + +## Air-gapped & enterprise + +CodeSetu makes **no calls outside the provider you configured**. Point the base +URL at your internal gateway / TGI / vLLM cluster and it will work entirely on +your network. There is no CodeSetu telemetry. diff --git a/docs/marketplace/quickstart.md b/docs/marketplace/quickstart.md new file mode 100644 index 0000000..26bb285 --- /dev/null +++ b/docs/marketplace/quickstart.md @@ -0,0 +1,93 @@ +# Quickstart + +CodeSetu is a multi-provider AI coding assistant for JetBrains IDEs. You bring +the model — local or hosted — and chat with it from a dedicated tool window, +with selected-code actions in the editor. + +This page gets you from a fresh install to a working chat in **under two +minutes**, against the provider of your choice. + +--- + +## 1. Install + +- Open **Settings → Plugins → Marketplace**, search for **CodeSetu**, install, + and restart the IDE. +- Or install the `.zip` from GitHub via **Settings → Plugins → ⚙ → Install + Plugin from Disk…**. + +## 2. Open the tool window + +Open the **CodeSetu** tool window on the right dock. You'll see the chat +composer with a `provider · model` chip — that chip is your control surface. + +## 3. Configure a provider + +Click the **`provider · model` chip** in the composer and choose **⚙ Configure +provider / endpoint…**. Pick one of: + +### Sarvam (Indic-aware hosted) + +- Base URL: `https://api.sarvam.ai/v1` +- Model: `sarvam-30b` (or another Sarvam model) +- API key: your Sarvam API key + +### Hugging Face (any served chat model) + +- Base URL: `https://router.huggingface.co/v1` (or your dedicated endpoint URL) +- Model: any served Hugging Face repo id, e.g. `meta-llama/Llama-3.3-70B-Instruct`, + `Qwen/Qwen2.5-72B-Instruct`, `deepseek-ai/DeepSeek-V3-0324` +- API key: your Hugging Face token (`hf_…`) + +### OpenAI-compatible — Ollama / vLLM / local + +- Base URL: `http://localhost:11434/v1` (Ollama default; change to your server) +- Model: e.g. `qwen2.5-coder:7b`, `llama3.1:8b`, or whatever you've pulled +- API key: `ollama` for a local Ollama server, otherwise the API key for your + endpoint + +Your key is stored in the OS **PasswordSafe** (keychain) — never in plaintext +settings. + +## 4. Chat + +Type a message in the composer and click the send button (the up arrow), or +click the **`+`** menu to toggle whether to include your active editor as IDE +context. + +The assistant streams its reply with rendered markdown — fenced code blocks, +bold, inline code, and bullet lists all render. + +## 5. Selected-code actions + +In any editor, select some code → right-click → pick one of: + +- **Explain with CodeSetu** +- **Refactor with CodeSetu** +- **Write Tests with CodeSetu** +- **Fix Bug with CodeSetu** +- **Add Docs with CodeSetu** + +The chat tool window opens with the answer. + +## 6. Switch models on the fly + +Click the chip again any time: + +- Pick a **curated model** from the list, +- type a **custom model id** (any Hub repo id, any endpoint model), +- or re-run **Configure provider / endpoint…** to move between providers. + +The next message uses the new model. No restart, no settings detour. + +--- + +## Tips + +- **Workspace skills & checks** — drop `.codesetu/skills/*.md` and + `.codesetu/checks/*.md` files at the root of your project; their bodies are + folded into the system prompt. +- **Air-gapped?** Point the base URL at your own endpoint (TGI, vLLM, Ollama, + internal gateway). Nothing leaves your network. +- **Privacy:** prompts go only to the provider you configured. CodeSetu has no + telemetry. From 14ca7cfee44b98c91b2bdf21af8f58c3b6c10487 Mon Sep 17 00:00:00 2001 From: Gourav Bansal Date: Thu, 28 May 2026 17:44:23 +0530 Subject: [PATCH 2/2] docs: richer in-IDE Welcome panel + Examples Marketplace page - Expand the in-IDE Welcome card with a proper description, a 3-step setup, bullet-point feature highlights, and a Try-these-prompts list (Understand / Refactor / Test / Debug / Document / Translate / Generate). Adds an Include-IDE-context tip. - Add docs/marketplace/examples.md: anatomy of a request, selected-code actions, copy-paste prompts by task category, workspace skills example, and usage tips. Link it from the marketplace README. Verified: buildPlugin + verifyPlugin SUCCESSFUL; plugin Compatible against IC-252; welcome content present in the shipped jar. Co-Authored-By: Claude Opus 4.7 --- .../src/main/resources/webview/chat.html | 115 ++++++++++++++-- docs/marketplace/README.md | 1 + docs/marketplace/examples.md | 125 ++++++++++++++++++ 3 files changed, 231 insertions(+), 10 deletions(-) create mode 100644 docs/marketplace/examples.md diff --git a/apps/jetbrains/src/main/resources/webview/chat.html b/apps/jetbrains/src/main/resources/webview/chat.html index 387c71c..66fa4fe 100644 --- a/apps/jetbrains/src/main/resources/webview/chat.html +++ b/apps/jetbrains/src/main/resources/webview/chat.html @@ -124,20 +124,52 @@ line-height: 1.25; } + .welcome-card h3 { + margin: 14px 0 6px; + font-size: 11px; + font-weight: 600; + letter-spacing: 0.6px; + text-transform: uppercase; + color: var(--vscode-descriptionForeground); + } + .welcome-card p { margin: 0 0 10px; color: var(--vscode-descriptionForeground); } - .welcome-steps { - margin: 0 0 12px 18px; + .welcome-steps, + .welcome-bullets { + margin: 0 0 8px 18px; padding: 0; } - .welcome-steps li { + .welcome-steps li, + .welcome-bullets li { margin: 4px 0; } + .welcome-bullets b { + color: var(--vscode-foreground); + } + + .welcome-bullets code { + font-family: var(--vscode-editor-font-family, monospace); + font-size: 0.92em; + padding: 1px 4px; + border-radius: 4px; + background: var(--vscode-textCodeBlock-background, rgba(127, 127, 127, 0.12)); + } + + .welcome-tip { + margin: 12px 0 0; + padding: 8px 10px; + border-radius: 6px; + background: var(--vscode-textCodeBlock-background, rgba(127, 127, 127, 0.08)); + color: var(--vscode-foreground); + font-size: 0.95em; + } + .welcome-actions { display: flex; gap: 10px; @@ -461,19 +493,82 @@ diff --git a/docs/marketplace/README.md b/docs/marketplace/README.md index 3a19174..0ec0e21 100644 --- a/docs/marketplace/README.md +++ b/docs/marketplace/README.md @@ -12,6 +12,7 @@ landing page; these are deeper docs. | File | Suggested page title | | -------------------------------------------------- | -------------------- | | [quickstart.md](quickstart.md) | Quickstart | +| [examples.md](examples.md) | Examples | | [providers-and-models.md](providers-and-models.md) | Providers & Models | | [privacy-and-security.md](privacy-and-security.md) | Privacy & Security | | [faq.md](faq.md) | FAQ | diff --git a/docs/marketplace/examples.md b/docs/marketplace/examples.md new file mode 100644 index 0000000..e851c08 --- /dev/null +++ b/docs/marketplace/examples.md @@ -0,0 +1,125 @@ +# Examples + +How to actually use CodeSetu day-to-day — patterns that work well, with +example prompts you can paste verbatim. + +--- + +## Anatomy of a CodeSetu request + +When you send a chat message, CodeSetu automatically attaches: + +- The **path, language, and contents** of your active editor file + (trimmed in the middle if the file is huge). +- Your **current selection**. +- A **cursor neighborhood** — a few thousand characters around the caret. + +So short, specific prompts work — you don't have to paste your code. The +assistant already sees it. + +> Don't want any of this on a particular message? Open the **+** menu in the +> composer and toggle **Include IDE context** off. + +--- + +## The fastest path — selected-code actions + +Select a function or block in the editor → **right-click** → pick one: + +- **Explain with CodeSetu** — structured walkthrough of what it does, key + control flow, inputs/outputs, risks. +- **Refactor with CodeSetu** — focused refactor proposal with the trade-offs + called out. +- **Write Tests with CodeSetu** — happy path plus edge cases. +- **Fix Bug with CodeSetu** — diagnoses the likely issue plus a minimal patch. +- **Add Docs with CodeSetu** — idiomatic doc comments for the language. + +The chat tool window opens with the answer streamed in. + +--- + +## Useful chat prompts + +### Code understanding + +- "Explain what this file does and how the main function fits in." +- "What's the time and space complexity of the selected function?" +- "Trace what happens when this handler is called with an empty list." + +### Refactoring + +- "Refactor the selected function for readability without changing behavior. List the changes you made." +- "Extract the selected block into a well-named helper. Show the full updated file." +- "Replace the nested if/else with a switch (or early returns) — whichever is clearer." + +### Testing + +- "Write Jest unit tests for the selected function. Cover happy path and edge cases." +- "Add a test for what happens when the input list is empty." +- "Generate a property-based test for the selected pure function." + +### Debugging + +- "What might cause this function to throw a null-pointer exception? Give the smallest safe fix." +- "Why is this test failing? Walk through the assertion that breaks." +- "Add logging at the right spots to find where the value diverges from what I expect." + +### Documentation + +- "Add JSDoc comments to the selected function — describe each parameter and the return value." +- "Write a brief README section for this module: install, usage, and a code example." +- "Generate an API reference for the selected class." + +### Translation / migration + +- "Translate the selected Python function to TypeScript with equivalent types." +- "Convert this synchronous code to async/await." +- "Port the selected callback-based code to use Promises." + +### Generation + +- "Generate a regex that matches Indian phone numbers (+91, 10 digits, optional spaces)." +- "Give me a SQL query that joins users and orders, grouped by month, last 90 days." +- "Write a small CLI in Go that prints `Hello, !` from a flag." + +--- + +## Workspace skills — make the assistant follow your conventions + +Drop a `.codesetu/skills/code-style.md` file at the root of your project: + +```markdown +--- +id: code-style +name: Code style +description: Apply our team's style. +--- + +Follow these rules when suggesting code: + +- TypeScript: prefer `type` over `interface` for unions. +- Functions: keep under 40 lines, single responsibility. +- Imports: absolute paths via `@/`. +- Tests: arrange / act / assert blocks separated by blank lines. +``` + +That body is folded into the system prompt for **every** message, so the +assistant follows your conventions without you re-prompting. + +You can also drop `.codesetu/checks/*.md` files for review-style guidance. + +--- + +## Tips + +- **Toggle "Include IDE context" off** for general questions that have nothing + to do with your code — keeps prompts small. +- **Switch model for the task** — small/fast for tiny edits, larger for + refactors. Click the chip → **Custom model id…** to use any model your + provider serves. +- **Multi-turn works** — follow-ups in the same session remember earlier turns. +- **Click Send (↑)** to submit; the composer is multi-line, so plain Enter + inserts a newline. +- **Configure once, then switch easily** — click the chip → **⚙ Configure + provider / endpoint…** for the full set-up flow; the **Enter a custom model + id…** option lets you jump between models quickly.