def rename.of

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

import bolt@1.27.0.0/src/lsp/server.bend as Server
import Base
import bolt@1.27.0.0/src/lsp/proto.bend as Proto
import bolt@1.27.0.0/src/lsp/nav.bend as Nav
import bolt@1.27.0.0/src/lsp/enc.bend as Enc

494# only a name bound in the document renames; the editor shows the refusal
495def rename.of(cc: Enc.Cols, ss: Nav.Sites, uri: String, name: String, new: String) -> Answer:
496  Nav.Sites{mine, at} = ss
497  match mine:
498    case True{}:
499      Answer{Proto.rename(cc, uri, name, new, at)}
500    case False{}:
501      Refusal{"-32803", "only a name bound in this file can be renamed"}

Uses (6)

Used by (1)