Skip to content

Commit 218b2f0

Browse files
spotandjakephated
andauthored
feat(lsp): Support goto definition on exceptions (#1895)
Co-authored-by: Blaine Bublitz <blaine.bublitz@gmail.com>
1 parent 1c43bd6 commit 218b2f0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

compiler/src/language_server/sourcetree.re

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,20 @@ module Sourcetree: Sourcetree = {
394394
},
395395
]
396396
@ segments^;
397+
| TExpConstruct(_, desc, _) =>
398+
segments :=
399+
[
400+
(
401+
loc_to_interval(exp.exp_loc),
402+
Value({
403+
env: exp.exp_env,
404+
value_type: desc.cstr_res,
405+
loc: exp.exp_loc,
406+
definition: Some(desc.cstr_loc),
407+
}),
408+
),
409+
...segments^,
410+
]
397411
| _ =>
398412
segments :=
399413
[

0 commit comments

Comments
 (0)