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

code intel - autocomplete: "KeyError: u'some_library.php'" #1351

Closed
orangeaid opened this Issue May 2, 2016 · 38 comments

Comments

Projects
None yet
4 participants
@orangeaid

orangeaid commented May 2, 2016

Short Summary

When typing a backslash ('') in the hope of getting autocomplete listing for a namespace, I get an error notification saying "KeyError: u" followed directly by the name of one of my library file names, enclosed in single quotes

Steps to Reproduce

I do not think that you could exactly reporoduce this precise error, without my entire code base - which includes daisy-chained included/required PHP libraries. E.g. lib1.php requires lib2.php, which requires lib3.php, etc. You may be able to reporoduce this kind of notification by including a number of scripts, in my daisy-chain manner, each with a number of different functions - and then type '' with a view to getting an auto-complete list of namespaces and globals

Expected results

You should see an autocomplete list of namespaces and globals

Actual results

You should see the brown notification pop up (assuming such are enabled - which they are, by default) at the bottom-right of the editing window - saying "KeyError: u'some_file.php'

Platform Information

Komodo IDE v9.3
Windows 7 Ultimate, Service Pack 1

Additional Information

error_notification

@mitchell-as

This comment has been minimized.

Member

mitchell-as commented May 2, 2016

Hi, when you see this again, would you please post the contents of your error log? (Help > Troubleshooting > View Error Log)

@orangeaid

This comment has been minimized.

orangeaid commented May 2, 2016

Here's the log (line #112 of __db.php was where I typed the ''):
KeyError: u'__shr_sessionhandler.php'
[2016-05-02 18:58:50,447] [ERROR] codeintel.tree: Unexpected error with evaluator: '' at __db.php#112
Traceback (most recent call last):
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree.py", line 281, in eval
cplns = self.eval_cplns()
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 211, in eval_cplns
cplns = self._namespaces_from_scope(self.expr, start_scope)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 540, in _namespaces_from_scope
self.namespace_names_from_elem)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 394, in _element_names_from_scope_starting_with_expr
elemlist = self._get_all_import_blobs_for_elem(global_blob)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 1581, in _get_all_import_blobs_for_elem
self._get_all_import_blobs_dict_for_elem(elem, imported_blobs)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 1569, in _get_all_import_blobs_dict_for_elem
self._get_all_import_blobs_dict_for_elem(import_blob, imported_blobs)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 1569, in _get_all_import_blobs_dict_for_elem
self._get_all_import_blobs_dict_for_elem(import_blob, imported_blobs)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 1564, in _get_all_import_blobs_dict_for_elem
import_blob = self._get_import_blob_with_module_name(module_name)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 1550, in _get_import_blob_with_module_name
self.ctlr)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\citadel.py", line 548, in import_blob_name
blob = lib.get_blob(import_name)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\database\multilanglib.py", line 95, in get_blob
blobname, ctlr=ctlr, specific_dir=specific_dir)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\database\multilanglib.py", line 315, in _dbsubpath_from_blobname
buf.scan_if_necessary()
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\citadel.py", line 355, in scan_if_necessary
self.blob_from_lang
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\citadel.py", line 198, in blob_from_lang
self._load_buf_data_once()
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\citadel.py", line 139, in _load_buf_data_once
self._blob_from_lang_cache = self.mgr.db.get_buf_data(self)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\database\database.py", line 1032, in get_buf_data
return self._get_lang_zone(buf.lang).get_buf_data(buf)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\database\multilanglib.py", line 644, in get_buf_data
dbsubpath = join(dhash, blob_index[lang][blobname])

@orangeaid

This comment has been minimized.

orangeaid commented May 2, 2016

Actually, I get the same error for cote intel for built-in PHP functions, when I type the function name followed by open bracket ( e.g. "is_null(" )

@orangeaid

This comment has been minimized.

orangeaid commented May 2, 2016

code intel, not "cote intel"!

@mitchell-as

This comment has been minimized.

Member

mitchell-as commented May 2, 2016

It appears codeintel is looking for a file that is not in the database. Please try resetting the codeintel database (Help > Troubleshooting > Reset Codeintel Database) and see if you get the same error. You may have to wait a bit while codeintel rescans your project.

@orangeaid

This comment has been minimized.

orangeaid commented May 3, 2016

