@@ -37,7 +37,7 @@ class ErrorHandler {
3737
3838export async function launch ( context : vscode . ExtensionContext ) : Promise < void > {
3939 const isEasyProject = await isEsyProject ( ) ;
40- return launchMerlinLsp ( context , isEasyProject ) ;
40+ return launchMerlinLsp ( context , { useEsy : isEasyProject } ) ;
4141}
4242
4343async function isEsyProject ( ) {
@@ -73,15 +73,15 @@ async function isEsyProject() {
7373 return false ;
7474}
7575
76- function getMerlinLspOptions ( useEsy : boolean ) {
76+ function getMerlinLspOptions ( options : { useEsy : boolean } ) {
7777 const reasonConfig = vscode . workspace . getConfiguration ( "reason" ) ;
7878 let ocamlmerlinLsp = reasonConfig . get < string | null > ( "path.ocamlmerlin-lsp" , null ) ;
7979 if ( ocamlmerlinLsp == null ) {
8080 ocamlmerlinLsp = isWin ? "ocamlmerlin-lsp.exe" : "ocamlmerlin-lsp" ;
8181 }
8282
8383 let run ;
84- if ( useEsy ) {
84+ if ( options . useEsy ) {
8585 run = {
8686 args : [ "exec-command" , "--include-current-env" , ocamlmerlinLsp ] ,
8787 command : process . platform === "win32" ? "esy.cmd" : "esy" ,
@@ -118,8 +118,8 @@ function getMerlinLspOptions(useEsy: boolean) {
118118 return serverOptions ;
119119}
120120
121- export async function launchMerlinLsp ( context : vscode . ExtensionContext , useEsy : boolean ) : Promise < void > {
122- const serverOptions = getMerlinLspOptions ( useEsy ) ;
121+ export async function launchMerlinLsp ( context : vscode . ExtensionContext , options : { useEsy : boolean } ) : Promise < void > {
122+ const serverOptions = getMerlinLspOptions ( options ) ;
123123 const reasonConfig = vscode . workspace . getConfiguration ( "reason" ) ;
124124
125125 const languages = reasonConfig . get < string [ ] > ( "server.languages" , [ "ocaml" , "reason" ] ) ;
0 commit comments