Skip to content

Commit

Permalink
Backport "Avoid import suggestion thread hang if -Ximport-suggestion-…
Browse files Browse the repository at this point in the history
…timeout <= 1" to LTS (#22112)

Backports #21434 to the 3.3.5.

PR submitted by the release tooling.
[skip ci]
  • Loading branch information
WojciechMazur authored Dec 4, 2024
2 parents 5c6d059 + ef91aa7 commit 52a6878
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ trait ImportSuggestions:
* `name` that are applicable to `T`.
*/
private def importSuggestions(pt: Type)(using Context): (List[TermRef], List[TermRef]) =
val timer = new Timer()
val allotted = ctx.run.nn.importSuggestionBudget
if allotted <= 1 then return (Nil, Nil)
val timer = new Timer()
implicits.println(i"looking for import suggestions, timeout = ${allotted}ms")
val start = System.currentTimeMillis()
val deadLine = start + allotted
Expand Down

0 comments on commit 52a6878

Please sign in to comment.