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
2 changes: 1 addition & 1 deletion docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default defineConfig({
{
label: '更新日志',
translations: { en: 'Changelog' },
items: ['changelog', 'changelog/v0-1-1', 'changelog/v0-1-2', 'changelog/v0-1-3'],
items: ['changelog', 'changelog/v0-1-1', 'changelog/v0-1-2', 'changelog/v0-1-3', 'changelog/v0-1-4'],
},
],
}),
Expand Down
7 changes: 4 additions & 3 deletions docs/src/content/docs/changelog/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { CardGrid, LinkCard } from '@astrojs/starlight/components';

<CardGrid>
<LinkCard
title="v0.1.3"
href="./v0-1-3/"
description="包含默认 best-effort 索引、重复模块诊断、诊断规则快捷操作、状态体验改进、i18n 和 qihe 日志输出优化。"
title="v0.1.4"
href="./v0-1-4/"
description="包含 Qihe 配置与 Windows 修复、诊断 profiling、LSP 性能优化、连接解析修复和语法高亮改进。"
/>
</CardGrid>

Expand All @@ -22,3 +22,4 @@ import { CardGrid, LinkCard } from '@astrojs/starlight/components';
- [v0.1.1](./v0-1-1/)
- [v0.1.2](./v0-1-2/)
- [v0.1.3](./v0-1-3/)
- [v0.1.4](./v0-1-4/)
39 changes: 39 additions & 0 deletions docs/src/content/docs/changelog/v0-1-4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: v0.1.4
description: Vizsla v0.1.4 发布说明。
---

## Qihe 分析与项目配置

