def renamed

bolt@1.27.0.0 · src/lsp/server.bend:519

import bolt@1.27.0.0/src/lsp/server.bend as Server
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/docs.bend as Docs
import bolt@1.27.0.0/src/lsp/nav.bend as Nav
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
import bolt@1.27.0.0/src/syntax/word.bend as Word

519# the edit renaming the name at a position, or a refusal
520def renamed(  # noqa: L001 LSP IO glue
521  ~fs: F.Files,
522  ee: Enc.Enc,
523  +docs: List<&2, Docs.Doc>,
524  +uri: String,
525  +params: J.Json
526) -> IO(Work):
527  do IO<Work>:
528    +text : String <- Nav.text_of(~fs, docs, uri)
529    +cc : Enc.Cols = Enc.cols(ee, text)
530    +line : U32 = line_of(params)
531    +col : U32 = col_in(cc, params)
532    s : Nav.Sites <- Nav.sites(~fs, docs, uri, line, col)
533    return Work{[],
534      rename.of(cc, s, uri, Word.at(text, line, col),
535        Maybe.default(&2, String, Ezjson.as_str(Ezjson.get(params, "newName")), "")),
536      docs}

Uses (23)

Used by (1)