Well, I regularly recreate the codeintel database, becuase of such problems. But I have been doing this usig my own batch script which simply deletes the codeintel DB files (after making a backup copy), and restarting Komodo. This usually sorts out such issues, but on this occasion it did not. I will try using the Help > Troubleshooting menu item instead - and let you know if this solves the issue.

It is regrettable that I have to reset the codeintel DB so often. My project is quite a large one - a social networking site with about 230 PHP files. However I am using a PC with ample resources (24GB RAM, 8 core AMD proccessor, a 256GB fast SSD system partition drive plus 4 HDDs totalling 2.5 TB), so storing and retrieving codeintel data should not be a problem!

Thanks
Simon

@Defman21

This comment has been minimized.

Contributor

Defman21 commented May 3, 2016

CodeIntel uses only 1GB of RAM, so I don't think that 24GB RAM makes a lot of sense for it.

@orangeaid

This comment has been minimized.

orangeaid commented May 3, 2016

So, I used the Help > Troubleshooting > Reset Codeintel Database menu, and once Komod had restarted, AND I could see that the condeintel generation/loading had COMPLETED, I tried typing '' on line #176 of __db.php. I got the same erro notification, and when I checked the logs, this is what was recorded:

[2016-05-03 16:56:10,713] [INFO] Startup: Welcome to Komodo IDE 9.3.2 build 88191 (platform win32-x86, running on Windows 7 version 6.1.7601)
[2016-05-03 16:56:10,713] [INFO] Startup: C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\komodo.exe built on Thu Dec 10 11:38:17 2015
[2016-05-03 16:56:11,822] [WARNING] console-logger: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create (1) in resource://gre/modules/Preferences.jsm:381
[2016-05-03 16:56:11,882] [WARNING] root: ko.logging has been converted to a CommonJS module; use require("ko/logging") instead (since Komodo 9.0.0a1).
@chrome://komodo/content/komodo.js:15:1

[2016-05-03 16:56:12,542] [ERROR] console-logger: bad script XDR magic number (0) in :0
Traceback (most recent call last):
File "", line 0, in

[2016-05-03 16:56:12,673] [WARNING] keybindings: [Ctrl+0] was used for 'cmd_goToQuickBookmark_0', overriding to use 'cmd_fontZoomReset'
[2016-05-03 16:56:16,594] [WARNING] console-logger: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create (1) in file:///C:/Program%20Files%20(x86)/ActiveState%20Komodo%20IDE%209/lib/mozilla/components/koamAddonManager.js:138
[2016-05-03 16:56:16,983] [INFO] komodospellchecker: Spell checker loaded.
[2016-05-03 16:56:16,983] [INFO] komodospellchecker: Using dictionary en-US
[2016-05-03 16:56:17,033] [INFO] elastic_tabstops: Elastic tabstops loaded.
[2016-05-03 16:57:03,079] [WARNING] views: Inconsistent view count in view_closed event
[2016-05-03 16:57:03,329] [WARNING] views: Inconsistent view count in view_opened event
[2016-05-03 16:58:19,908] [WARNING] console-logger: Key event not available on GTK2: key="u" modifiers="control,shift" (1) in chrome://komodo/content/komodo.xul:0
[2016-05-03 16:58:19,989] [WARNING] console-logger: Key event not available on some keyboard layouts: key="v" modifiers="control,alt" (1) in chrome://komodo/content/komodo.xul:0
[2016-05-03 16:58:36,579] [WARNING] codeintel.css: Unable to process CSS selector 'font-family:'Courier New''
[2016-05-03 16:58:36,829] [WARNING] codeintel.css: Unable to process CSS selector 'font-family:'Helvetica Neue''
[2016-05-03 16:58:36,869] [WARNING] codeintel.css: Unable to process CSS selector 'font-family:'Helvetica Neue''
[2016-05-03 16:58:39,660] [ERROR] codeintel.tree: Unexpected error with evaluator: '' at __db.php#176
Traceback (most recent call last):
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree.py", line 281, in eval
cplns = self.eval_cplns()
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 211, in eval_cplns
cplns = self._namespaces_from_scope(self.expr, start_scope)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 540, in _namespaces_from_scope
self.namespace_names_from_elem)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 394, in _element_names_from_scope_starting_with_expr
elemlist = self._get_all_import_blobs_for_elem(global_blob)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 1581, in _get_all_import_blobs_for_elem
self._get_all_import_blobs_dict_for_elem(elem, imported_blobs)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 1569, in _get_all_import_blobs_dict_for_elem
self._get_all_import_blobs_dict_for_elem(import_blob, imported_blobs)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 1569, in _get_all_import_blobs_dict_for_elem
self._get_all_import_blobs_dict_for_elem(import_blob, imported_blobs)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 1564, in _get_all_import_blobs_dict_for_elem
import_blob = self._get_import_blob_with_module_name(module_name)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 1550, in _get_import_blob_with_module_name
self.ctlr)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\citadel.py", line 548, in import_blob_name
blob = lib.get_blob(import_name)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\database\multilanglib.py", line 95, in get_blob
blobname, ctlr=ctlr, specific_dir=specific_dir)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\database\multilanglib.py", line 315, in _dbsubpath_from_blobname
buf.scan_if_necessary()
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\citadel.py", line 355, in scan_if_necessary
self.blob_from_lang
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\citadel.py", line 198, in blob_from_lang
self._load_buf_data_once()
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\citadel.py", line 139, in _load_buf_data_once
self._blob_from_lang_cache = self.mgr.db.get_buf_data(self)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\database\database.py", line 1032, in get_buf_data
return self._get_lang_zone(buf.lang).get_buf_data(buf)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\database\multilanglib.py", line 644, in get_buf_data
dbsubpath = join(dhash, blob_index[lang][blobname])
KeyError: u'__shr_sessionhandler.php'
[2016-05-03 17:01:14,421] [WARNING] console-logger: Key event not available on GTK2: key="u" modifiers="control,shift" (1) in chrome://komodo/content/tail/tail.xul:0
[2016-05-03 17:01:14,421] [WARNING] console-logger: Key event not available on some keyboard layouts: key="v" modifiers="control,alt" (1) in chrome://komodo/content/tail/tail.xul:0

