Skip to content

Commit 9978a88

Browse files
committed
docs: update release notes for v2.5.0 with
1 parent c4eb160 commit 9978a88

1 file changed

Lines changed: 70 additions & 51 deletions

File tree

docs/news/2026-03-31-whats-new-v2.5.0.md

Lines changed: 70 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,98 +5,117 @@ date: 2026-03-31
55

66
# What's New in RobotCode v2.5.0
77

8-
This release brings **major performance improvements**, a powerful new **SQLite-based cache system**, and smarter **code completion** — making RobotCode faster and more productive than ever, especially for large projects.
8+
If you've ever opened a large Robot Framework project and gone for coffee while RobotCode was still thinking — this release is for you. Version 2.5.0 is all about **speed**: faster startup, faster analysis, faster code completion. And a few new tricks on top.
99

10-
## Highlights
10+
## Instant Startup with Analysis Caching
1111

12-
### Blazing-Fast Startup with Namespace Caching
12+
The biggest change you'll notice: **RobotCode remembers**. When you open a project for the second time, all the analysis work from your last session is still there — diagnostics, code completion, navigation, everything loads almost instantly.
1313

14-
The biggest highlight of this release is the new **namespace disk cache**. RobotCode now caches fully resolved namespace data to a SQLite database, so on subsequent IDE starts cached namespaces are reused instead of re-analyzing every file from scratch. This dramatically reduces the time until diagnostics, code completion, and navigation become available — especially in large workspaces with hundreds of Robot files.
14+
Behind the scenes, RobotCode now stores fully resolved analysis data in a local SQLite database. Instead of re-analyzing every file on every IDE start, it loads cached results and only re-processes files that actually changed. For projects with hundreds of Robot files, this can cut startup from minutes down to seconds.
1515

16-
- **Enabled by default** — no configuration needed; just enjoy faster startups.
17-
- **Automatic invalidation** — the cache is rebuilt when source files, library dependencies, environment variables, command-line variables, language settings, or the RobotCode version change.
18-
- **SQLite backend** — all cache entries are consolidated into a single SQLite database per workspace, replacing the old scattered `.pkl` files.
19-
- **Advisory file locking** — concurrent access from multiple processes (language server, CLI, analyze) is safe thanks to `fcntl.flock`-based locking.
16+
This is **enabled by default** — there's nothing to configure. The cache is automatically invalidated when your source files change, when library dependencies are updated, when environment variables or command-line variables differ, or when you update RobotCode itself. If something changes, the affected parts are re-analyzed — everything else comes straight from cache.
2017

21-
### Cache Management CLI
18+
Since this is a new feature, you can disable it if you run into any issues:
2219

23-
A new `robotcode analyze cache` command group gives you full control over the cache:
20+
```toml
21+
# robot.toml
22+
[tool.robotcode-analyze.cache]
23+
cache-namespaces = false
24+
```
25+
26+
or via the CLI:
27+
28+
```bash
29+
robotcode analyze --no-cache-namespaces
30+
```
31+
32+
Multiple processes (the language server, CLI commands, parallel analyze runs) can safely access the cache at the same time thanks to file-level locking. No corruption, no conflicts.
33+
34+
## Performance: The Numbers
35+
36+
Even without the cache, this release is noticeably faster. Here's what changed:
37+
38+
- **No more 30-minute hangs on large projects.** Robot Framework's `variable_not_found` runs a fuzzy "Did you mean…?" search on every unresolved variable — a nice idea, but O(n×m) over all variable candidates. For big projects (375+ files), this could freeze the analysis for over 30 minutes. RobotCode now skips that search entirely since it never uses the suggestion text. Problem solved. ([#587](https://github.com/robotcodedev/robotcode/issues/587))
39+
40+
- **Keyword matching is 94% faster.** The `KeywordMatcher` used to be instantiated from scratch on every lookup — about 7.5 million times per analysis run. It's now cached on the `KeywordDoc` itself. Combined with a new dict-based index in `KeywordStore`, keyword lookups went from linear scan to O(1) for non-embedded keywords. Overall analysis time dropped by **22%** with **31% fewer function calls**.
41+
42+
- **File resolution is 28% faster.** Swapping `pathlib.Path` for `os.path` string operations in the hot path of file resolution plus lazy-caching of valid `sys.path` entries cut warm-start wall time by nearly a third.
43+
44+
- **Less memory per document.** Each document used to keep two cached AST models. Now there's just one, saving around 200–500 KB per file. That adds up quickly in a big workspace.
2445

