fix: fixed LSP server display, file streaming, and slash command autocomplete; reorganized npm scripts

- Fixed LSP servers showing as 'unknown' in status display when server warmup fails by using index-based lookup to correctly extract server name and file types.
- Fixed Read tool loading entire file into memory when offset/limit was specified by implementing streaming line-by-line processing that only collects requested range.
- Fixed slash command autocomplete applying stale completions when typing quickly by adding staleness check before applying completion on Enter/Return.
- Reorganized npm scripts to follow consistent naming pattern with separate TypeScript and Rust variants for check, lint, fmt, and fix operations.
- Updated release script to properly handle Rust workspace version updates in Cargo.toml files and regenerate lockfiles.
This commit is contained in:
can1357
2026-01-29 10:57:20 +01:00
parent 2abaddec84
commit 32bc2b8d02
7 changed files with 197 additions and 59 deletions
+34 -9
View File
@@ -13,6 +13,7 @@ import { $, Glob } from "bun";
const changelogGlob = new Glob("packages/*/CHANGELOG.md");
const packageJsonGlob = new Glob("packages/*/package.json");
const cargoTomlGlob = new Glob("crates/*/Cargo.toml");
// =============================================================================
// Shared functions
@@ -170,36 +171,60 @@ async function cmdRelease(version: string): Promise<void> {
}
console.log();
// 3. Regenerate lockfile
console.log("Regenerating lockfile...");
await $`rm -f bun.lock`;
await $`bun install`;
// 3. Update Rust workspace version
console.log(`Updating Rust workspace version to ${version}...`);
await $`sd '^version = "[^"]+"' ${`version = "${version}"`} Cargo.toml`;
// Verify
const cargoToml = await Bun.file("Cargo.toml").text();
const versionMatch = cargoToml.match(/^\[workspace\.package\][\s\S]*?^version = "([^"]+)"/m);
if (versionMatch) {
console.log(` workspace: ${versionMatch[1]}`);
}
// List crates using workspace version
for await (const cargoPath of cargoTomlGlob.scan(".")) {
const content = await Bun.file(cargoPath).text();
if (content.includes("version.workspace = true")) {
const nameMatch = content.match(/^name = "([^"]+)"/m);
if (nameMatch) {
console.log(` ${nameMatch[1]}: ${version} (workspace)`);
}
}
}
console.log();
// 4. Update changelogs
// 4. Regenerate lockfiles
console.log("Regenerating lockfiles...");
await $`rm -f bun.lock`;
await $`bun install`;
await $`cargo generate-lockfile`;
console.log();
// 5. Update changelogs
console.log("Updating CHANGELOGs...");
await updateChangelogsForRelease(version);
console.log();
// 5. Run checks
// 6. Run checks
console.log("Running checks...");
await $`bun run check`;
console.log();
// 6. Commit and tag
// 7. Commit and tag
console.log("Committing and tagging...");
await $`git add .`;
await $`git commit -m ${`chore: bump version to ${version}`}`;
await $`git tag ${`v${version}`}`;
console.log();
// 7. Push
// 8. Push
console.log("Pushing to remote...");
await $`git push origin main`;
await $`git push origin ${`v${version}`}`;
console.log();
// 8. Watch CI
// 9. Watch CI
console.log("Watching CI...");
const success = await watchCI();