eranif / codelite

A multi purpose IDE specialized in C/C++/Rust/Python/PHP and Node.js. Written in C++
https://codelite.org
GNU General Public License v2.0
2.08k stars 444 forks source link

Register a URL handler for codelite:// #3387

Closed AJenbo closed 1 month ago

AJenbo commented 1 month ago

Rational: Lots of web development debugging tools support debugging links that opens a file in the editor at a given line. This is often seen in relation to stack traces or other fault detection tools.

Examples of usage:

This is based on https://github.com/sanduhrs/phpstorm-url-handler

UffeJakobsen commented 1 month ago

Shouldn't this feature have some kind of (external) documentation for its syntax etc ? If not is will end up as hidden secret not known to anybody

AJenbo commented 1 month ago

@UffeJakobsen Hm that is fair enough. I'm not sure where it should be documented though.

There is the documentation in the bash script:

# codelite://open?url=file://@file&line=@line
# codelite://open?file=@file&line=@line
# codelite://open?url=file://@file:@line
# codelite://open?file=@file:line

A concrete example:

codelite://open?file=%2Fhome%2Fajenbo%2Fcode%2Fproject%2Fapp%2FHttp%2FRequests%2FRequest.php&line=15

It mirrors the format used by PHPStorm

UffeJakobsen commented 4 weeks ago

@UffeJakobsen Hm that is fair enough. I'm not sure where it should be documented though.

The current online documentation has one section that is (somewhat) similar (it relates to desktop integration)

https://docs.codelite.org/misc/tips_and_tricks/#mimetypes-linux-specific

In the repo: https://github.com/eranif/codelite/blob/master/docs/docs/misc/tips_and_tricks.md#mimetypes-linux-specific

AJenbo commented 4 weeks ago

Hopefully someone who knows how to associate protocols on Mac and Windows will implement it there as well :)