25-
| Command | Description |
26-
|---------|-------------|
27-
| `path` | Print the resolved cache directory |
28-
| `info` | Show cache statistics with per-section breakdown |
29-
| `list` | List cached entries with glob pattern filtering (`-p`) |
30-
| `clear` | Remove cached entries by section |
31-
| `prune` | Delete the entire cache database |
46+
- **Faster cache loading.** Cached namespace data now includes source hints that let RobotCode skip expensive filesystem lookups (`find_resource`) when the cached paths still exist on disk. Cache entries use lazy deserialization — data blobs are only unpickled on actual cache hits, not on every lookup.
3247

33-
You can also override the cache location via the `ROBOTCODE_CACHE_DIR` environment variable — the VS Code extension sets this automatically in the integrated terminal.
48+
- **`ArgumentSpec.resolve()` actually caches now.** A subtle bug caused `RobotArgumentSpec` to be recreated on every call (100K times per run) instead of being cached. Fixed — instantiation calls dropped by **98.7%**.
3449

35-
### Code Completion for `Literal` Type Hints
50+
## Smarter Code Completion for Type Hints
3651

37-
Keywords with `Literal["fast", "slow", "auto"]` type hints now show their allowed values directly in the completion list. No more switching to documentation just to find valid argument values. Supports `Union` types containing `Literal` as well.
52+
If you write Python libraries with type hints like `Literal["fast", "slow", "auto"]`, RobotCode now picks up on those and shows the allowed values directly in the completion list. This works for `Union` types containing `Literal` too, so `Literal["x", "y"] | int` will offer `x` and `y` as suggestions.
3853

39-
### Unused Keywords & Variables Detection on CLI
54+
No more switching to the library docs just to look up which string values a keyword accepts — the editor tells you right there.
4055

41-
The `robotcode analyze code` command now supports collecting unused keyword and variable diagnostics. Enable it in `robot.toml`:
56+
## Find Unused Keywords & Variables from the CLI
57+
58+
Unused keywords and variables are the kind of thing that quietly accumulates in any project. RobotCode can now detect them when running `robotcode analyze code` from the command line — great for CI pipelines or periodic cleanup sessions.
59+
60+
Enable it in your `robot.toml`:
4261

4362
```toml
4463
[tool.robotcode-analyze.code]
4564
collect-unused = true
4665
```
4766

48-
Or use the CLI flags directly:
67+
Or toggle it per invocation:
4968

5069
```bash
5170
robotcode analyze code --collect-unused
5271
robotcode analyze code --no-collect-unused
5372
```
5473

55-
---
74+
## Full Control over the Analysis Cache
5675

57-
## Performance
76+
A new `robotcode analyze cache` command group gives you visibility into what's cached and lets you manage it when needed:
5877

59-
This release includes a wave of performance optimizations that significantly reduce analysis time and memory usage:
78+
```bash
79+
robotcode analyze cache path # where is the cache stored?
80+
robotcode analyze cache info # cache statistics, per-section breakdown
81+
robotcode analyze cache list # list cached entries (supports glob filtering with -p)
82+
robotcode analyze cache clear # remove cached entries by section
83+
robotcode analyze cache prune # wipe the entire cache
84+
```
6085

61-
| Optimization | Impact |
62-
|---|---|
63-
| **Patch RF's `variable_not_found`** | Skips slow `RecommendationFinder` — fixes 30+ min hangs on large projects ([#587](https://github.com/robotcodedev/robotcode/issues/587)) |
64-
| **Replace pathlib with `os.path`** | Warm namespace-cache scenario: **-28.3%** wall time |
65-
| **Cache `KeywordMatcher` + dict-index** | Keyword matching: **-94%**, overall analysis: **-22%**, function calls: 118M → 81M |
66-
| **Fix `ArgumentSpec.resolve()` caching** | `RobotArgumentSpec.__init__` calls: 100K → 1.3K (**-98.7%**) |
67-
| **Single AST model per document** | Saves ~500 KB/doc (CLI) and ~200 KB/doc (Language Server) |
68-
| **Namespace cache source hints** | Skips expensive `find_resource()` filesystem searches on warm start |
69-
| **Lazy `CacheEntry` deserialization** | Data blobs are only unpickled on cache hit |
70-
| **Cache `get_module_spec` results** | Avoids repeated importlib lookups |
86+
All output respects `--format` (text/json/toml) and `--no-color`, so it plays nicely with scripts and CI.
7187

