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

Open file/line in an IDE #10

Closed
pmartin opened this issue Nov 24, 2011 · 1 comment
Closed

Open file/line in an IDE #10

pmartin opened this issue Nov 24, 2011 · 1 comment
Labels

Comments

@pmartin
Copy link

pmartin commented Nov 24, 2011

(I am not the one doing the review, but the one who is trying to fix what's been written as comments during the review)

When I am on the "diff" screen, and have a comment on a file+line, I generally want to open that file in my IDE, on the line where the comment is, to fix it.

It would be really useful if each line in crew had a link formatted so clicking on it would trigger the opening of the right file, at the right line, in the IDE.


In crew, you'd have to: - Generate a link with a specific protocol, like `phpide://` - Include the file path and line

For example, a link could look like this : phpide:///path/to/my/project/web/my-file.php@65

Then, it's only a matter of (on the developper's computer, not in crew):

  • Configuring the browser so the phpide:// protocol is associated with a specific script
  • Creating that script so it launches the IDE, passing it the file name and line

Couple of points:

  • In crew, you don't know the full path to the file on the dev's computer ; just use a local one, and let the script on the developper's computer transform it to an absolute one
  • Passing the branch's name in the URI might be usefull to (the script could then use it to determine the absolute path)

Note: this is definitely possible -- see the `xdebug.file_link_format` option for Xdebug on http://xdebug.org/docs/stack_trace , for instance.
@tentacode
Copy link

As each project path on each dev computer is potentially different you have to configure it on a per project basis.

It could be somewhere in the (non existing yet) user panel.

pmartin pushed a commit to pmartin/Crew that referenced this issue May 30, 2012
Line numbers in the left margin are now
hyperlinks to

    phpide://_PROJECTROOT_/file@linenum

With 'file' being the real path to the file
in the project, and linenum being the line number.

This will allow users to click on a line number and
have the corresponding file opened on the rigth line
in the IDE.
All they have to do is to configure their browser to
open phpide:// links with a specific script, that will
extract file + line, and run their IDE, passing it
those parameters as it expects.

Note : the project's root is different on each developer's
computer -- and, so, it's their local script that has to
replace '_PROJECTROOT_' by the right actual project root.

This should, more or less, fix issue crew-cr#10
@ratibus ratibus closed this as completed May 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants