From 665c386e9bd5dfbf84d4229fb80be031c8aa701f Mon Sep 17 00:00:00 2001 From: unurgunite Date: Wed, 9 Sep 2026 17:44:43 +0300 Subject: [PATCH] [0.1.7] Updated md files --- CHANGELOG.md | 44 ++++++++++++++++++++---- README.md | 28 +++++++++++----- src/main/resources/META-INF/plugin.xml | 46 ++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27f82d2..59c6788 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 `messages.DocScribeBundle` 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 + `messages.DocScribeBundle` 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 diff --git a/README.md b/README.md index 07de859..a161353 100644 --- a/README.md +++ b/README.md @@ -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). @@ -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 @@ -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. @@ -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 diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 9229428..939e5c3 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -19,6 +19,52 @@ ]]> 0.1.7 +

Added

+ +

Fixed

+ +

Changed

+ +

0.1.6

+

Added

+ +

Changed

+ +

Fixed

+

0.1.5

Added