@orangeaid

This comment has been minimized.

orangeaid commented May 3, 2016

Yes - thanks "Defman" for your comment about RAM requirements. I was talking about the TOTAL RAM available on my machine - and not that allocated to Komod's codeintel. My machine has 24GB RAM available for purposes other than Komodo codeintel (graphics and video processing). I was simply saying that I have ample resources.

@Defman21

This comment has been minimized.

Contributor

Defman21 commented May 3, 2016

Well you have a pretty strong machine 👍

@orangeaid

This comment has been minimized.

orangeaid commented May 3, 2016

Tried another codeintel reset. Same error again. Here's the log:

[2016-05-03 17:10:20,101] [INFO] Startup: Welcome to Komodo IDE 9.3.2 build 88191 (platform win32-x86, running on Windows 7 version 6.1.7601)
[2016-05-03 17:10:20,101] [INFO] Startup: C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\komodo.exe built on Thu Dec 10 11:38:17 2015
[2016-05-03 17:10:21,131] [WARNING] console-logger: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create (1) in resource://gre/modules/Preferences.jsm:381
[2016-05-03 17:10:21,180] [WARNING] root: ko.logging has been converted to a CommonJS module; use require("ko/logging") instead (since Komodo 9.0.0a1).
@chrome://komodo/content/komodo.js:15:1

[2016-05-03 17:10:21,811] [ERROR] console-logger: bad script XDR magic number (0) in :0
Traceback (most recent call last):
File "", line 0, in

