Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to java-file or specific codeline? #42

Open
derwiwie opened this issue Apr 19, 2012 · 5 comments
Open

Link to java-file or specific codeline? #42

derwiwie opened this issue Apr 19, 2012 · 5 comments

Comments

@derwiwie
Copy link

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Owner

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
Copy link

wiwie commented Nov 26, 2012

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants