mirror of
https://github.com/urbit/shrub.git
synced 2025-01-06 13:14:01 +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]
|
[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
|
++ handle-completion
|
||||||
|= com=text-document--completion:request:lsp-sur
|
|= com=text-document--completion:request:lsp-sur
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
@ -158,7 +172,7 @@
|
|||||||
=+ (get-id:auto pos txt)
|
=+ (get-id:auto pos txt)
|
||||||
?~ id ~
|
?~ id ~
|
||||||
=/ matches=(list (option:auto type))
|
=/ 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 ~
|
?~ matches ~
|
||||||
(turn matches make-completion-item)
|
(turn matches make-completion-item)
|
||||||
::
|
::
|
||||||
@ -308,7 +322,7 @@
|
|||||||
?~ id
|
?~ id
|
||||||
[(give-rpc-response [%text-document--hover id.hov ~]) state]
|
[(give-rpc-response [%text-document--hover id.hov ~]) state]
|
||||||
=/ match=(unit (option:auto type))
|
=/ 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
|
?~ match
|
||||||
[(give-rpc-response [%text-document--hover id.hov ~]) state]
|
[(give-rpc-response [%text-document--hover id.hov ~]) state]
|
||||||
=/ contents
|
=/ contents
|
||||||
|
Loading…
Reference in New Issue
Block a user