|ISourceModule from Non-DLTK Project [message #489586]
||Mon, 05 October 2009 07:18
| Andreas Nusser
Registered: October 2009
Before explaining my problem, let me give you some background:
One of the features of my current project is that it parses the source files of a project to obtain the internal structure. This information is then displayed in a way that the user can click on it and Eclipse jumps to the appropriate source location. Like an extended Outline.
Thanks to JDT and DLKT (and the "getHandleIdentifier()") this works like a charm 99% of the time.
Now to the problem:
Sometimes there are projects which contain mixed sources (Java and PHP) but the project nature is only Java. In this case, the DLTK wan't allow me to open the project iterate through it. First I've tried the ISourceParser, but I couldn't find a way from a ModuleDeclaration to an ISourceModule.
Then I tried to use the Workspace root as model and iterate over it, but it only returns an empty model.
Then I tried to create a ScriptProject and walk my way to ScriptFolder and call "getSourceModule(filename)". This works, but only for the files in the project root. For some reason I can't get it to work with scripts located in directories below the root.
Finally I tried the ScriptFolder method "createSourceModule(...)"
which resulted in a "not implemented" exception.
So it all boils down to the question: How can I get an ISourceModule object from a file which does not belong to a project with DLTK nature?
Powered by FUDForum
. Page generated in 0.02166 seconds