sebastianbenz / eclipse-task-editor

A simple textual todo manager for Eclipse.
44 stars 11 forks source link

Link to java-file or specific codeline? #42

Open derwiwie opened 12 years ago

derwiwie commented 12 years ago

Hey there,

first of all I want to say, that it is a very nice project you set up there :-)

I have a question, whether it is somehow possible to add a link to a certain todo entry, such that by clicking one gets directly to the corresponding java-file or a line-number in the code?

That would be a very nice feature since by the nature of the todo-file there is no direct connection between the todo-entry itself and the location this todo belongs to.

Best, derwiwie

sebastianbenz commented 12 years ago

Thanks for the kind words. Linking to java files is currently not possible. However, referencing java entities (e.g. java.lang.String or java.lang.String#length) should be quite easy to implement as xtext already provides access to the JVM types. The question is what the syntax should look like?

derwiwie commented 12 years ago

Hey Sebastian,

well, there are different ways it could look like. My first idea was similar to the syntax of java doc linking, i.e. {@link LinkedClass} or {@link #perform}. A small extension of this syntax for line numbers could look like {@link #perform:25} or {@link LinkedClass:25} to link to the 25th line of the perform-method or class. But I guess it would be simpler, to use the markdown-syntax for java-entities, something like Bla. Besides, I haven't found out so far how the syntax for java entity referencing looks like. If there is already a syntax for that, one could also extend this to support line numbers.

sebastianbenz commented 12 years ago

I like the idea of being able to directly reference other files, but I would favor using tags for referencing elements. For example:

@java(java.lang.String#toString) @java(java.lang.String:225) @file(File.txt) @file(../RelativeFile.txt:35)

So far there is no syntax for java entities, but the underlying xtext frameworks supports referencing java entities, which would simplify the integration.

sebastianbenz commented 12 years ago

Nobody hinders you to specify file locations in that way right now. The question is which features should the editor provide based on such links to files?

wiwie commented 11 years ago

Well, the feature I would like most is jumping to the corresponding code-line. For example, if I have a certain block of code that I want to improve later on, I would put that into my .todo file together with a short explanation and some tags and a link, such that I simply can click on the link in the todo-entry later and can start implementing immediately.