{
+
+ }
+}
+
+const vcdViewerProvider = new VcdViewerProvider();
+
export {
- openWaveViewer
+ openWaveViewer,
+ vcdViewerProvider
};
\ No newline at end of file
diff --git a/src/function/hdlDoc/diagram.ts b/src/function/hdlDoc/diagram.ts
index 191973c..3730e92 100644
--- a/src/function/hdlDoc/diagram.ts
+++ b/src/function/hdlDoc/diagram.ts
@@ -80,8 +80,8 @@ function makeDiagramPortWrapper(ports: HdlModulePort[]): string {
const leftPorts = ports.filter(port => port.type === HdlModulePortType.Input || port.type === HdlModulePortType.Inout);
const rightPorts = ports.filter(port => port.type === HdlModulePortType.Output);
- const leftDirection = makeLeftDirection(leftPorts);
- const diagramPorts = makeDiagramPorts(leftPorts, rightPorts);
+ const leftDirection = makeLeftDirection(leftPorts);
+ const diagramPorts = makeDiagramPorts(leftPorts, rightPorts);
const rightDirection = makeRightDirection(rightPorts);
const diagramPortWrapper = `${leftDirection}${diagramPorts}${rightDirection}
`;
@@ -177,7 +177,7 @@ function makeDiagramPorts(leftPorts: HdlModulePort[], rightPorts: HdlModulePort[
diagramePorts += diagramPortItem;
}
while (rightIndex < rightPorts.length) {
- const rightPortName = makePortName(leftPorts[leftIndex ++]);
+ const rightPortName = makePortName(rightPorts[rightIndex ++]);
const diagramPortItem = ``;
diagramePorts += diagramPortItem;
}
@@ -185,7 +185,7 @@ function makeDiagramPorts(leftPorts: HdlModulePort[], rightPorts: HdlModulePort[
}
function makeRightDirection(rightPorts: HdlModulePort[]): string {
- let rightDirection = '';
+ let rightDirection = '';
for (const port of rightPorts) {
const portCaption = makePortCaption(port, 'right');
let portArrow = makePortArrow(port, 'right');
diff --git a/src/function/hdlDoc/html.ts b/src/function/hdlDoc/html.ts
index d03a131..99c7b5e 100644
--- a/src/function/hdlDoc/html.ts
+++ b/src/function/hdlDoc/html.ts
@@ -104,6 +104,7 @@ function makeWavedromRenderErrorHTML() {
* @param usage in whick module is used
*/
async function makeShowHTML(usage: 'webview' | 'pdf' | 'html' | 'markdown'): Promise {
+
// start to render the real html
let body = '';
const userStyle = (usage === 'webview' || usage === 'markdown') ? undefined : ThemeType.Light;
@@ -113,7 +114,7 @@ async function makeShowHTML(usage: 'webview' | 'pdf' | 'html' | 'markdown'): Pro
if (!renderList || renderList.length === 0) {
return '';
}
-
+
for (const r of renderList) {
const renderResult = r.render();
if (renderResult) {
diff --git a/src/function/hdlDoc/markdown.ts b/src/function/hdlDoc/markdown.ts
index 11bfe2d..d9877aa 100644
--- a/src/function/hdlDoc/markdown.ts
+++ b/src/function/hdlDoc/markdown.ts
@@ -48,13 +48,15 @@ function selectFieldValue(obj: any, subName: string, ws: string, name: string):
function makeTableFromObjArray(md: MarkdownString, array: any[], name: string, fieldNames: string[], displayNames: string[]) {
const ws = hdlPath.toSlash(opeParam.workspacePath) + '/';
+ console.log('enter showhtml');
+
if (array.length === 0) {
md.addText(`no ${name} info`);
} else {
const rows = [];
for (const obj of array) {
const data = [];
- for (const subName of fieldNames) {
+ for (const subName of fieldNames) {
const value = selectFieldValue(obj, subName, ws, name);
data.push(value);
}
@@ -97,7 +99,7 @@ async function patchComment(path: AbsPath, ports: (HdlModulePort | HdlModulePara
async function getDocsFromModule(module: HdlModule): Promise {
const moduleName = module.name;
const portNum = module.ports.length;
- const paramNum = module.params.length;
+ const paramNum = module.params.length;
// add desc can optimizer in the future version
const paramPP = patchComment(module.path, module.params);
diff --git a/src/function/index.ts b/src/function/index.ts
index 35736f2..694a8c6 100644
--- a/src/function/index.ts
+++ b/src/function/index.ts
@@ -119,6 +119,14 @@ function registerNetlist(context: vscode.ExtensionContext) {
function registerWaveViewer(context: vscode.ExtensionContext) {
vscode.commands.registerCommand('digital-ide.waveviewer.show', uri => WaveView.openWaveViewer(context, uri));
+ vscode.window.registerCustomEditorProvider('digital-ide.vcd.viewer', WaveView.vcdViewerProvider,
+ {
+ webviewOptions: {
+ retainContextWhenHidden: true,
+ },
+ supportsMultipleEditorsPerDocument: false
+ }
+ );
}
export {
diff --git a/src/global/util.ts b/src/global/util.ts
index 7a17ace..2ec4a7a 100644
--- a/src/global/util.ts
+++ b/src/global/util.ts
@@ -1,4 +1,5 @@
import * as fs from 'fs';
+import * as vscode from 'vscode';
import * as childProcess from 'child_process';
import { AbsPath } from ".";
@@ -59,10 +60,43 @@ async function easyExec(executor: string, args: string[]): Promise();
+ /**
+ * Get all known webviews for a given uri.
+ */
+ public *get(uri: vscode.Uri): Iterable {
+ const key = uri.toString();
+ for (const entry of this._webviews) {
+ if (entry.resource === key) {
+ yield entry.webviewPanel;
+ }
+ }
+ }
+
+ /**
+ * Add a new webview to the collection.
+ */
+ public add(uri: vscode.Uri, webviewPanel: vscode.WebviewPanel) {
+ const entry = { resource: uri.toString(), webviewPanel };
+ this._webviews.add(entry);
+
+ webviewPanel.onDidDispose(() => {
+ this._webviews.delete(entry);
+ });
+ }
+}
export {
PathSet,
isSameSet,
- easyExec
+ easyExec,
+ WebviewCollection
};
\ No newline at end of file
diff --git a/src/hdlParser/core.ts b/src/hdlParser/core.ts
index 9f1d522..4546ae8 100644
--- a/src/hdlParser/core.ts
+++ b/src/hdlParser/core.ts
@@ -477,7 +477,6 @@ class HdlModule {
public createHdlInstance(rawHdlInstance: common.RawHdlInstance): HdlInstance {
const instModName = rawHdlInstance.type;
-
if (this.languageId === HdlLangID.Verilog || this.languageId === HdlLangID.SystemVerilog) {
const searchResult = this.searchInstModPath(instModName);
const hdlInstance = new HdlInstance(rawHdlInstance.name,
@@ -525,7 +524,11 @@ class HdlModule {
}
}
- public makeNameToInstances() {
+ public makeNameToInstances() {
+ if (this.name === 'u_reg_cfg') {
+ console.log('[u_reg_cfg debug]');
+ console.log(this.rawInstances);
+ }
if (this.rawInstances !== undefined) {
this.nameToInstances.clear();
for (const inst of this.rawInstances) {