We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d0de60b commit da0841cCopy full SHA for da0841c
analysis/src/DocumentSymbol.ml
@@ -27,11 +27,16 @@ let kindNumber = function
27
let command ~path =
28
let symbols = ref [] in
29
let addSymbol name loc kind =
30
- let range = Utils.cmtLocToRange loc in
31
- let symbol : Protocol.documentSymbolItem =
32
- {name; range; kind = kindNumber kind; children = []}
33
- in
34
- symbols := symbol :: !symbols
+ if
+ (not loc.Location.loc_ghost)
+ && loc.loc_start.pos_cnum >= 0
+ && loc.loc_end.pos_cnum >= 0
+ then
35
+ let range = Utils.cmtLocToRange loc in
36
+ let symbol : Protocol.documentSymbolItem =
37
+ {name; range; kind = kindNumber kind; children = []}
38
+ in
39
+ symbols := symbol :: !symbols
40
in
41
let rec exprKind (exp : Parsetree.expression) =
42
match exp.pexp_desc with
0 commit comments