Skip to content

Commit 439949b

Browse files
committed
FIX -nostdlib editor tooling
1 parent a720330 commit 439949b

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

jscomp/bsb/bsb_merlin_gen.ml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,20 @@ let output_merlin_namespace buffer ns=
8787
Buffer.add_string buffer "-open ";
8888
Buffer.add_string buffer x
8989

90+
(* Literals.dash_nostdlib::
91+
FIX editor tooling, note merlin does not need -nostdlib since we added S and B
92+
RLS will add -I for those cmi files,
93+
Some consistency check is needed
94+
Unless we tell the editor to peek those cmi for auto-complete and others for building which is too
95+
complicated
96+
*)
9097
let bsc_flg_to_merlin_ocamlc_flg bsc_flags =
91-
merlin_flg ^
92-
String.concat Ext_string.single_space
93-
(List.filter (fun x -> not (Ext_string.starts_with x bs_flg_prefix )) (
94-
Literals.dash_nostdlib::bsc_flags))
98+
let flags = (List.filter (fun x -> not (Ext_string.starts_with x bs_flg_prefix )) (
99+
bsc_flags)) in
100+
if flags <> [] then
101+
merlin_flg ^
102+
String.concat Ext_string.single_space flags
103+
else ""
95104

96105
(* No need for [-warn-error] in merlin *)
97106
let warning_to_merlin_flg (warning: Bsb_warning.t ) : string=

0 commit comments

Comments
 (0)