Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 37 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,49 @@

### Added

- **RBS-aware inspections** — `Check Current File`, `Safe Fix`, `Aggressive Fix` and `Check Entire Workspace` now auto-detect RBS via `sig/*.rbs`, `Gemfile.lock` / `Gemfile` or explicit `docscribe.yml` `rbs.enabled` and forward `--rbs` / `--rbs-collection` to both daemon (`cli_overrides`) and CLI fallback. New `RbsDetector` with `rbsHash` for cache invalidation.
- **Doctor RBS status** — `DocScribe Doctor` now shows `RBS: sig/`, `rbs gem`, `rbs_collection.lock.yaml` and `rbs.enabled` (via `RbsDetector.shouldUseRbs`).
- **Annotator cache invalidation on RBS changes** — `DocscribeAnnotator.configHash` now includes `RbsDetector.rbsHash(projectDir)` (+ `hideCommentsByDefault`), so editing `sig/*.rbs` without touching Ruby files correctly invalidates the cache.
- **MCP API for testing** — new `DocScribeMcpToolset` (`com.intellij.mcpserver.McpToolset`) exposing 6 tools `docscribe_check_file`, `docscribe_check_workspace`, `docscribe_safe_fix`, `docscribe_aggressive_fix`, `docscribe_update_types`, `docscribe_doctor` via JetBrains MCP (`stream`/`sse`/`stdio` on `http://127.0.0.1:64502`). Registered in `withMcpServer.xml` (`com.intellij.mcpServer` optional).
- **i18n** — English and Russian localizations for actions and settings via `messages.DocScribeBundle` (`DocScribeBundle.properties` + `DocScribeBundle_ru.properties`) and `<resource-bundle>messages.DocScribeBundle</resource-bundle>` in `plugin.xml`.
- **RBS-aware inspections** — `Check Current File`, `Safe Fix`, `Aggressive Fix` and `Check Entire Workspace` now
auto-detect RBS via `sig/*.rbs`, `Gemfile.lock` / `Gemfile` or explicit `docscribe.yml` `rbs.enabled` and forward
`--rbs` / `--rbs-collection` to both daemon (`cli_overrides`) and CLI fallback. New `RbsDetector` with `rbsHash` for
cache invalidation.
- **Doctor RBS status** — `DocScribe Doctor` now shows `RBS: sig/`, `rbs gem`, `rbs_collection.lock.yaml` and
`rbs.enabled` (via `RbsDetector.shouldUseRbs`).
- **Annotator cache invalidation on RBS changes** — `DocscribeAnnotator.configHash` now includes
`RbsDetector.rbsHash(projectDir)` (+ `hideCommentsByDefault`), so editing `sig/*.rbs` without touching Ruby files
correctly invalidates the cache.
- **MCP API for testing** — new `DocScribeMcpToolset` (`com.intellij.mcpserver.McpToolset`) exposing 6 tools
`docscribe_check_file`, `docscribe_check_workspace`, `docscribe_safe_fix`, `docscribe_aggressive_fix`,
`docscribe_update_types`, `docscribe_doctor` via JetBrains MCP (`stream`/`sse`/`stdio` on `http://127.0.0.1:64502`).
Registered in `withMcpServer.xml` (`com.intellij.mcpServer` optional).
- **Invalid YARD type validation** — new `warnOnInvalidYardTypes` setting + checkbox, forwards `--validate-types` to
daemon (`cli_overrides`) and CLI fallback. `InvalidType` offense underlines YARD type line with direct fix.
- **File-scoped Update Types** — `RunOptions` gains `file` param, daemon `update_types` sends `{dir,file}` for
single-file sync.
- **Source field routing** — `ParsedOffense.source` (`rbs|infer|syntax`) routes annotation text and fix strategy.
- **Error display** — gem-missing / config errors show `BALLOON` `WARNING` with `Add to Gemfile` action instead of red
squiggle, fatal stays `ERROR`.
- **i18n** — English and Russian localizations for actions and settings via `messages.DocScribeBundle`
(`DocScribeBundle.properties` + `DocScribeBundle_ru.properties`) and
`<resource-bundle>messages.DocScribeBundle</resource-bundle>` in `plugin.xml`.

### Fixed

