Skip to content

Commit 6d1a104

Browse files
authored
Merge pull request #1240 from rocq-prover/resilient-init
2.4.3 with resilient init
2 parents 6ee971d + 767ca71 commit 6d1a104

5 files changed

Lines changed: 36 additions & 23 deletions

File tree

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "VsRocq is an extension for Visual Studio Code with support for the Rocq Prover",
55
"publisher": "rocq-prover",
66
"license": "MIT",
7-
"version": "2.4.2",
7+
"version": "2.4.3",
88
"repository": {
99
"type": "git",
1010
"url": "https://github.com/rocq-prover/vsrocq.git"

client/src/utilities/toolchain.ts

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -105,32 +105,44 @@ export default class VsRocqToolchainManager implements Disposable {
105105
const config = workspace.getConfiguration('vsrocq').get('args') as string[];
106106
const options = ["-without-project-file", "-where"].concat(config);
107107
const cmd = [this._vsrocqtopPath].concat(options).join(' ');
108+
// fallback for < 2.4.0
109+
const pre240options = ["-where"].concat(config);
110+
const pre240cmd = [this._vsrocqtopPath].concat(pre240options).join(' ');
108111

109112
return new Promise((resolve, reject: ((reason: ToolchainError) => void)) => {
110-
exec(cmd, {cwd: workspace.rootPath}, (error, stdout, stderr) => {
111113

114+
const onSuccess = (stdout: string) => {
115+
this._rocqPath = stdout;
116+
this.rocqVersion().then(
117+
() => resolve(),
118+
(err) => reject({
119+
status: ToolChainErrorCode.launchError,
120+
message: `${this._vsrocqtopPath} crashed with the following message: ${err}.
121+
This could be due to a bad Rocq installation or an incompatible Rocq version`
122+
})
123+
);
124+
};
125+
126+
const onError = (stderr: string) => {
127+
reject({
128+
status: ToolChainErrorCode.launchError,
129+
message: `${this._vsrocqtopPath} crashed with the following message: ${stderr}
130+
This could be due to a bad Rocq installation or an incompatible Rocq version.`
131+
});
132+
};
133+
134+
exec(cmd, {cwd: workspace.rootPath}, (error, stdout, stderr1) => {
112135
if(error) {
113-
reject({
114-
status: ToolChainErrorCode.launchError,
115-
message: `${this._vsrocqtopPath} crashed with the following message: ${stderr}
116-
This could be due to a bad Rocq installation or an incompatible Rocq version.`
136+
exec(pre240cmd, {cwd: workspace.rootPath}, (error, stdout, stderr2) => {
137+
if(error) {
138+
onError(`${cmd}\n${stderr1}\n\n${pre240cmd}\n${stderr2}\n`);
139+
} else {
140+
onSuccess(stdout);
141+
}
117142
});
118143
} else {
119-
this._rocqPath = stdout;
120-
this.rocqVersion().then(
121-
() => {
122-
resolve();
123-
},
124-
(err) => {
125-
reject({
126-
status: ToolChainErrorCode.launchError,
127-
message: `${this._vsrocqtopPath} crashed with the following message: ${err}.
128-
This could be due to a bad Rocq installation or an incompatible Rocq version`
129-
});
130-
}
131-
);
144+
onSuccess(stdout);
132145
}
133-
134146
});
135147
});
136148
};

client/src/utilities/versioning.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ const versionRequirements : VersionReq = {
5757
'2.3.4': '2.3.3',
5858
'2.4.0': '2.4.0',
5959
'2.4.1': '2.4.0',
60-
'2.4.2': '2.4.0'
60+
'2.4.2': '2.4.0',
61+
'2.4.3': '2.3.3'
6162
};
6263

6364
//We will add version ranges as we start releasing

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
vscodeExtPublisher = "rocq-prover";
2424
vscodeExtName = "vsrocq";
2525
vscodeExtUniqueId = "rocq-prover.vsrocq";
26-
vsrocq_version = "2.4.2";
26+
vsrocq_version = "2.4.3";
2727
rocq = (import nixpkgs {inherit system;}).rocq-core.override { version = rocq-master.outPath; };
2828
in rec {
2929
formatter = nixpkgs.legacyPackages.${system}.alejandra;

language-server/vsrocqtop/lspManager.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ let conf_request_id = max_int
4646

4747
let server_info = InitializeResult.create_serverInfo
4848
~name:"vsrocq-language-server"
49-
~version:"2.4.2"
49+
~version:"2.4.3"
5050
()
5151

5252
type lsp_event =

0 commit comments

Comments
 (0)