gluon_language-server
gluon_language-server copied to clipboard
Deadlock problems still exist in version 0.17
Try this code copied from https://github.com/gluon-lang/gluon/issues/842.
type Digit a =
| One a
| Two a a
| Three a a a
| Four a a a a
type Node b =
| Node2 b b
| Node3 b b b
type FingerTree c =
| Empty
| Single c
| Deep (Digit c) (FingerTree (Node c)) (Digit c)
type View d =
| Nil
| View d (FingerTree d)
rec let viewl xs : FingerTree e -> View e =
match xs with
| Empty -> Nil
| Single x -> View x Empty
| Deep (One a) deeper suffix ->
match viewl deeper with
| View (Node2 b c) rest -> View a (Deep (Two b c) rest suffix)
| View (Node3 b c d) rest -> View a (Deep (Three b c d) rest suffix)
| Nil ->
match suffix with
| One w -> View a (Single w)
| Two w x -> View a (Deep (One w) Empty (One x))
| Three w x y -> View a (Deep (Two w x) Empty (One y))
| Four w x y z -> View a (Deep (Three w x y) Empty (One z))
| Deep (Two a b) deeper suffix -> View a (Deep (One b) deeper suffix)
| Deep (Three a b c) deeper suffix -> View a (Deep (Two b c) deeper suffix)
| Deep (Four a b c d) deeper suffix -> View a (Deep (Three b c d) deeper suffix)
viewl
Find this line type View d =
, modify the d
to a
, save the file. If nothing happens, modify a
back to d
, save. Repeat this procedure for a few times and the LSP would lock up.
Based on the experiences of my attempts to find out the problems, this probably happens here:
https://github.com/gluon-lang/gluon_language-server/blob/5465972e5e41481accc8cb14ddef1b470cd1f7c8/src/diagnostics.rs#L340-L342
But I didn't find out who is blocking it.