Skip to content

Commit f7d7a28

Browse files
authored
"Dependencies: -" if there are no dependencies (instead of "Dependenc… (#438)
* "Dependencies: -" if there are no dependencies (instead of "Dependencies:") * `Dependencies: [none]`
1 parent f3a0c69 commit f7d7a28

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/lsp/MessageHandlers.re

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,11 @@ let handlers: list((string, (state, Json.t) => result((state, Json.t), string)))
345345
CodeLens.forOpens(extra)
346346
} : lenses;
347347

348-
let showDependencies = state.settings.dependenciesCodelens;
349-
let lenses = showDependencies ? [("Dependencies: " ++ String.concat(", ",
350-
List.map(SharedTypes.hashList(extra.externalReferences), fst)
351-
), topLoc), ...lenses] : lenses;
348+
let depsList = List.map(SharedTypes.hashList(extra.externalReferences), fst)
349+
let depsString = depsList == [] ? "[none]" : String.concat(", ", depsList)
350+
let lenses = (state.settings.dependenciesCodelens==true) ?
351+
[("Dependencies: " ++ depsString, topLoc), ...lenses]
352+
: lenses;
352353

353354
lenses
354355
};

0 commit comments

Comments
 (0)