Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding compileOnOpen setting option #172

Merged
merged 1 commit into from Sep 14, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -82,6 +82,8 @@ This VS Code extension provides features to read, navigate and write SystemVeril
- `systemverilog.compilerType`: _String_, Dropdown list to select a compiler type
- Default: `Verilator`
- `systemverilog.trace.server`: _String_, Dropdown to select verbosity of LSP message tracing
- `systemverilog.compileOnOpen`: _Boolean_, Compile all files when opened
- Default: `false`

### Customizations

Expand Down
7 changes: 6 additions & 1 deletion package.json
Expand Up @@ -215,7 +215,12 @@
"type": "boolean",
"default": false,
"description": "Run ANTLR verification on all files when opened."
}
},
"systemverilog.compileOnOpen": {
"type": "boolean",
"default": false,
"description": "Compile all files when opened."
}
}
}
],
Expand Down
9 changes: 7 additions & 2 deletions src/server.ts
Expand Up @@ -23,7 +23,8 @@ const compilerConfigurationsKeys: string[] = [
'systemverilog.launchConfigurationVerible',
'systemverilog.antlrVerification',
'systemverilog.verifyOnOpen',
'systemverilog.excludeCompiling'
'systemverilog.excludeCompiling',
'systemverilog.compileOnOpen'
];

const backend: ANTLRBackend = new ANTLRBackend();
Expand Down Expand Up @@ -115,7 +116,7 @@ function updateConfigurationsSettings(): Promise<any> {
}

/**
* If `compileOnSave` is set to true, the server will compile the document.
* If `compileOnSave` and/or `compileOnOpen` is set to true, the server will compile the document.
*
* @param saveEvent An object containing information about the saved file
*/
Expand Down Expand Up @@ -172,6 +173,10 @@ documents.onDidOpen(async (openEvent) => {
// Check for verifyOnOpen being true
verifyDocument(openEvent.document.uri);
}
if (configurations.get(compilerConfigurationsKeys[8])) {
// Check for compileOnOpen being true
compile(openEvent.document);
}
});

/**
Expand Down