Skip to content

Commit 7f14925

Browse files
committed
docs: add news section to documentation site
Add a dedicated news section for release announcements with auto-generated sidebar (sorted newest-first), content loader, and redirect from /news/ to the latest article.
1 parent 42ab3a0 commit 7f14925

4 files changed

Lines changed: 182 additions & 8 deletions

File tree

docs/.vitepress/config.mts

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export default defineConfig({
6060
},
6161
nav: [
6262
{ text: "Home", link: "/" },
63+
{ text: "News", link: "/news/" },
6364
{ text: "Documentation", link: "/01_about" },
6465
{ text: "Support & Contribute", link: "/05_contributing" },
6566
{ text: "Q&A", link: "https://github.com/robotcodedev/robotcode/discussions/categories/q-a" },
@@ -97,14 +98,29 @@ export default defineConfig({
9798
// ]
9899
// }
99100
// ],
100-
sidebar: generateSidebar({
101-
documentRootPath: ".",
102-
collapsed: true,
103-
useTitleFromFileHeading: true,
104-
useTitleFromFrontmatter: true,
105-
useFolderLinkFromIndexFile: true,
106-
useFolderTitleFromIndexFile: true,
107-
}),
101+
sidebar: generateSidebar([
102+
{
103+
documentRootPath: ".",
104+
collapsed: true,
105+
useTitleFromFileHeading: true,
106+
useTitleFromFrontmatter: true,
107+
useFolderLinkFromIndexFile: true,
108+
useFolderTitleFromIndexFile: true,
109+
excludeByGlobPattern: ["news/**"],
110+
},
111+
{
112+
documentRootPath: ".",
113+
scanStartPath: "news",
114+
resolvePath: "/news/",
115+
collapsed: false,
116+
useTitleFromFileHeading: true,
117+
useTitleFromFrontmatter: true,
118+
useFolderLinkFromIndexFile: true,
119+
useFolderTitleFromIndexFile: true,
120+
sortMenusByFrontmatterDate: true,
121+
sortMenusOrderByDescending: true,
122+
},
123+
]),
108124
socialLinks: [
109125
{ icon: "github", link: "https://github.com/robotcodedev/robotcode" },
110126
{ icon: { svg: python_svg }, link: "https://pypi.org/project/robotcode/" },
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
title: What's New in v2.5.0
3+
date: 2026-03-31
4+
---
5+
6+
# What's New in RobotCode v2.5.0
7+
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.
9+
10+
## Highlights
11+
12+
### Blazing-Fast Startup with Namespace Caching
13+
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.
15+
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.
20+
21+
### Cache Management CLI
22+
23+
A new `robotcode analyze cache` command group gives you full control over the cache:
24+
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 |
32+
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.
34+
35+
### Code Completion for `Literal` Type Hints
36+
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.
38+
39+
### Unused Keywords & Variables Detection on CLI
40+
41+
The `robotcode analyze code` command now supports collecting unused keyword and variable diagnostics. Enable it in `robot.toml`:
42+
43+
```toml
44+
[tool.robotcode-analyze.code]
45+
collect-unused = true
46+
```
47+
48+
Or use the CLI flags directly:
49+
50+
```bash
51+
robotcode analyze code --collect-unused
52+
robotcode analyze code --no-collect-unused
53+
```
54+
55+
---
56+
57+
## Performance
58+
59+
This release includes a wave of performance optimizations that significantly reduce analysis time and memory usage:
60+
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 |
71+
72+
---
73+
74+
## Bug Fixes
75+
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.
81+
82+
---
83+
84+
## Internal Improvements
85+
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.
93+
94+
---
95+
96+
## Thank You
97+
98+
Thanks to everyone who reported issues, contributed ideas, and tested pre-release builds. Your feedback drives every release.
99+
100+
- [Report issues](https://github.com/robotcodedev/robotcode/issues)
101+
- [Discussions & Q&A](https://github.com/robotcodedev/robotcode/discussions)
102+
- [Sponsor RobotCode](https://opencollective.com/robotcode)

docs/news/index.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: News
3+
---
4+
5+
<script setup>
6+
import { data as posts } from './posts.data'
7+
import { useRouter } from 'vitepress'
8+
import { onMounted } from 'vue'
9+
10+
const router = useRouter()
11+
12+
onMounted(() => {
13+
if (posts.length > 0) {
14+
router.go(posts[0].url)
15+
}
16+
})
17+
</script>
18+
19+
# News
20+
21+
Release announcements and news about RobotCode.
22+
23+
<div v-for="post of posts" :key="post.url" class="blog-post">
24+
<h2><a :href="post.url">{{ post.frontmatter.title }}</a></h2>
25+
<p class="blog-date">{{ new Date(post.frontmatter.date).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' }) }}</p>
26+
</div>
27+
28+
<style>
29+
.blog-post {
30+
margin-bottom: 1.5rem;
31+
padding-bottom: 1.5rem;
32+
border-bottom: 1px solid var(--vp-c-divider);
33+
}
34+
.blog-post:last-child {
35+
border-bottom: none;
36+
}
37+
.blog-post h2 {
38+
margin-top: 0;
39+
border-top: none;
40+
}
41+
.blog-date {
42+
color: var(--vp-c-text-2);
43+
font-size: 0.9rem;
44+
}
45+
</style>

docs/news/posts.data.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { createContentLoader } from "vitepress";
2+
3+
export default createContentLoader("news/*.md", {
4+
transform(raw) {
5+
return raw
6+
.filter((p) => p.url !== "/news/")
7+
.sort((a, b) => {
8+
return +new Date(b.frontmatter.date) - +new Date(a.frontmatter.date);
9+
});
10+
},
11+
});

0 commit comments

Comments
 (0)