File tree 2 files changed +8
-11
lines changed
2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import readline from "readline";
6
6
import { performance } from "perf_hooks" ;
7
7
import * as p from "vscode-languageserver-protocol" ;
8
8
import * as cp from "node:child_process" ;
9
+ import semver from "semver" ;
9
10
import config , { send } from "./config" ;
10
11
import * as c from "./constants" ;
11
12
import * as chokidar from "chokidar" ;
@@ -573,8 +574,11 @@ async function figureOutBscArgs(entry: IncrementallyCompiledFileInfo) {
573
574
} ) ;
574
575
575
576
callArgs . push ( "-color" , "never" ) ;
576
- if ( parseInt ( project . rescriptVersion . split ( "." ) [ 0 ] ?? "10" ) >= 11 ) {
577
- // Only available in v11+
577
+ // Only available in v11+
578
+ if (
579
+ semver . valid ( project . rescriptVersion ) &&
580
+ semver . satisfies ( project . rescriptVersion as string , ">=11" , { includePrerelease : true } )
581
+ ) {
578
582
callArgs . push ( "-ignore-parse-errors" ) ;
579
583
}
580
584
Original file line number Diff line number Diff line change @@ -243,15 +243,8 @@ export let runAnalysisAfterSanityCheck = async (
243
243
* with the extension itself.
244
244
*/
245
245
let shouldUseBuiltinAnalysis =
246
- rescriptVersion ?. startsWith ( "9." ) ||
247
- rescriptVersion ?. startsWith ( "10." ) ||
248
- rescriptVersion ?. startsWith ( "11." ) ||
249
- [
250
- "12.0.0-alpha.1" ,
251
- "12.0.0-alpha.2" ,
252
- "12.0.0-alpha.3" ,
253
- "12.0.0-alpha.4" ,
254
- ] . includes ( rescriptVersion ?? "" ) ;
246
+ semver . valid ( rescriptVersion ) &&
247
+ semver . lt ( rescriptVersion as string , "12.0.0-alpha.5" ) ;
255
248
256
249
if ( ! shouldUseBuiltinAnalysis && project != null ) {
257
250
binaryPath = project . editorAnalysisLocation ;
You can’t perform that action at this time.
0 commit comments