[2016-05-03 17:10:21,960] [WARNING] keybindings: [Ctrl+0] was used for 'cmd_goToQuickBookmark_0', overriding to use 'cmd_fontZoomReset'
[2016-05-03 17:10:25,821] [WARNING] console-logger: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create (1) in file:///C:/Program%20Files%20(x86)/ActiveState%20Komodo%20IDE%209/lib/mozilla/components/koamAddonManager.js:138
[2016-05-03 17:10:26,200] [INFO] komodospellchecker: Spell checker loaded.
[2016-05-03 17:10:26,200] [INFO] komodospellchecker: Using dictionary en-US
[2016-05-03 17:10:26,250] [INFO] elastic_tabstops: Elastic tabstops loaded.
[2016-05-03 17:18:25,785] [WARNING] views: Inconsistent view count in view_closed event
[2016-05-03 17:18:26,005] [WARNING] views: Inconsistent view count in view_opened event
[2016-05-03 17:18:58,661] [WARNING] console-logger: Key event not available on GTK2: key="u" modifiers="control,shift" (1) in chrome://komodo/content/komodo.xul:0
[2016-05-03 17:18:58,661] [WARNING] console-logger: Key event not available on some keyboard layouts: key="v" modifiers="control,alt" (1) in chrome://komodo/content/komodo.xul:0
[2016-05-03 17:19:12,862] [WARNING] codeintel.css: Unable to process CSS selector 'font-family:'Courier New''
[2016-05-03 17:19:13,102] [WARNING] codeintel.css: Unable to process CSS selector 'font-family:'Helvetica Neue''
[2016-05-03 17:19:13,132] [WARNING] codeintel.css: Unable to process CSS selector 'font-family:'Helvetica Neue''
[2016-05-03 17:19:14,862] [ERROR] codeintel.tree: Unexpected error with evaluator: '' at __db.php#176
Traceback (most recent call last):
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree.py", line 281, in eval
cplns = self.eval_cplns()
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 211, in eval_cplns
cplns = self._namespaces_from_scope(self.expr, start_scope)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 540, in _namespaces_from_scope
self.namespace_names_from_elem)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 394, in _element_names_from_scope_starting_with_expr
elemlist = self._get_all_import_blobs_for_elem(global_blob)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 1581, in _get_all_import_blobs_for_elem
self._get_all_import_blobs_dict_for_elem(elem, imported_blobs)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 1569, in _get_all_import_blobs_dict_for_elem
self._get_all_import_blobs_dict_for_elem(import_blob, imported_blobs)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 1569, in _get_all_import_blobs_dict_for_elem
self._get_all_import_blobs_dict_for_elem(import_blob, imported_blobs)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 1564, in _get_all_import_blobs_dict_for_elem
import_blob = self._get_import_blob_with_module_name(module_name)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 1550, in _get_import_blob_with_module_name
self.ctlr)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\citadel.py", line 548, in import_blob_name
blob = lib.get_blob(import_name)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\database\multilanglib.py", line 95, in get_blob
blobname, ctlr=ctlr, specific_dir=specific_dir)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\database\multilanglib.py", line 315, in _dbsubpath_from_blobname
buf.scan_if_necessary()
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\citadel.py", line 355, in scan_if_necessary
self.blob_from_lang
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\citadel.py", line 198, in blob_from_lang
self._load_buf_data_once()
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\citadel.py", line 139, in _load_buf_data_once
self._blob_from_lang_cache = self.mgr.db.get_buf_data(self)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\database\database.py", line 1032, in get_buf_data
return self._get_lang_zone(buf.lang).get_buf_data(buf)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\database\multilanglib.py", line 644, in get_buf_data
dbsubpath = join(dhash, blob_index[lang][blobname])
KeyError: u'__shr_sessionhandler.php'

@orangeaid

This comment has been minimized.

orangeaid commented May 3, 2016

It's a real shame because ActiveState's code-intelligence is one of the main reasons I choose to develop in Komodo. I am considering upgrading to the "With Updates and Support" version of IDE, but code-intel autocomplete functionality is critical in this decision. When codeintel works, I don't have to remember all my function/class names, or function parameters, and this speed up my development no end. Without it, life is a lot slower!

@Naatan

This comment has been minimized.

Member

Naatan commented May 3, 2016

Could you provide a test case on which we can reproduce this issue @orangeaid ?

@mitchell-as

This comment has been minimized.

Member

mitchell-as commented May 3, 2016

No need for a test case @orangeaid . With your backtraces I can "fix" it such that the error will no longer be raised. That should give you completions again.

@mitchell-as mitchell-as added this to the 10.1 milestone May 3, 2016

@mitchell-as mitchell-as self-assigned this May 3, 2016

@orangeaid

This comment has been minimized.

orangeaid commented May 3, 2016

That's good - as I would not know how to provide a test case without sending you my whole Komodo project - which I could not do because of a non-disclosure agreement with my customer that I signed! Even if I could, it would be a lot of data to upload.

So it looks like this bug-fix is ear-marked for v10.1 ? When is v10 expected to be released?

Also, would I be able to get my completions back if I disabled all or some of the notifications?

Thanks
Simon

@mitchell-as

