4 ms·
renaming a class in vscode works in js and ts via typescript language service.
by STRiDEX 7y ago
renaming a class in vscode works in js and ts via typescript language service.
- _zamorano_ 7y agoHonest question: By "works" you mean you have 100% guarantee nothing will break nowhere?
- treve 7y agoEdge cases exist. I'd assume that Java and c# will also have edge-cases when things like reflection come into play.
- Filligree 7y agoCertainly, but reflection is almost never used. I don't think I've touched a single real-life codebase where it would get in the way in this manner. The same can't be said for languages like JS.
- smhinsey 7y agoEven reflection is going to vary based on your IDE. If you use ReSharper or Rider, a safe rename refactoring will locate and optionally update string references as well. I don't know if VS itself has adopted this feature.
- Filligree 7y agoIDEA does the same thing. It's amazingly useful, even if you don't use reflection -- variable names end up in comments and documentation as well, all of which it will offer to change.
- ken 7y agoI’ve never touched a “real life” code base in a static language (including C#) where this wouldn’t be an issue. C# is not a sufficiently high level language that I can avoid duplication without the use of reflection.
- dehrmann 7y agoPeople try to avoid reflection like the plague, most use cases don't depend on a hard-coded method/class name, and the ones that do can sometimes be detected by tools. It's pretty rare to run into this, and the one of two times I did something horrible like this, I wrote a test for it and made if fail loudly because what I was doing was brittle (by Java standards) and unexpected.