I'm interested if there is a way or technique (or even "trick") that will allow me to track and resolve naming dependencies in a TextMate project.
Specifically, I'm thinking of the situation where, as I develop a web site, I decide that I need to move or rename an existing file. In order to prevent the website from breaking, I must then locate and change any and all references to that file in ALL of the files in the project. I can use Find and Replace in Project to accomplish that, but this is hardly proactive on the part of TextMate. I have to stop to do it, or *remember* to do it later.
If I were using GoLive or Dreamweaver I assume that if I changed the name of a file in a project, I'd get a message that that file was referenced in "X" number of files and would I like to update all those files to reflect the new name?
Is there any way now (or might there be any way in the future) to handle this situation?
I'm not programming in C or the like, but it seems to me that a similar situation could occur there: Say that for some reason you change the name of an include or header file... you'll be into a real mess if you don't detect all the locations in the code where that file is referenced and change it! OR... if you change a variable name for some reason, references to that name will need to be changed (even though we aren't changing a FILE name in that case).
Thanks,
eo
On 8/3/2006, at 3:26, Eric O'Brien wrote:
I'm interested if there is a way or technique (or even "trick") that will allow me to track and resolve naming dependencies in a TextMate project.
I don’t think this has come up yet. So no public tricks for that.
[...] I'm not programming in C or the like, but it seems to me that a similar situation could occur there: Say that for some reason you change the name of an include or header file... you'll be into a real mess if you don't detect all the locations in the code where that file is referenced and change it! OR... if you change a variable name for some reason, references to that name will need to be changed (even though we aren't changing a FILE name in that case).
Changing the name of an include happens close to never for me. When it does, a find in project is just as fast (if not faster) as invocating some custom UI for this (having it auto do it would trigger a lot of false positives).
As for renaming variables and stuff, that’s called refactoring, and various Java IDEs are known for their good refactoring support. But this requires a language parser, and I have never heard of refactoring tools for e.g. C++, likely because it is anything but trivial. I think Ruby developers comming from Java initially ask for refactoring tools, and then they later realize that they do not need them, now that they have escaped the boilerplate and manifest typing of Java ;)
Without knowing what and how you develop, but renaming files often and linking to them from many places, sounds like a bad idea, especially if this is for the web (and you are not using some URL- rewriting scheme). I have written lots of things in the past which link to articles and documentation at developer.apple.com, today majority of these links are broken (and so I would assume is a lot of bookmarks) because Apple apparently didn’t read “Cool URIs don’t change” [1].