pub enum Refusal {
Broken,
NotAName,
Imported(String),
NotAnIdentifier(String),
Taken(String),
Unaccounted(String),
WouldNotCompile {
code: String,
message: String,
},
WouldStopBeingAnApplication,
}Expand description
Why a rename will not happen.
A variant per reason rather than one string, because the caller renders them: a language server puts them in an error response and a browser tab puts them beside the box somebody typed in.
Variants§
Broken
The document does not currently compile, so there is no program to rename in.
NotAName
There is no name under the caret.
Imported(String)
The name is declared in another module, and this editor is not showing that file.
NotAnIdentifier(String)
The new name is not one the lexer would read as an identifier.
Taken(String)
Something in this document is already written under the new name.
Unaccounted(String)
The name is used in a way this document’s analysis cannot account for — see
Editor::occurrences.
WouldNotCompile
The edit was made and the result does not compile.
WouldStopBeingAnApplication
The edit was made, the result compiles, and it is no longer an application.