mirror of
https://github.com/urbit/shrub.git
synced 2025-01-01 17:16:47 +03:00
language-server: dynamically compute subject
Dynamically compute subject so that language server can see arms from imports. Fall back to -:!>(..zuse) if the build is an app, because of opaque payloads.
This commit is contained in:
parent
97e5570fc7
commit
a1a77990fc
@ -142,6 +142,20 @@
|
||||
==
|
||||
[cards state]
|
||||
::
|
||||
++ get-subject
|
||||
|= uri=@t
|
||||
^- type
|
||||
=/ =path
|
||||
(parse-uri:build uri)
|
||||
?: ?=([%app *] path)
|
||||
(get-app-subject uri)
|
||||
-:(~(gut by builds) uri !>(..zuse))
|
||||
::
|
||||
++ get-app-subject
|
||||
|= uri=@t
|
||||
^- type
|
||||
-:!>(..zuse)
|
||||
::
|
||||
++ handle-completion
|
||||
|= com=text-document--completion:request:lsp-sur
|
||||
^- (quip card _state)
|
||||
@ -158,7 +172,7 @@
|
||||
=+ (get-id:auto pos txt)
|
||||
?~ id ~
|
||||
=/ matches=(list (option:auto type))
|
||||
(search-prefix:auto u.id (get-identifiers:auto -:!>(..zuse)))
|
||||
(search-prefix:auto u.id (get-identifiers:auto (get-subject uri.com)))
|
||||
?~ matches ~
|
||||
(turn matches make-completion-item)
|
||||
::
|
||||
@ -308,7 +322,7 @@
|
||||
?~ id
|
||||
[(give-rpc-response [%text-document--hover id.hov ~]) state]
|
||||
=/ match=(unit (option:auto type))
|
||||
(search-exact:auto u.id (get-identifiers:auto -:!>(..zuse)))
|
||||
(search-exact:auto u.id (get-identifiers:auto (get-subject uri.hov)))
|
||||
?~ match
|
||||
[(give-rpc-response [%text-document--hover id.hov ~]) state]
|
||||
=/ contents
|
||||
|
Loading…
Reference in New Issue
Block a user