- **Update Types from RBS via daemon** — `DocscribeDaemon` now sends `dir` + `cli_overrides` for `update_types` RPC and falls back to CLI on `Unknown method: update_types` (`-32601`) for old daemons (< 1.6.2). Fixed `performRpcCall` to forward `params` for `update_types`.
- **Companion object warning** — `DocscribeAnnotator` `fileGeneration` map now suppressed with `// noinspection CompanionObjectInExtension` + `@Suppress("CompanionObjectInExtension")` (IDE inspection `Companion objects in IDE extensions may only contain a logger and constants`).
- **RBS underline YARD line** — RBS-inferred offenses underline YARD type line, not `def` line.
- **Safe fix UX** — safe fix reports applied count and refreshes annotations without stale squiggles.
- **Update Types exit 1 + daemon fallback** — `update_types` treats exit `1` as success-with-changes and falls back to
CLI on daemon error.
- **Doctor stale cache** — `DocScribe Doctor` clears cached gem check before re-probing version and daemon state.
- **MCP not loading** — fixed `McpToolset` registration so `docscribe_*` tools load via JetBrains MCP.
- **collectRubyFiles synced with CLI filter** — `collectRubyFiles` matches CLI filter (`27 vs 32` mismatch fixed).
- **Update Types from RBS via daemon** — `DocscribeDaemon` now sends `dir` + `cli_overrides` for `update_types` RPC and
falls back to CLI on `Unknown method: update_types` (`-32601`) for old daemons (< 1.6.2). Fixed `performRpcCall` to
forward `params` for `update_types`.
- **Companion object warning** — `DocscribeAnnotator` `fileGeneration` map now suppressed with
`// noinspection CompanionObjectInExtension` + `@Suppress("CompanionObjectInExtension")` (IDE inspection
`Companion objects in IDE extensions may only contain a logger and constants`).

### Changed

- **Requires docscribe >= 1.6.2** — new API (`--validate-types`, `source`, file-scoped `update_types`).
- **Version** bumped from `0.1.6` to `0.1.7`.

## [0.1.6] — 2026-08-16
Expand Down
28 changes: 20 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@