This comment has been minimized.

Member

mitchell-as commented May 3, 2016

I'll try and get it into v10 instead of v10.1 just for you. Unfortunately there is nothing you can do to get your completions back at this time :(

@Naatan

This comment has been minimized.

Member

Naatan commented May 3, 2016

@orangeaid in Komodo 10 these notifications will not interfere with your autocompletions. So while the error will still happen in 10.0, your completions will not break.

@orangeaid

This comment has been minimized.

orangeaid commented May 3, 2016

OK, thanks for the heads-up. Much appreciated.

When are you hoping to relese v10?

@Naatan

This comment has been minimized.

Member

Naatan commented May 3, 2016

Expect it in the next couple of weeks. You can already download the pre-release from our website:

http://komodoide.com/blog/komodo-10-alpha-pre-release-now-available/

@mitchell-as

This comment has been minimized.

Member

mitchell-as commented May 3, 2016

@orangeaid If you don't mind, would you temporarily remove any "import" statements in the PHP file that is exhibiting these problems and then try to trigger autocompletion again? (I say "import" because I don't know the equivalent. Whatever statements import or use namespaces from other PHP files/classes/etc.) I'm curious if one of your imports hasn't been scanned by codeintel and that is why an error is being thrown. If autocompletion ends up working (or at least you are not seeing the same error), then please ensure all of your source files are being scanned by codeintel: Edit > Preferences > Languages > PHP > PHP Directories.

@orangeaid

This comment has been minimized.

orangeaid commented May 4, 2016

There are NOT any "import" statements in this PHP file (I just did a search. In fact, I don't think there are any import statements in the entire project). There are only three "require_once()" function calls. Do you want me to temporarily remove these?

I am not sure whether or not the Komodo codeintel makes use of "include"/"require" statements to ensure that functions, etc. from included libraries get listed in autocomplete lists? If so, the removing the require_once statements would prevent listing of any functions from included files.

@orangeaid

This comment has been minimized.

orangeaid commented May 4, 2016

Oh sorry! I just saw that you do mean the PHP equivalent to "import". I will try this, and get back to you. However, I think that ALL included/required files reside in the same directory.

@orangeaid

This comment has been minimized.

orangeaid commented May 4, 2016

OK - I just tested that, and it DID, infact, cause my autocomplete to work :-)

I will have to check my current PHP directories, and whether or not any are missing. Thank you for pointing ou this possibility. Much appreciated

@orangeaid

This comment has been minimized.

orangeaid commented May 4, 2016

OK - so I checked my PHP directories, and there weren't any! However, all but one location was included in the Project location. I don't think that I needed to add the project location to the Komodo PHP directories - but I did it anyway. I also added the only location which is outside of the project directory to the PHP directories for Komodo. Unfortunately I still got the same error. Here is the log:

[2016-05-04 13:48:55,223] [INFO] Startup: Welcome to Komodo IDE 9.3.2 build 88191 (platform win32-x86, running on Windows 7 version 6.1.7601)
[2016-05-04 13:48:55,223] [INFO] Startup: C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\komodo.exe built on Thu Dec 10 11:38:17 2015
[2016-05-04 13:48:56,292] [WARNING] console-logger: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create (1) in resource://gre/modules/Preferences.jsm:381
[2016-05-04 13:48:56,342] [WARNING] root: ko.logging has been converted to a CommonJS module; use require("ko/logging") instead (since Komodo 9.0.0a1).
@chrome://komodo/content/komodo.js:15:1

[2016-05-04 13:48:56,983] [ERROR] console-logger: bad script XDR magic number (0) in :0
Traceback (most recent call last):
File "", line 0, in

