Add fix for incorrect case diagnostic

This commit is contained in:
Igor Aleksanov
2020-10-03 17:34:52 +03:00
parent 17f1026c46
commit e24e22f288
8 changed files with 112 additions and 30 deletions

View File

@@ -42,7 +42,14 @@ pub(crate) fn rename(
new_name: &str,
) -> Result<RangeInfo<SourceChange>, RenameError> {
let sema = Semantics::new(db);
rename_with_semantics(&sema, position, new_name)
}
pub(crate) fn rename_with_semantics(
sema: &Semantics<RootDatabase>,
position: FilePosition,
new_name: &str,
) -> Result<RangeInfo<SourceChange>, RenameError> {
match lex_single_syntax_kind(new_name) {
Some(res) => match res {
(SyntaxKind::IDENT, _) => (),