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

Map server path to client path #23

Closed
jancbeck opened this issue Apr 1, 2018 · 5 comments
Closed

Map server path to client path #23

jancbeck opened this issue Apr 1, 2018 · 5 comments

Comments

@jancbeck
Copy link

jancbeck commented Apr 1, 2018

I'm running a development server within a Vagrant VM.
Clicking the blow link will take me to a directory that does not exist on my local client, but within the VM.

[31-Mar-2018 19:09:41 UTC] PHP Notice: Undefined property: stdClass::$plugin in /srv/www/example/htdocs/wp-includes/class-wp-list-util.php on line 150

It would be great to be able to map these remote paths to my local dev directory.

"path_mapping": {
       "/srv/www/example" : "/Users/jan/vvv/www/example"
}
@jancbeck
Copy link
Author

jancbeck commented May 9, 2018

I just noticed that the default package shows a definitions when you hover over the paths in the log:

screen shot 2018-05-09 at 11 22 12

https://www.sublimetext.com/blog/articles/sublime-text-3-build-3124

Clicking these links takes me to the correct file and line. It would still be great if I could just single click on the file path in Log Highlight, but this is close enough!

@jancbeck
Copy link
Author

Ok, turned out that popup doesn't match the files the way I want it. It will look at the content of the current project and try to guess which file I'd want based on its contents rather than take the literal file referenced in the log file.

This ended up bugging me enough that I wrote a short gulp task for it that watches a given log file and replaces the server path with my local path.

Gist here

@robrecord
Copy link

robrecord commented May 15, 2018

As a temporary workaround, I created /srv in my root, and a symlink www inside it that points to my ~/Sites dir. Inside the site directory (eg 'cea' or 'mywebsite.com') I created another symlink to go to the correct folder - it looks like you might not need this, but mine was current -> site.

This allowed me to open the files referenced by the log.

However, I would really like the feature originally described by @jancbeck - thank you @poucotm

@jancbeck
Copy link
Author

jancbeck commented Jun 13, 2018

I'm currently also working with the workaround that @robrecord describes. The downside of this is that Sublime treats the files under my /srv symlink as different from than the ones in my project. That's OK most of the time if I just want to quickly jump into a class or function referenced by the log and see what is going on there, but of course it would be much better if this would not open a new file tab.

@poucotm
Copy link
Owner

poucotm commented Aug 26, 2020

@jancbeck , Currently, it looks impossible to change a path mapping, because the package uses result_file_regex . It is just one of view settings. The way is to change the mechanism calling a link file instead of result_file_regex.

@poucotm poucotm closed this as completed Jul 28, 2024
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