[2016-05-04 13:48:57,092] [WARNING] keybindings: [Ctrl+0] was used for 'cmd_goToQuickBookmark_0', overriding to use 'cmd_fontZoomReset'
[2016-05-04 13:49:00,744] [WARNING] console-logger: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create (1) in file:///C:/Program%20Files%20(x86)/ActiveState%20Komodo%20IDE%209/lib/mozilla/components/koamAddonManager.js:138
[2016-05-04 13:49:01,575] [INFO] komodospellchecker: Spell checker loaded.
[2016-05-04 13:49:01,575] [INFO] komodospellchecker: Using dictionary en-US
[2016-05-04 13:49:01,634] [INFO] elastic_tabstops: Elastic tabstops loaded.
[2016-05-04 13:49:22,997] [WARNING] views: Inconsistent view count in view_closed event
[2016-05-04 13:49:23,237] [WARNING] views: Inconsistent view count in view_opened event
[2016-05-04 13:56:05,706] [WARNING] console-logger: Key event not available on GTK2: key="u" modifiers="control,shift" (1) in chrome://komodo/content/komodo.xul:0
[2016-05-04 13:56:05,786] [WARNING] console-logger: Key event not available on some keyboard layouts: key="v" modifiers="control,alt" (1) in chrome://komodo/content/komodo.xul:0
[2016-05-04 13:56:18,378] [WARNING] codeintel.css: Unable to process CSS selector 'font-family:'Courier New''
[2016-05-04 13:56:18,631] [WARNING] codeintel.css: Unable to process CSS selector 'font-family:'Helvetica Neue''
[2016-05-04 13:56:18,664] [WARNING] codeintel.css: Unable to process CSS selector 'font-family:'Helvetica Neue''
[2016-05-04 13:56:23,357] [ERROR] codeintel.tree: Unexpected error with evaluator: '' at __db.php#176
Traceback (most recent call last):
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree.py", line 281, in eval
cplns = self.eval_cplns()
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 211, in eval_cplns
cplns = self._namespaces_from_scope(self.expr, start_scope)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 540, in _namespaces_from_scope
self.namespace_names_from_elem)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 394, in _element_names_from_scope_starting_with_expr
elemlist = self._get_all_import_blobs_for_elem(global_blob)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 1581, in _get_all_import_blobs_for_elem
self._get_all_import_blobs_dict_for_elem(elem, imported_blobs)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 1569, in _get_all_import_blobs_dict_for_elem
self._get_all_import_blobs_dict_for_elem(import_blob, imported_blobs)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 1569, in _get_all_import_blobs_dict_for_elem
self._get_all_import_blobs_dict_for_elem(import_blob, imported_blobs)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 1564, in _get_all_import_blobs_dict_for_elem
import_blob = self._get_import_blob_with_module_name(module_name)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\tree_php.py", line 1550, in _get_import_blob_with_module_name
self.ctlr)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\citadel.py", line 548, in import_blob_name
blob = lib.get_blob(import_name)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\database\multilanglib.py", line 95, in get_blob
blobname, ctlr=ctlr, specific_dir=specific_dir)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\database\multilanglib.py", line 315, in _dbsubpath_from_blobname
buf.scan_if_necessary()
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\citadel.py", line 355, in scan_if_necessary
self.blob_from_lang
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\citadel.py", line 198, in blob_from_lang
self._load_buf_data_once()
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\citadel.py", line 139, in _load_buf_data_once
self._blob_from_lang_cache = self.mgr.db.get_buf_data(self)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\database\database.py", line 1032, in get_buf_data
return self._get_lang_zone(buf.lang).get_buf_data(buf)
File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\codeintel2\database\multilanglib.py", line 644, in get_buf_data
dbsubpath = join(dhash, blob_index[lang][blobname])
KeyError: u'__shr_sessionhandler.php'

@mitchell-as

This comment has been minimized.

Member

mitchell-as commented May 4, 2016

I believe I've managed to fix the effect of the error (there being no completions at all), but the source is still eluding me. @orangeaid: is your code more than 10 levels deep? Codeintel stops at 10 levels deep. It's possible some files are being omitted. You can change this from Edit > Preferences > Code Intelligence > Code Scanning > Maximum directory depth.

@orangeaid

This comment has been minimized.

orangeaid commented May 5, 2016

The directory levels are not anywhere near 10 levels deep. A maximum of 3 levels.

