Also allow renaming to underscore

This commit is contained in:
Wilco Kusee 2019-11-29 15:27:22 +01:00
parent 9c764cb966
commit f081c9d94d
No known key found for this signature in database
GPG key ID: D5B2BB5CDC3334BC

View file

@ -508,7 +508,9 @@ pub fn handle_rename(world: WorldSnapshot, params: RenameParams) -> Result<Optio
// Only rename to valid identifiers
let tokens = tokenize(&params.new_name);
if tokens.len() != 1 || tokens[0].kind != SyntaxKind::IDENT {
if tokens.len() != 1
|| (tokens[0].kind != SyntaxKind::IDENT && tokens[0].kind != SyntaxKind::UNDERSCORE)
{
return Ok(None);
}