mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-14 08:34:25 +03:00
Merge pull request #4347 from urbit/lf/moar-lsp
language-server: fixes & improvements
This commit is contained in:
commit
c16815b003
@ -5,7 +5,7 @@
|
||||
easy-print=language-server-easy-print,
|
||||
rune-snippet=language-server-rune-snippet,
|
||||
build=language-server-build,
|
||||
default-agent
|
||||
default-agent, verb
|
||||
|%
|
||||
+$ card card:agent:gall
|
||||
+$ lsp-req
|
||||
@ -44,6 +44,7 @@
|
||||
==
|
||||
--
|
||||
^- agent:gall
|
||||
%+ verb |
|
||||
=| state-zero
|
||||
=* state -
|
||||
=<
|
||||
@ -69,7 +70,7 @@
|
||||
|= old-state=vase
|
||||
^- (quip card _this)
|
||||
~& > %lsp-upgrade
|
||||
[~ this(state *state-zero)]
|
||||
[~ this(state !<(state-zero old-state))]
|
||||
::
|
||||
++ on-poke
|
||||
^+ on-poke:*agent:gall
|
||||
@ -275,12 +276,14 @@
|
||||
++ handle-did-open
|
||||
|= item=text-document-item:lsp-sur
|
||||
^- (quip card _state)
|
||||
=/ =path
|
||||
(uri-to-path:build uri.item)
|
||||
?: ?=(%sys -.path)
|
||||
`state
|
||||
=/ buf=wall
|
||||
(to-wall (trip text.item))
|
||||
=. bufs
|
||||
(~(put by bufs) uri.item buf)
|
||||
=/ =path
|
||||
(uri-to-path:build uri.item)
|
||||
:_ state
|
||||
%+ weld
|
||||
(give-rpc-notification (get-diagnostics uri.item))
|
||||
@ -318,12 +321,12 @@
|
||||
?~ p.tab-list ~
|
||||
?~ u.p.tab-list ~
|
||||
:- ~
|
||||
%- crip
|
||||
;: weld
|
||||
"`"
|
||||
~(ram re ~(duck easy-print detail.i.u.p.tab-list))
|
||||
"`"
|
||||
==
|
||||
=- (crip :(weld "```hoon\0a" tape "\0a```"))
|
||||
^- =tape
|
||||
%- zing
|
||||
%+ join "\0a"
|
||||
%+ scag 40
|
||||
(~(win re ~(duck easy-print detail.i.u.p.tab-list)) 0 140)
|
||||
::
|
||||
++ sync-buf
|
||||
|= [buf=wall changes=(list change:lsp-sur)]
|
||||
|
@ -185,6 +185,7 @@
|
||||
[%zpmc *] (both p.gen q.gen)
|
||||
[%zpts *] loop(gen p.gen)
|
||||
[%zppt *] (both q.gen r.gen)
|
||||
[%zpgl *] (spec-and-hoon p.gen q.gen)
|
||||
[%zpzp *] ~
|
||||
*
|
||||
=+ doz=~(open ap gen)
|
||||
@ -245,15 +246,25 @@
|
||||
^- (unit [term type])
|
||||
~
|
||||
::
|
||||
++ get-id-sym
|
||||
|= [pos=@ud =tape]
|
||||
%^ get-id pos tape
|
||||
^- $-(nail (like (unit @t)))
|
||||
;~(sfix (punt sym) (star ;~(pose prn (just `@`10))))
|
||||
::
|
||||
++ get-id-cord
|
||||
|= [pos=@ud =tape]
|
||||
%^ get-id pos tape
|
||||
^- $-(nail (like (unit @t)))
|
||||
;~(sfix (punt (cook crip (star prn))) (star ;~(pose prn (just `@`10))))
|
||||
::
|
||||
++ get-id
|
||||
|= [pos=@ud txt=tape]
|
||||
|= [pos=@ud txt=tape seek=$-(nail (like (unit @t)))]
|
||||
^- [forward=(unit @t) backward=(unit @t) id=(unit @t)]
|
||||
=/ seek
|
||||
;~(sfix (punt (cook crip (star prn))) (star ;~(pose prn (just `@`10))))
|
||||
=/ forward=(unit @t)
|
||||
(scan (slag pos txt) seek)
|
||||
=/ backward=(unit @t)
|
||||
%- (lift |=(t=@tas (swp 3 t)))
|
||||
%- (lift |=(t=@t (swp 3 t)))
|
||||
(scan (flop (scag pos txt)) seek)
|
||||
=/ id=(unit @t)
|
||||
?~ forward
|
||||
@ -272,7 +283,7 @@
|
||||
^- [back-pos=@ud fore-pos=@ud txt=tape]
|
||||
:: Find beg-pos by searching backward to where the current term
|
||||
:: begins
|
||||
=+ (get-id pos txt)
|
||||
=+ (get-id-sym pos txt)
|
||||
=/ back-pos
|
||||
?~ backward
|
||||
pos
|
||||
|
@ -291,7 +291,7 @@
|
||||
++ tab
|
||||
|= pos=@ud
|
||||
^- (quip card _cli-state)
|
||||
=+ (get-id:auto pos (tufa buf.cli-state))
|
||||
=+ (get-id-cord:auto pos (tufa buf.cli-state))
|
||||
=/ needle=term
|
||||
(fall id %$)
|
||||
:: autocomplete empty command iff user at start of command
|
||||
|
Loading…
Reference in New Issue
Block a user