Skip to content

Commit

Permalink
Make completion info request lazy evaluated (#908)
Browse files Browse the repository at this point in the history
  • Loading branch information
rochala authored Jul 27, 2023
1 parent 86b8bd1 commit 2268247
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ trait MetalsAutocompletion extends MetalsClient with DebouncingCapabilities {
*/
private def getCompletionInfo(completionItemDTO: api.CompletionItemDTO): CompletionInfoF = {
val key = completionItemDTO.symbol.getOrElse(completionItemDTO.label)
val maybeCachedResult = completionInfoCache.get(key)
lazy val maybeCachedResult = completionInfoCache.get(key)
.map(node => js.Promise.resolve[dom.Node](node))
.getOrElse {
makeRequest(api.CompletionInfoRequest(scastieMetalsOptions, completionItemDTO), "completionItemResolve")
Expand Down

0 comments on commit 2268247

Please sign in to comment.