Yesterday, I managed to get the autocompletes working - just temporarily. This was not deliberate. I had been making changes to the __shr_sessionhandler.php. After saving these changes, I went to the __db.php file, and autocompleteions were working! However, today - after closing down and restarting Komodo - I am getting the same error again :-(

So, my project is in a folder "www" and the maximum directory depth of PHP scripts is just one below this - e.g. www/db. There are some javascript directories at lower depths - e.g. www/js/tp/MsgPoint (this is the lowest depth - 4). I am using a couple of 3rd party scripts - but I now have the container directory of these included in the Komodo PHP directories list. The Komodo PHP dir is "shared", and the maximum depth directory is shared\swiftmailer\lib\classes\Swift (depth of 5).

It is curious that editing the __shr_sessionhandler.php file temporarily restored my autocompletes. Also, the actual name of that file is __shr_SessionHandler.php (not the camel-caps after the third underscore) - whereas Komodo's log is reporting it as __shr_sessionhandler.php. Perhaps this is insignificant, as whilst Windows supports multi-case names, I don't think that the case is used in identifying a file (you could not have two files: __shr_SessionHandler.php and __shr_sessionhandler.php, in the same directory - as there would be a naming conflict). I might try renaming the file, to see if this makes any difference.

@orangeaid

This comment has been minimized.

orangeaid commented May 5, 2016

Interesting! Renaming the __shr_SessionHandler.php to __shr_sessionhandler.php, and then rebuilding my codeintel, DID get my autocomplete back!

I wonder if this will only last a single session - like when I edited that file. I will try restarting Komodo

@orangeaid

This comment has been minimized.

orangeaid commented May 5, 2016

Even after restarting Komodo, I still have my autocompletes :-). However, there is a noticable delay the first time I type ''. It takes like 6 seconds for the list to get displayed, and I can see tiny flashes at the bottom right of the code window - where the codeintel rebuild progress indicator is. It's like it's having to rebuild the codeintel each time I restart Komodo.

It will be interesting to see if I still have my codeintel after shutting down my PC.

@orangeaid

This comment has been minimized.

orangeaid commented May 5, 2016

Another possible point of interest is that I am using Git for version control. I know that Komodo is Git aware, because I can see the tick and pencil icons. However, I wonder how the codeintel system copes with switching to different branches/versions of the code base. I guess it would have to rebuild the codeintel every time a different branch is checked out?

@orangeaid

This comment has been minimized.

orangeaid commented May 5, 2016

Interesting: When I checked out a different branch, which did NOT have the PHP file new name:

  • The file name did not revert
  • The codeintel still works

It seems that both Git and the codeintel are not case sensitive regarding file names. Therefore, I wonder why changing the case of two characters in the file name caused the autocomplete to start working!

@orangeaid

This comment has been minimized.

orangeaid commented May 5, 2016

Anyway, unless my codeintel stops working, I will stop posting to this topic - as you have it marked as fixed and closed.

Many thanks for your time on this
Simon

@Naatan

This comment has been minimized.

Member

Naatan commented May 5, 2016

Sounds like perhaps there is a bug in the logic somewhere where it IS case sensitive even though everywhere else it isn't.

Nice digging @orangeaid! Thanks for reporting! :)

Though this technically isn't a blocker bug I still want to commend you for bringing this to our attention and going through so much effort to find out what the cause is. Having this bug resolved could have large positive consequences as I can imagine it affecting many. As such I'd like to offer you one of the $50 gift cards from our contest here: http://komodoide.com/blog/help-us-test-komodo-ide-10-and-well-give-you-usd50/

Please email me at nathanractivestate.com and let me know what gift card you would like :)

@mitchell-as

This comment has been minimized.

Member

mitchell-as commented May 5, 2016

This may be related to #870 and #970 with case-insensitive paths on Windows. Thanks for all of the info!

@orangeaid

This comment has been minimized.

orangeaid commented May 5, 2016

Wow! Great - thank you very much :-)

I look forward to upgrading to the with upgrades & support version when v10 is released. Is there somewhere I can put my email on a mailing list for the release of v10 ?

Your email is nathanr{AT}activestate.com ?

@Naatan

This comment has been minimized.

Member

Naatan commented May 5, 2016

There is a newsletter sign up form when you download Komodo (just click download and cancel the file download): http://komodoide.com/download/

That's correct on the email :)

@orangeaid

This comment has been minimized.

orangeaid commented May 5, 2016

Thanks.

I checked the link for the "Help Us Test and ...", and I couldn't see any descriptions/options for gift cards. My choice would be anything that can go towards buying my next Komodo IDE licence (with upgrades and support). I will send you an email.

Thanks
Simon

@Naatan

This comment has been minimized.

Member

Naatan commented May 5, 2016

Shoot me an email and we'll see what we can do :)

@orangeaid

This comment has been minimized.

orangeaid commented May 5, 2016

Sent - thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment