File tree Expand file tree Collapse file tree 4 files changed +10
-5
lines changed Expand file tree Collapse file tree 4 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -96,4 +96,9 @@ let rec collect ?(checkDir = fun _ -> true) path test =
96
96
else []
97
97
| _ -> if test path then [path] else []
98
98
99
- let isResFile path = Filename. check_suffix path " .res" && exists path
99
+ type classifiedFile = Res | Resi | Other
100
+
101
+ let classifyFile path =
102
+ if Filename. check_suffix path " .res" && exists path then Res
103
+ else if Filename. check_suffix path " .resi" && exists path then Resi
104
+ else Other
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ let inlay ~path ~pos ~maxLength ~debug =
89
89
Ast_iterator. default_iterator.value_binding iterator vb
90
90
in
91
91
let iterator = {Ast_iterator. default_iterator with value_binding} in
92
- (if Files. isResFile path then
92
+ (if Files. classifyFile path = Res then
93
93
let parser =
94
94
Res_driver. parsingEngine.parseImplementation ~for Printer:false
95
95
in
@@ -150,7 +150,7 @@ let codeLens ~path ~debug =
150
150
let iterator = {Ast_iterator. default_iterator with value_binding} in
151
151
(* We only print code lenses in implementation files. This is because they'd be redundant in interface files,
152
152
where the definition itself will be the same thing as what would've been printed in the code lens. *)
153
- (if Files. isResFile path then
153
+ (if Files. classifyFile path = Res then
154
154
let parser =
155
155
Res_driver. parsingEngine.parseImplementation ~for Printer:false
156
156
in
Original file line number Diff line number Diff line change @@ -431,7 +431,7 @@ let command ~debug ~emitter ~path =
431
431
}
432
432
in
433
433
434
- if Files. isResFile path then (
434
+ if Files. classifyFile path = Res then (
435
435
let parser =
436
436
Res_driver. parsingEngine.parseImplementation ~for Printer:false
437
437
in
Original file line number Diff line number Diff line change @@ -302,7 +302,7 @@ let parse ~filename =
302
302
303
303
let extractCodeActions ~path ~pos ~currentFile ~debug =
304
304
match Cmt. fullFromPath ~path with
305
- | Some full when Files. isResFile currentFile ->
305
+ | Some full when Files. classifyFile currentFile = Res ->
306
306
let structure, printExpr, printStructureItem =
307
307
parse ~filename: currentFile
308
308
in
You can’t perform that action at this time.
0 commit comments