- Windows 上运行 Qihe 时,不再因工作目录使用 `\\?\` 路径前缀而失败。Vizsla 现在会向 Java 与外部工具链传递普通 Windows 路径,减少本地 Qihe 安装与工程脚本的兼容性问题。([#98](https://github.com/pascal-lab/vizsla/pull/98))
- 从编辑器标题栏或文件菜单运行 Qihe 时,Vizsla 会使用触发命令的文件作为分析目标;从命令面板或快捷键运行且没有文件上下文时,仍使用当前编辑器。([#109](https://github.com/pascal-lab/vizsla/pull/109))
- Qihe 失败时,错误通知和状态栏入口可直接打开 `Vizsla Qihe` 输出面板;语言服务器启动、工作区重新加载等错误也会提供打开 Vizsla 输出的操作,便于查看失败原因。([#117](https://github.com/pascal-lab/vizsla/pull/117))
- 新增 `vizsla.qihe.autoConfigureArgsFromManifest`。默认行为保持不变;如果项目已通过自定义 Qihe 参数或脚本管理 `--mode`、`--top`、包含路径和宏定义,可以关闭项目配置参数自动补全,仅使用显式配置。([#113](https://github.com/pascal-lab/vizsla/pull/113))

## 诊断性能与分析工具

- 默认诊断明显提速。在 [#49](https://github.com/pascal-lab/vizsla/issues/49) 使用的 XiangShan 预编译 `XS.v` 复现文件中,完整默认诊断从约 82s 降到约 9.8s,减少大型工程在打开、保存或刷新诊断时的等待时间。([#102](https://github.com/pascal-lab/vizsla/pull/102), [#103](https://github.com/pascal-lab/vizsla/pull/103), [#104](https://github.com/pascal-lab/vizsla/pull/104), [#105](https://github.com/pascal-lab/vizsla/pull/105))

说明:这次优化包含对上游构建库限制的工程侧规避;后续仍会跟进更上游的根因修复。

| 场景 | 配置 | 耗时 | 诊断数 | 说明 |
| --- | ---: | ---: | ---: | --- |
| v0.1.3 发布版,旧默认警告行为 | 默认 | ~82.0s | 49,690 | C++ Release 构建未启用 `/O2`,且尚未对齐 slang 默认警告组 |
| 优化 MSVC Release 构建后,旧默认警告行为 | 默认 | ~16.6s | 49,690 | 仍存在重复解析/编译,且尚未对齐 slang 默认警告组 |
| v0.1.4 默认诊断路径 | 默认 | ~9.8s | 0 | 使用 slang 默认警告组 |
| v0.1.4 全警告配置 | `warnings=["everything"]` | ~10.4s | 49,690 | 显式全警告模式仍报告完整警告集合 |

- 新增 `Vizsla: Profile Diagnostics`。当需要分析诊断耗时时,可以对当前文件或整个工作区生成追踪摘要、折叠调用栈、火焰图和 Chrome 追踪 JSON,用于定位主要耗时来源。([#110](https://github.com/pascal-lab/vizsla/pull/110))
- 诊断性能分析结果会在外部浏览器中打开 Speedscope,避免大型追踪数据占用 VS Code Webview 资源;入口集中在 Vizsla 状态菜单,与重新加载项目、重启语言服务器、打开输出面板等项目操作放在一起。([#110](https://github.com/pascal-lab/vizsla/pull/110), [#118](https://github.com/pascal-lab/vizsla/pull/118))
- 诊断性能分析运行在隔离的语言服务器会话中,不会让临时分析配置影响普通编辑会话。([#114](https://github.com/pascal-lab/vizsla/pull/114))

## 编辑体验修复

- 命名端口和命名参数连接的跳转定义与语义高亮现在会解析到被实例化模块的端口或参数,而不是当前模块作用域。([#107](https://github.com/pascal-lab/vizsla/pull/107))
- 接受 `$display` 等系统任务补全时会保留完整任务名,不再因为片段变量解析丢失 `$` 后的内容。([#106](https://github.com/pascal-lab/vizsla/pull/106))
- Verilog/SystemVerilog 语法高亮覆盖更完整。系统任务高亮基于 slang 已知系统任务列表,`.v`/`.vh` 保持 Verilog 语法,`.sv`/`.svh`/`.svi` 使用 SystemVerilog 语法。([#108](https://github.com/pascal-lab/vizsla/pull/108))

## 维护

- 更新 VS Code 扩展开发依赖 `qs` 到 `6.15.2`,并修复 release 分支上的 Rust lint 检查问题。([#112](https://github.com/pascal-lab/vizsla/pull/112), [#115](https://github.com/pascal-lab/vizsla/pull/115))
- 发布 VS Code 扩展 `0.1.4`。
7 changes: 4 additions & 3 deletions docs/src/content/docs/en/changelog/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ This section records user-visible changes for each official release. Add the cor

<CardGrid>
<LinkCard
title="v0.1.3"
href="./v0-1-3/"
description="Includes default best-effort indexing, duplicate module diagnostics, diagnostic rule quick actions, status UX improvements, i18n, and qihe log output updates."
title="v0.1.4"
href="./v0-1-4/"
description="Includes Qihe configuration and Windows fixes, diagnostics profiling, LSP performance improvements, connection-resolution fixes, and grammar updates."
/>
</CardGrid>

Expand All @@ -22,3 +22,4 @@ This section records user-visible changes for each official release. Add the cor
- [v0.1.1](./v0-1-1/)
- [v0.1.2](./v0-1-2/)
- [v0.1.3](./v0-1-3/)
- [v0.1.4](./v0-1-4/)
39 changes: 39 additions & 0 deletions docs/src/content/docs/en/changelog/v0-1-4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: v0.1.4
description: Vizsla v0.1.4 release notes.
---

## Qihe Analysis and Project Configuration

- Qihe no longer fails on Windows when the working directory uses a `\\?\` path prefix. Vizsla now passes ordinary Windows paths to Java and external toolchains, reducing compatibility issues with local Qihe installations and project scripts. ([#98](https://github.com/pascal-lab/vizsla/pull/98))
- Running Qihe from the editor title or file menu now analyzes the file that invoked the command. Command palette and keyboard shortcut invocations still use the active editor when no file context is available. ([#109](https://github.com/pascal-lab/vizsla/pull/109))
- Qihe failures now offer direct access to the `Vizsla Qihe` output panel from the error notification and temporary status entry. Language-server startup, workspace reload, and related failures also offer a Vizsla output action, making failure details easier to inspect. ([#117](https://github.com/pascal-lab/vizsla/pull/117))
- Added `vizsla.qihe.autoConfigureArgsFromManifest`. The default behavior is unchanged; projects that already manage `--mode`, `--top`, include paths, and macro definitions through custom Qihe arguments or scripts can disable automatic manifest-derived arguments and use only explicit configuration. ([#113](https://github.com/pascal-lab/vizsla/pull/113))

## Diagnostics Performance and Profiling

- Default diagnostics are substantially faster. On the precompiled XiangShan `XS.v` reproduction file from [#49](https://github.com/pascal-lab/vizsla/issues/49), full default diagnostics dropped from about 82s to about 9.8s, reducing wait time when large projects open, save, or refresh diagnostics. ([#102](https://github.com/pascal-lab/vizsla/pull/102), [#103](https://github.com/pascal-lab/vizsla/pull/103), [#104](https://github.com/pascal-lab/vizsla/pull/104), [#105](https://github.com/pascal-lab/vizsla/pull/105))

Note: this release uses an engineering workaround for an upstream build-library limitation; a more upstream fix remains worth tracking.

| Scenario | Config | Time | Diagnostics | Notes |
| --- | ---: | ---: | ---: | --- |
| v0.1.3 Release, old default warning behavior | default | ~82.0s | 49,690 | C++ Release build missed `/O2`, and the default warning group was not yet aligned with slang |
| MSVC Release build optimized, old default warning behavior | default | ~16.6s | 49,690 | Repeated parse/compile work remained, and the default warning group was not yet aligned with slang |
| v0.1.4 default diagnostics path | default | ~9.8s | 0 | Uses slang's default warning group |
| v0.1.4 all-warnings mode | `warnings=["everything"]` | ~10.4s | 49,690 | Explicit all-warnings mode still reports the full warning set |

- Added `Vizsla: Profile Diagnostics`. Current-file or workspace diagnostics can now produce trace summaries, folded stacks, flamegraphs, and raw Chrome trace JSON for performance investigation. ([#110](https://github.com/pascal-lab/vizsla/pull/110))
- Diagnostic profiling results now open Speedscope in the external browser, keeping large traces out of the VS Code webview process. The entry point is grouped into the Vizsla status menu alongside project reload, language-server restart, and output actions. ([#110](https://github.com/pascal-lab/vizsla/pull/110), [#118](https://github.com/pascal-lab/vizsla/pull/118))
- Diagnostic profiling runs in an isolated language-server session, so temporary profiling configuration does not affect the normal editing session. ([#114](https://github.com/pascal-lab/vizsla/pull/114))

## Editor Experience Fixes

- Go to definition and semantic highlighting for named port and parameter connections now resolve against the instantiated target module instead of the local module scope. ([#107](https://github.com/pascal-lab/vizsla/pull/107))
- Accepting system task completions such as `$display` now preserves the full task name instead of letting snippet variable parsing consume the text after `$`. ([#106](https://github.com/pascal-lab/vizsla/pull/106))
- Verilog/SystemVerilog syntax highlighting covers more cases. System task highlighting is based on slang's known system task list, `.v`/`.vh` stay on the Verilog grammar, and `.sv`/`.svh`/`.svi` use the SystemVerilog grammar. ([#108](https://github.com/pascal-lab/vizsla/pull/108))

## Maintenance

- Updated the VS Code extension development dependency `qs` to `6.15.2` and fixed the Rust lint failure on the release branch. ([#112](https://github.com/pascal-lab/vizsla/pull/112), [#115](https://github.com/pascal-lab/vizsla/pull/115))
- Released VS Code extension `0.1.4`.
4 changes: 4 additions & 0 deletions editors/vscode/l10n/bundle.l10n.zh-cn.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"Vizsla output channel has not been initialized.": "Vizsla 输出通道尚未初始化。",
"Vizsla Qihe output channel has not been initialized.": "Vizsla Qihe 输出通道尚未初始化。",
"Vizsla language server is starting.": "Vizsla 语言服务器正在启动。",
"Vizsla": "Vizsla",
"Vizsla language server is running.": "Vizsla 语言服务器正在运行。",
Expand Down Expand Up @@ -37,6 +38,7 @@
"Vizsla server: {0}": "Vizsla 服务器:{0}",
"Failed to query Vizsla server version: {0}": "无法查询 Vizsla 服务器版本:{0}",
"Show Output": "显示输出",
"Show Qihe Output": "显示 Qihe 输出",
"No Vizsla project manifest is loaded.": "未加载 Vizsla 项目配置文件。",
"Open Vizsla Project Manifest": "打开 Vizsla 项目配置文件",
"Failed to reload Vizsla project configuration: {0}": "无法重新加载 Vizsla 项目配置:{0}",
Expand All @@ -45,6 +47,8 @@
"{0} manifests": "{0} 个项目配置文件",
"$(new-file) Create Manifest": "$(new-file) 创建项目配置文件",
"Create {0} in missing workspace folders": "在缺失的工作区文件夹中创建 {0}",
"$(pulse) Profile Diagnostics": "$(pulse) 分析诊断性能",
"Measure current-file or workspace diagnostics performance": "分析当前文件或工作区诊断性能",
"$(refresh) Reload Project": "$(refresh) 重新加载项目",
"Refresh project manifests without restarting the server": "不重启服务器并刷新项目配置文件",
"$(debug-restart) Restart Language Server": "$(debug-restart) 重启语言服务器",
Expand Down
4 changes: 2 additions & 2 deletions editors/vscode/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions editors/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vizsla-lsp",
"displayName": "Vizsla",
"description": "%extension.description%",
"version": "0.1.3",
"version": "0.1.4",
"publisher": "vizsla",
"license": "MIT",
"repository": {
Expand Down Expand Up @@ -376,11 +376,6 @@
"command": "vizsla.runQiheAnalysis",
"when": "resourceLangId == verilog || resourceLangId == systemverilog",
"group": "navigation@10"
},
{
"command": "vizsla.profileDiagnostics",
"when": "resourceLangId == verilog || resourceLangId == systemverilog",
"group": "navigation@20"
}
]
}
Expand Down
61 changes: 49 additions & 12 deletions editors/vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {

import { getBundledServerPath, getPlatformFolder } from './platform';
import { registerDiagnosticActions } from './diagnosticActions';
import { registerProfilingCommand } from './profiling';
import { profileDiagnosticsCommand, registerProfilingCommand } from './profiling';
import {
DEFAULT_PROJECT_CONFIG_TEXT,
PROJECT_CONFIG_FILE_NAMES,
Expand All @@ -40,6 +40,7 @@ let qiheStatusBarItem: vscode.StatusBarItem | undefined;
const execFileAsync = promisify(execFile);
const restartServerCommand = 'vizsla.restartServer';
const showServerVersionCommand = 'vizsla.showServerVersion';
const showQiheOutputCommand = 'vizsla.showQiheOutput';
const runQiheAnalysisCommand = 'vizsla.runQiheAnalysis';
const runQiheAnalysisRequest = 'vizsla.server.runQiheAnalysis';
const qiheStatusNotification = 'vizsla/qiheStatus';
Expand Down Expand Up @@ -70,10 +71,38 @@ function requireOutputChannel(): vscode.OutputChannel {
return outputChannel;
}

function requireQiheOutputChannel(): vscode.OutputChannel {
if (!qiheOutputChannel) {
throw new Error(vscode.l10n.t('Vizsla Qihe output channel has not been initialized.'));
}

return qiheOutputChannel;
}

function showOutput(): void {
requireOutputChannel().show(true);
}

function showQiheOutput(): void {
requireQiheOutputChannel().show(true);
}

async function showLanguageServerErrorMessage(message: string): Promise<void> {
const showOutputAction = vscode.l10n.t('Show Output');
const selection = await vscode.window.showErrorMessage(message, showOutputAction);
if (selection === showOutputAction) {
showOutput();
}
}

async function showQiheErrorMessage(message: string): Promise<void> {
const showOutputAction = vscode.l10n.t('Show Qihe Output');
const selection = await vscode.window.showErrorMessage(message, showOutputAction);
if (selection === showOutputAction) {
showQiheOutput();
}
}

function updateServerStatus(status: ServerStatus, detail?: string): void {
vizslaStatusController?.updateServerStatus(status, detail);
}
Expand All @@ -90,6 +119,7 @@ function clearQiheStatusHideTimer(): void {
function updateQiheStatus(
tooltip: string,
hideAfterMs?: number,
command: string | vscode.Command = runQiheAnalysisCommand,
): void {
if (!qiheStatusBarItem) {
return;
Expand All @@ -98,6 +128,7 @@ function updateQiheStatus(
clearQiheStatusHideTimer();
qiheStatusBarItem.text = `${qiheAnalysisIcon} Qihe`;
qiheStatusBarItem.tooltip = tooltip;
qiheStatusBarItem.command = command;
qiheStatusBarItem.show();

if (!hideAfterMs) {
Expand Down Expand Up @@ -200,7 +231,9 @@ function registerQiheNotifications(languageClient: LanguageClient): void {
activeQiheTokens.delete(token);
finishQiheNotification(token);
if (activeQiheTokens.size === 0) {
updateQiheStatus(message ?? vscode.l10n.t('Qihe analysis failed'), 6000);
const failureMessage = message ?? vscode.l10n.t('Qihe analysis failed');
updateQiheStatus(failureMessage, 6000, showQiheOutputCommand);
void showQiheErrorMessage(failureMessage);
}
break;
default:
Expand Down Expand Up @@ -613,7 +646,7 @@ async function startClient(context: vscode.ExtensionContext): Promise<void> {
log(`[ERROR] Failed to start language server: ${message}`);
log(`[ERROR] ${(error as Error).stack}`);
updateServerStatus('error', message);
vscode.window.showErrorMessage(
await showLanguageServerErrorMessage(
vscode.l10n.t('Failed to start Vizsla Language Server: {0}', message),
);
}
Expand Down Expand Up @@ -665,17 +698,13 @@ async function showServerVersion(context: vscode.ExtensionContext): Promise<void
(error as Error).message,
);
log(`[ERROR] ${message}`);
const showOutputAction = vscode.l10n.t('Show Output');
const selection = await vscode.window.showErrorMessage(message, showOutputAction);
if (selection === showOutputAction) {
showOutput();
}
await showLanguageServerErrorMessage(message);
}
}

async function reloadWorkspace(): Promise<void> {
if (!client) {
vscode.window.showErrorMessage(vscode.l10n.t('Vizsla language server is not running.'));
await showLanguageServerErrorMessage(vscode.l10n.t('Vizsla language server is not running.'));
return;
}

Expand All @@ -690,7 +719,7 @@ async function reloadWorkspace(): Promise<void> {
(error as Error).message,
);
log(`[ERROR] ${message}`);
vscode.window.showErrorMessage(message);
await showLanguageServerErrorMessage(message);
}
}

Expand All @@ -709,7 +738,7 @@ async function runQiheAnalysis(resource: unknown): Promise<void> {
}

if (!client) {
vscode.window.showErrorMessage(vscode.l10n.t('Vizsla language server is not running.'));
await showLanguageServerErrorMessage(vscode.l10n.t('Vizsla language server is not running.'));
return;
}

Expand All @@ -732,7 +761,7 @@ async function runQiheAnalysis(resource: unknown): Promise<void> {
} catch (error) {
const message = vscode.l10n.t('Failed to run Qihe analysis: {0}', (error as Error).message);
log(`[ERROR] ${message}`);
vscode.window.showErrorMessage(message);
await showLanguageServerErrorMessage(message);
}
}

Expand Down Expand Up @@ -767,6 +796,9 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
context.subscriptions.push(qiheOutputChannel);
vizslaStatusController = new VizslaStatusController({
createManifest: (rootUris) => createProjectConfigsFromRootUris(context, rootUris),
profileDiagnostics: async () => {
await vscode.commands.executeCommand(profileDiagnosticsCommand);
},
reloadProject: reloadWorkspace,
restartServer: () => restartClient(context),
showOutput,
Expand All @@ -787,6 +819,11 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
});
context.subscriptions.push(showOutputRegistration);

const showQiheOutputRegistration = vscode.commands.registerCommand(showQiheOutputCommand, () => {
showQiheOutput();
});
context.subscriptions.push(showQiheOutputRegistration);

const restartCommandRegistration = vscode.commands.registerCommand(
restartServerCommand,
async () => {
Expand Down
Loading
Loading