user3787706
user3787706

Reputation: 659

Why do we have to refactor->rename files?

Why can't we just F2 in IDEs?

Instead we have to Refactor -> Rename... -> Enter name, tick some boxes etc.?

I understand that being more or less necessary (even if it could also work without all the hassle) for variables/methods etc., but if I JUST want to change the name of a file, why is this not implemented to work just like that?

(I don't know if this is true for ALL IDEs, but i suppose the majority, specifically talkiing about JetBrains here)

Upvotes: 0

Views: 70

Answers (1)

johnsgp
johnsgp

Reputation: 103

Firstly, the file name could be referenced from other files, so needs to be changed in those files too.

Secondly, some languages, like Java, use the file name within the file. In Java, the class name must be the same as the file name without the .java extension.

Upvotes: 1

Related Questions