martomo / SublimeTextXdebug

Xdebug debugger client for Sublime Text
MIT License
564 stars 89 forks source link

Current Line not marked / Gutter icons ignored / Step Into does not open file in new tab #185

Closed praet0ri4n closed 6 years ago

praet0ri4n commented 6 years ago

Hi,

I successfully managed to get xdebug sessions running and I can observe vars, do step over, ... But for some reason I can't see the current line being marked with the yellow "bookmark" icon. On some youtube intros from other users I can see it there.. A the same time I observed, that doing Step Into on a function does not open the file in a new tab as shown in some tuts. I tried to change those icons with my "settings - user" in sublime but with no effect. I tried the *.sublime-project file as well to be sure.

OS: Xubuntu 16.04 Server Ubuntu 16.04 PHP version 5.6 xdebug version 2.3.2, installed from source php.ini [xdebug] zend_extension = /usr/lib/php/20131226/xdebug.so xdebug.remote_enable=1 xdebug.remote_handler=dbgp xdebug.remote_host=10.0.2.2 xdebug.remote_port=9000 xdebug.remote_log="/var/log/xdebug/xdebug.log"

Sublime Text - versions I tried out: v2 Build 2221 v3 Build 3126 v3 Build 3143 v3 Build 3176

I am a bit confused about the comment lines inf Settings - Default // Do not use same icon for following values, because Sublime Text is unable // to use the same icon for different scopes, in case there are duplicate icons // detected it will fall back to the corresponding icon in the package. Do I need to set specific scopes to get the icons working?

I would appreciate having the current line marked and be able to do Step Into with opening the appropriate file automatically in another tab. Thank you very much for your effort! selection_034

martomo commented 6 years ago

@praet0ri4n Are you trying to debug the script remotely or locally? Can you also post the configuration of your Packages/User/Xdebug.sublime-settings.

Or any other additional information that would help as described in the ISSUE_TEMPLATE.md

praet0ri4n commented 6 years ago

Martomo, thank you for your reply!

after another reinstall of the latest sublimetext 3 I have no Packages/User/Xdebug.sublime-settings there

the only settings I do all the time are in the ***.sublime-project file and those are

{
    "folders":
    [
        {
            "path": "."
        }
    ],
    "settings": {
        "xdebug": {
             "url": "http://localhost/web/isos_api/",
             "path_mapping": {
                    "/var/www/html/web/isos_api/" : "/home/praetorian/WebFiles/isos_api/"
                },
             "max_depth":10
        }
    }
}

The dev server itself is a virtualbox appliance running on my notebook with NAT network interface and the port 80 NATed to my localhost, kind of vagrant setup, so I can't exactly tell if this is remote or local. The communication doesn't flow over the internet As for the network communication I have done tcpdump and the requests and responses flow correctly between interfaces. The debugging itself is working in sublime, I can start, step and stop it without problems...

praet0ri4n commented 6 years ago

And for detailed info, here is the servers xdebug.log, or the last lines.. xdebug.log

martomo commented 6 years ago

@praet0ri4n It looks like __/var/www/html/web/isos_api/ is a symbolic link which is pointing to /media/sf_WebFiles/isos_api/__ on your VM.

Usually when you are receiving data, but it's not properly opening files or showing the gutter icons, it's due misconfiguration of path_mapping setting.

Please use the absolute path, as instructed in the default settings file. https://github.com/martomo/SublimeTextXdebug/blob/1eb6e0f2348f38c16c0810891826643e470f640a/Xdebug.sublime-settings#L6-L7

By changing your *.sublime-project to use the following the plugin should work as expected.

"path_mapping": {
    "/media/sf_WebFiles/isos_api/": "/home/praetorian/WebFiles/isos_api/"
},
praet0ri4n commented 6 years ago

Oh yes Martomo, sorry.. This was it. Actually I understood, that path mapping is crucial... but I forgot that my dev server is using virtualbox shared folder, which is linked from /media/sf_WebFiles to /var/www/html... Thank you very much, it works now!

martomo commented 6 years ago

No problem, glad to hear you managed to get it working!