Komodo / KomodoEdit

Komodo Edit is a fast and free multi-language code editor. Written in JS, Python, C++ and based on the Mozilla platform.
http://www.komodoide.com/komodo-edit
Other
2.15k stars 301 forks source link

Breadcrumbs are missing when opening remote file from OpenVMS #3177

Open abbeyj opened 7 years ago

abbeyj commented 7 years ago

Short Summary

The breadcrumbs bar is completely blank when editing a remote file that's being served from OpenVMS. This happens when using sftp, scp or ftp. I don't care particularly about having working breadcrumbs but when native window borders are disabled (the default), this is the only place in the UI that shows the full path to the file.

Steps to Reproduce

Expected results

The breadcrumbs bar should show the path just like it does for local files and remote files hosted on Linux. Or, if it fails in attempting to do that, at least display the full path as plain text so you know what file you are looking at.

Actual results

The breadcrumbs bar is completely blank.

Platform Information

Komodo Edit v11.0.0 (but this also happens on v10) Windows 7 SP1 x64

Additional Information

The following appears in pystderr.log:

[2017-09-28 12:30:49,206] [ERROR] console-logger: TypeError: this._getFile(...) is null (2) in chrome://breadcrumbs/content/sdk/breadcrumbs.js:1643
Traceback (most recent call last):
  File "chrome://breadcrumbs/content/sdk/breadcrumbs.js", line 1643, in 

(there is nothing after "in" in the original log file).

That doesn't seem like much to go on but perhaps there is a way to turn on more verbose logging? I see several debug logging statements in https://github.com/Komodo/KomodoEdit/blob/2ea55cdc25412caed3e960fb3c527d7208ad6fe8/src/modules/breadcrumbs/content/sdk/breadcrumbs.js and I'm not seeing any of those in the log file. I tried Googling for this but searches like "komodo debug logging" talk about using Komodo to debug your own programs. A search for "komodo environment variables" produces a broken link to http://docs.activestate.com/komodo/7.0/prefs.html and the cached version of that page isn't helpful. If there's a page with a list of supported environment variables anywhere, I can't find it.

babobski commented 7 years ago

@abbeyj I'm not familiar with OpenVMS, just googled it. But looks like a different OS?

If I look at the _getFile function it want's a local file:

https://github.com/Komodo/KomodoEdit/blob/2ea55cdc25412caed3e960fb3c527d7208ad6fe8/src/modules/breadcrumbs/content/sdk/breadcrumbs.js#L1414

This happens when using sftp, scp or ftp.

Did you somehow mounted the remotes as drives, in you're OS? Or do you connect to the remote directories trough Komodo?

abbeyj commented 7 years ago

@babobski, yes it is an OS.

This is not mounted through the OS. I'm using a command like ko sftp://openvms-server/path/to/file.txt to open it. Once opened, if I enable the native titlebar then it will display something like file.ext (sftp://openvms-server/path/to/file.ext) - Komodo Edit 11.0 so Komodo knows it is a remote file.

I believe you're looking at the wrong copy of _getFile. The one that I think you want is here: https://github.com/Komodo/KomodoEdit/blob/2ea55cdc25412caed3e960fb3c527d7208ad6fe8/src/modules/breadcrumbs/content/sdk/breadcrumbs.js#L1524

babobski commented 7 years ago

@abbeyj thanks for the quick response and the extra info!

I'm not that familiar with opening files that way, so I leave it up to the Komodo team. I think you might be right about the _getFile function, but I'm always a bit confused about the fact that the line number in you're error log does not match the line number in the file on Github.

You can detect if Komodo see's you're file as a remote by running the following snippet in you're console:

ko.views.manager.currentView.koDoc.file.isRemoteFile
abbeyj commented 7 years ago

The line number in my error message is 1643 and the actual call to this._getFile is on line 1644 in the above version of the file. I didn't consider this too important. I guess I'm used to line numbers being off by 1 due to slightly different versions of files, differences in line-endings, the confusion between the calling line and the line being returned to, etc.

The expression ko.views.manager.currentView.koDoc.file.isRemoteFile evaluates to Boolean true in the console.

Does anybody know how to enable the logging statements like the one at https://github.com/Komodo/KomodoEdit/blob/2ea55cdc25412caed3e960fb3c527d7208ad6fe8/src/modules/breadcrumbs/content/sdk/breadcrumbs.js#L1533 ? Or how to step through this code in a debugger?

babobski commented 7 years ago

@abbeyj can you enlighten me some more about OpenVms? You say that it's a OS but you're calling the file url with a remote protocol, this confuses me a bit. Do you have to make a remote call? or does a local call also works?

file://openvms-server/path/to/file.txt
Naatan commented 7 years ago

@abbeyj Please try running this from your Console (bottom pane) and then open a file that causes the problem:

ko.logging.getLogger('koBreadcrumbs').setLevel(10);

Once done please share your error log on this ticket: Help > Troubleshooting > View Error Log