Server.work: def of bolt@1.27.0.0 Import: import bolt@1.27.0.0/src/lsp/server.bend as Server Lines 551-593 of bolt@1.27.0.0/src/lsp/server.bend: https://jend.leeeet.dev/read.txt?path=bolt@1.27.0.0/src/lsp/server.bend&start_line=551&end_line=593 import Base import emerging-ezjson@1.2.0.0/main.bend as Ezjson import emerging-ezjson@1.2.0.0/src/value.bend as J import bolt@1.27.0.0/src/lsp/proto.bend as Proto import bolt@1.27.0.0/src/lsp/docs.bend as Docs import bolt@1.27.0.0/src/lsp/checker/answer.bend as C import bolt@1.27.0.0/src/lsp/files/service.bend as F import bolt@1.27.0.0/src/lsp/enc.bend as Enc # the work behind a method: what the checker, the files and the documents # give it. It does not see the message's id: step alone puts that on a reply def work( # noqa: L001 LSP IO glue ~fs: F.Files, ~ck: C.Checker, ee: Enc.Enc, mm: Method, +params: J.Json, +docs: List<&2, Docs.Doc> ) -> IO(Work): match mm: case MInitialize{}: IO.pure(Work, answered(Proto.capabilities(ee), docs)) case MShutdown{}: IO.pure(Work, answered(J.JNull{}, docs)) case MExit{}: IO.pure(Work, noted([], docs)) case MOpen{}: pub.opened(~fs, ~ck, ee, uri_of(params), Maybe.default(&2, String, Ezjson.as_str(Ezjson.get(Ezjson.get(params, "textDocument"), "text")), ""), docs) case MChange{}: pub.changed(~fs, ee, uri_of(params), Maybe.default(&2, String, Ezjson.as_str(Ezjson.get(Ezjson.at(Ezjson.get(params, "contentChanges"), 0), "text")), ""), docs) case MSave{}: pub.saved(~fs, ~ck, ee, uri_of(params), docs) case MClose{}: IO.pure(Work, pub.close(ee, uri_of(params), docs)) case MHover{}: hovered(~fs, ee, docs, uri_of(params), params) case MDefinition{}: defined(~fs, ee, docs, uri_of(params), params) case MSymbols{}: symbols(~fs, ee, docs, uri_of(params)) case MCompletion{}: complete(~fs, ee, docs, uri_of(params), params) case MReferences{}: references(~fs, ee, docs, uri_of(params), params) case MRename{}: renamed(~fs, ee, docs, uri_of(params), params) case MSemantic{}: semantic(~fs, ee, docs, uri_of(params)) case MOther{}: IO.pure(Work, noted([], docs)) Uses (30): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe.default https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/checker/answer.bend&name=Checker https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/docs.bend&name=Doc https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/enc.bend&name=Enc https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/files/service.bend&name=Files https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/proto.bend&name=capabilities https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/server.bend&name=Method https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/server.bend&name=Work https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/server.bend&name=answered https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/server.bend&name=complete https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/server.bend&name=defined https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/server.bend&name=hovered https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/server.bend&name=noted https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/server.bend&name=pub.changed https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/server.bend&name=pub.close https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/server.bend&name=pub.opened https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/server.bend&name=pub.saved https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/server.bend&name=references https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/server.bend&name=renamed https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/server.bend&name=semantic https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/server.bend&name=symbols https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/lsp/server.bend&name=uri_of https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/main.bend&name=as_str https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/main.bend&name=at https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/main.bend&name=get https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/value.bend&name=Json