72-
---
88+
You can also point the cache to a custom directory via the `ROBOTCODE_CACHE_DIR` environment variable. The VS Code extension automatically sets this in the integrated terminal, so your CLI commands and the language server always share the same cache without any manual setup.
7389

7490
## Bug Fixes
7591

76-
- **Relative library path resolution** — Namespace cache validation no longer fails for relative imports like `../../resources/libraries/common.py`, preventing unnecessary full rebuilds on every warm start.
77-
- **Variable name trailing `=`** — Variable names in resource builder now correctly strip trailing `=` ([#546](https://github.com/robotcodedev/robotcode/issues/546)).
78-
- **Model source field** — RobotCode no longer overrides the `source` field on AST blocks when newer Robot Framework versions already set it ([#588](https://github.com/robotcodedev/robotcode/issues/588)).
79-
- **`__init__.py` file check** — Corrected file type check in `_is_valid_file` function.
80-
- **Thread safety** — Added lock for `_workspace_languages` to prevent race conditions on concurrent access.
92+
- Fixed cache validation for libraries imported via relative paths — no longer triggers unnecessary full rebuilds on warm start.
93+
- Variable names with trailing `=` are now stripped correctly by the resource builder ([#546](https://github.com/robotcodedev/robotcode/issues/546)).
94+
- RobotCode no longer overrides the `source` field on AST blocks when Robot Framework itself already sets it ([#588](https://github.com/robotcodedev/robotcode/issues/588)).
95+
- Fixed a race condition when accessing workspace language settings in multi-workspace setups.
8196

82-
---
97+
## Under the Hood
98+
99+
A lot of internal work went into this release to prepare for future features:
100+
101+
- **Workspace-wide reference index (ProjectIndex)** — RobotCode now maintains an incrementally updated inverse index across your entire workspace. When a file changes, only its references are updated instead of scanning everything. This covers keywords, variables, namespace entries, keyword tags, testcase tags, and metadata. This is the foundation for upcoming features like unused import detection, import dependency visualization, and call hierarchy — stay tuned.
83102

84-
## Internal Improvements
103+
- **Namespace refactoring** — The old monolithic `Namespace` class has been split into a clean data container (`Namespace` DTO) built by a dedicated `NamespaceBuilder`, with separate modules for import resolution, AST analysis, variable scoping, and scope trees. This makes the codebase more maintainable and easier to extend.
85104

86-
- **ProjectIndex** — New incrementally maintained inverse reference index for O(1) workspace-wide lookups of keywords, variables, namespace entries, tags, and metadata.
87-
- **Tag & metadata reference tracking** — Structured reference tracking for keyword tags, testcase tags, and metadata during analysis, enabling future features like tag-based navigation.
88-
- **`RF_VERSION` constant** — Replaced ~134 `get_robot_version()` call sites with a single module-level constant. Removed all dead code for Robot Framework < 5.0.
89-
- **Namespace refactoring** — Split the monolithic `Namespace` class into a pure DTO with event-driven invalidation, separate builder, and focused modules for import resolution, AST analysis, and variable scoping.
90-
- **JSON file watching**`.json` files are now included in the watched file extensions for automatic workspace updates.
91-
- **Deprecated robocop options removed** — Legacy robocop configuration options have been removed.
92-
- **Resource lifecycle hardening** — Replaced fragile `__del__`-based cleanup in JSON-RPC layer with explicit `close`/`close_async` paths and best-effort weakref finalizers.
105+
- **`RF_VERSION` constant** — All ~134 scattered `get_robot_version()` call sites have been replaced with a single module-level constant. All dead code for Robot Framework < 5.0 (which is no longer supported) has been removed.
106+
107+
- **JSON file watching**`.json` files are now included in the watched file extensions, so changes to JSON-based configuration are picked up automatically.
108+
109+
- **Deprecated Robocop options removed** — Legacy robocop configuration options that were deprecated in earlier releases have been cleaned up.
93110

94111
---
95112

96113
## Thank You
97114

98115
Thanks to everyone who reported issues, contributed ideas, and tested pre-release builds. Your feedback drives every release.
99116

117+
For the full list of changes, see the [Changelog](https://github.com/robotcodedev/robotcode/blob/main/CHANGELOG.md).
118+
100119
- [Report issues](https://github.com/robotcodedev/robotcode/issues)
101120
- [Discussions & Q&A](https://github.com/robotcodedev/robotcode/discussions)
102121
- [Sponsor RobotCode](https://opencollective.com/robotcode)

0 commit comments

Comments
 (0)