File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Expand file tree Collapse file tree 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";
66import { performance } from "perf_hooks" ;
77import * as p from "vscode-languageserver-protocol" ;
88import * as cp from "node:child_process" ;
9+ import semver from "semver" ;
910import config , { send } from "./config" ;
1011import * as c from "./constants" ;
1112import * as chokidar from "chokidar" ;
@@ -573,8 +574,11 @@ async function figureOutBscArgs(entry: IncrementallyCompiledFileInfo) {
573574 } ) ;
574575
575576 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+ ) {
578582 callArgs . push ( "-ignore-parse-errors" ) ;
579583 }
580584
Original file line number Diff line number Diff line change @@ -243,15 +243,8 @@ export let runAnalysisAfterSanityCheck = async (
243243 * with the extension itself.
244244 */
245245 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" ) ;
255248
256249 if ( ! shouldUseBuiltinAnalysis && project != null ) {
257250 binaryPath = project . editorAnalysisLocation ;
You can’t perform that action at this time.
0 commit comments