trawor / XToDo

Xcode plugin to collect and list the `TODO`,`FIXME`,`???`,`!!!!`
http://imi.im/xtodo
1.54k stars 179 forks source link

Plugin doesn't work if source not next to xcodeproj file, standalone app works with custom locations #78

Open matkatmusic opened 8 years ago

matkatmusic commented 8 years ago

Downloaded the source code on both my imac running OS X 10.9.5 and my macbook pro running OS X 10.11.1. I compiled the project for both systems and restarted XCode and loaded up a project with some TODO comments in it. The plugin appears in the menus and everything seems to work ok, yet no actual listing of TODO points occurs in plugin window.

However, if I run the stand-alone app, set the source directory to that same project and add the TODO keywords, the App window lists the TODOs for the source directory correctly.

I'm not even sure where to begin finding out why this is happening.

matkatmusic commented 8 years ago

I found the problem.

My project's source code is located at: /Volumes/Thunderbay/MyBook2/Dropbox/CharlesShared/Chordie 1.3.0/Source When i copy and paste the value that $SRCROOT expands to, I get this: /Volumes/Thunderbay/MyBook2/Dropbox/CharlesShared/Chordie 1.3.0/Builds/MacOSX/

Is there a way to make XToDo read the directory structure for the project and grab any source files it finds?

matkatmusic commented 8 years ago

Some further information:

So, XCode stores the location of files inside .xcodeproj, specifically inside the project.pbxproj file Inside that file is a list of source code references that need resolving for xcode to find the source files.

they look like this:

4661B0BBB9230CC799E419EF /* Utilities.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Utilities.cpp; path = ../../Source/Utilities.cpp; sourceTree = SOURCE_ROOT; };

So, however your plugin is expanding paths needs to be able to process the "../" for it to work with any XCode project.

matkatmusic commented 8 years ago

it looks like the plugin searches files in folders... as opposed to reading the Xcode project and searching the associated files.

matkatmusic commented 8 years ago

just to add a bit more. if I add in "$SRCROOT/../../Source/" as a folder to find files in, it'll find all of the source code for my project and list the TODOs for it.