diff --git a/docs/help/clickable-stack-traces-and-function-names.md b/docs/help/clickable-stack-traces-and-function-names.md index c18e4262..fdfd5021 100644 --- a/docs/help/clickable-stack-traces-and-function-names.md +++ b/docs/help/clickable-stack-traces-and-function-names.md @@ -23,11 +23,15 @@ If you're debugging a remote site or using Docker or a virtual machine, you'll n Here are examples for various local development environments: -### Altis +### Altis local server No need to do anything, the path mapping is handled automatically. -### WordPress core +### WordPress core development environment + +No need to do anything, the path mapping is handled automatically. + +### WordPress VIP on Lando No need to do anything, the path mapping is handled automatically. diff --git a/output/Html.php b/output/Html.php index aaa5a039..be1bb5f8 100644 --- a/output/Html.php +++ b/output/Html.php @@ -605,11 +605,22 @@ public static function get_file_link_format() { public static function get_file_path_map() { $map = array(); + // WordPress core and Altis: $host_path = getenv( 'HOST_PATH' ); if ( ! empty( $host_path ) ) { - $source = rtrim( ABSPATH, DIRECTORY_SEPARATOR ); - $replacement = rtrim( $host_path, DIRECTORY_SEPARATOR ); + $source = ABSPATH; + $replacement = trailingslashit( $host_path ); + $map[ $source ] = $replacement; + } + + // WordPress VIP on Lando: + $lando_path = getenv( 'VIP_DEV_AUTOLOGIN_KEY' ) ? getenv( 'LANDO_APP_ROOT_BIND' ) : null; + + if ( ! empty( $lando_path ) ) { + // https://github.com/Automattic/vip-cli/blob/2bf64a46b9d409a5683459d032d65c16a6eeac48/assets/dev-env.lando.template.yml.ejs#L288 + $source = ABSPATH; + $replacement = trailingslashit( $lando_path ) . 'wordpress/'; $map[ $source ] = $replacement; }