**DocScribe** is a RubyMine plugin that auto-generates inline YARD documentation for Ruby methods
using [docscribe](https://github.com/unurgunite/docscribe) — a Ruby gem that analyzes AST and suggests YARD-compatible
documentation. Compatible with **docscribe >= 1.4.0** (daemon mode requires >= 1.5.1).
documentation. Compatible with **docscribe >= 1.4.0** (daemon mode requires >= 1.5.1; validate-types, source routing and
file-scoped update require >= 1.6.2).

> Also, available for [VS Code](https://github.com/FlorexLabs/docscribe-vscode) on
> the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=FlorexLabs.docscribe).
Expand Down Expand Up @@ -58,6 +59,9 @@ documentation. Compatible with **docscribe >= 1.4.0** (daemon mode requires >= 1
- **Flexible strategies** — safe (document missing methods only) and aggressive (replace existing docs, preserve manual
descriptions)
- **Update types from RBS** — refresh YARD docs from RBS signatures
- **Invalid YARD type validation** — highlights malformed YARD types like `Sym bol` even without RBS (toggle in
settings)
- **File-scoped Update Types** — intention fixes current file only
- **Collapsible YARD docs** — fold all YARD comment blocks automatically on file open (configurable in settings)
- **Configurable** — hide comments by default
- **`.rake` and `Rakefile` support** — diagnostics and actions work on Rake files and bare Rakefiles
Expand All @@ -72,10 +76,11 @@ documentation. Compatible with **docscribe >= 1.4.0** (daemon mode requires >= 1

### Version compatibility

| Mode | docscribe version | Ruby version |
|--------------------------|-------------------|--------------|
| Daemon (Unix socket RPC) | >= 1.5.1 | >= 3.0 |
| CLI fallback | >= 1.4.0 | >= 2.7 |
| Mode | docscribe version | Ruby version |
|---------------------------------------|-------------------|--------------|
| Daemon (Unix socket RPC) | >= 1.5.1 | >= 3.0 |
| CLI fallback | >= 1.4.0 | >= 2.7 |
| Validate-types / source / file-scoped | >= 1.6.2 | >= 2.7 |

The plugin automatically selects the backend based on the detected docscribe version: daemon mode for >= 1.5.1, CLI
fallback for older versions. If the Ruby SDK is unavailable, it falls back to system PATH Ruby.
Expand Down Expand Up @@ -140,18 +145,25 @@ All actions are available in the editor right-click menu under the **DocScribe**
Open a Ruby file — undocumented methods are underlined with a warning. Hover to see what's missing. Diagnostics update
automatically on file save and open.

Invalid `InvalidType` warnings highlight the YARD line (`# @param` / `# @return`), not the `def` line. Fatal errors stay
red ERROR.

### Quick-Fix

Click the lightbulb or press `Alt+Enter` on an annotated diagnostic and select **"Apply docscribe fix"** to
auto-generate documentation for that method.

If the gem is not installed, the plugin shows a BALLOON WARNING with an Add to Gemfile button (writes
`gem "docscribe"` to the Gemfile root) instead of a red squiggle.

### Settings

Navigate to **Settings -> Tools -> DocScribe**:

| Setting | Description | Default |
|--------------------------|--------------------------------------------|---------|
| Hide comments by default | Auto-fold YARD comment blocks on file open | Off |
| Setting | Description | Default |
|----------------------------|-------------------------------------------------|---------|
| Hide comments by default | Auto-fold YARD comment blocks on file open | Off |
| Warn on invalid YARD types | Highlight malformed YARD types even without RBS | On |

## Development

Expand Down
46 changes: 46 additions & 0 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,52 @@
]]></description>

<change-notes><![CDATA[
<h3>0.1.7</h3>
<h4>Added</h4>
<ul>
<li>RBS-aware inspections — check, safe/aggressive fix and workspace check auto-detect RBS via <code>RbsDetector</code> and forward <code>--rbs</code> / <code>--rbs-collection</code> via <code>cli_overrides</code></li>
<li>Doctor RBS status — <code>DocScribe Doctor</code> shows <code>sig/</code>, <code>rbs</code> gem, <code>rbs_collection.lock.yaml</code> and <code>rbs.enabled</code></li>
<li>Annotator cache invalidation on RBS changes — <code>configHash</code> includes <code>rbsHash</code></li>
<li>MCP API — <code>DocScribeMcpToolset</code> exposing 6 tools (<code>docscribe_check_file</code>, <code>docscribe_check_workspace</code>, <code>docscribe_safe_fix</code>, <code>docscribe_aggressive_fix</code>, <code>docscribe_update_types</code>, <code>docscribe_doctor</code>)</li>
<li>i18n — English and Russian localizations via <code>DocScribeBundle</code></li>
<li>Invalid YARD type validation — <code>warnOnInvalidYardTypes</code> setting forwarded as <code>--validate-types</code></li>
<li>File-scoped Update Types — refresh YARD docs from RBS signatures for current file</li>
<li>Fix routing by source — <code>rbs</code> | <code>infer</code> | <code>syntax</code></li>
</ul>
<h4>Fixed</h4>
<ul>
<li>RBS mismatch underlines YARD line, not <code>def</code></li>
<li>Safe fix UX for RBS — routes through aggressive fix</li>
<li><code>update_types</code> exit code <code>1</code> and daemon fallback on <code>-32601</code> for old daemons</li>
<li>Doctor stale version cache — invalidated on <code>Gemfile.lock</code> mtime</li>
<li>MCP toolset not loading — registered via <code>withMcpServer.xml</code></li>
<li>Errors shown as balloon with &ldquo;Add to Gemfile&rdquo; instead of red squiggle</li>
<li><code>collectRubyFiles</code> synced with CLI filter</li>
</ul>
<h4>Changed</h4>
<ul>
<li>Version bumped from <code>0.1.6</code> to <code>0.1.7</code></li>
<li>Requires <code>docscribe &gt;= 1.6.2</code> for new API</li>
</ul>
<h3>0.1.6</h3>
<h4>Added</h4>
<ul>
<li>Batch workspace check — all <code>.rb</code> / <code>.rake</code> / <code>Rakefile</code> files sent in one <code>check_batch</code> RPC call</li>
<li><code>check_batch</code> RPC support in <code>DocscribeDaemon</code> — per-file errors reported independently, requires <code>docscribe &gt;= 1.5.2</code></li>
<li>Batch capability detection — <code>batchMode</code> for version <code>&gt;= 1.5.2</code> alongside <code>serverMode</code></li>
</ul>
<h4>Changed</h4>
<ul>
<li>Version bumped from <code>0.1.5</code> to <code>0.1.6</code></li>
<li>Workspace check runs in chunks of 10 with progress and cancellation support</li>
<li>Target IDE widened to 2026.1 — 2026.2</li>
<li>Notification group registration hardened — registry fallback</li>
</ul>
<h4>Fixed</h4>
<ul>
<li>Workspace check silently no-ops in server mode — now enumerates files and uses batch endpoint</li>
<li>Gem check used system Ruby instead of module SDK bundle path — now runs SDK <code>bundle</code> by absolute path</li>
</ul>
<h3>0.1.5</h3>
<h4>Added</h4>
<ul>
Expand Down
Loading