Komodo IDE 12 Perl autocomplete

I am trying to contribute to the Koha project, but I have issues with Komodo IDE 12 autocomplete.

Autocomplete occasionally works when importing some modules via “use”, but often does not, and when attempting to use those modules later in the code it does not work at all.

Log file keeps getting spammed by these errors

[2020-03-31 13:36:47,625] [ERROR] codeintel/service/mediator/codeintel: Request failed with message: Failed calling API method: getCompletions, message: ‘_Import’ object has no attribute ‘enclosingScope’ (-32603)
[2020-03-31 13:36:47,810] [ERROR] codeintel/service/mediator/codeintel: Request failed with message: Failed calling API method: getCompletions, message: ‘_Import’ object has no attribute ‘enclosingScope’ (-32603)
[2020-03-31 13:36:49,321] [ERROR] codeintel/service/mediator/codeintel: Request failed with message: Failed calling API method: getCompletions, message: ‘_Import’ object has no attribute ‘enclosingScope’ (-32603)
[2020-03-31 13:36:50,754] [ERROR] codeintel/service/mediator/codeintel: Request failed with message: Failed calling API method: getCompletions, message: ‘_Import’ object has no attribute ‘enclosingScope’ (-32603)
[2020-03-31 13:36:52,461] [ERROR] codeintel/service/mediator/codeintel: Request failed with message: Failed calling API method: getCompletions, message: ‘_Import’ object has no attribute ‘enclosingScope’ (-32603)
[2020-03-31 13:36:58,444] [ERROR] codeintel/service/mediator/codeintel: Request failed with message: Failed calling API method: getCompletions, message: ‘_Import’ object has no attribute ‘enclosingScope’ (-32603)
[2020-03-31 13:36:59,262] [ERROR] codeintel/service/mediator/codeintel: Request failed with message: Failed calling API method: getCompletions, message: ‘_Import’ object has no attribute ‘enclosingScope’ (-32603)
[2020-03-31 13:37:00,799] [ERROR] codeintel/service/mediator/codeintel: Request failed with message: Failed calling API method: getCompletions, message: ‘_Import’ object has no attribute ‘enclosingScope’ (-32603)
[2020-03-31 13:37:00,887] [ERROR] codeintel/service/mediator/codeintel: Request failed with message: Failed calling API method: getCompletions, message: ‘_Import’ object has no attribute ‘enclosingScope’ (-32603)
[2020-03-31 13:37:01,012] [ERROR] codeintel/service/mediator/codeintel: Request failed with message: Failed calling API method: getCompletions, message: ‘_Import’ object has no attribute ‘enclosingScope’ (-32603)
[2020-03-31 13:37:01,255] [ERROR] codeintel/service/mediator/codeintel: Request failed with message: Failed calling API method: getCompletions, message: ‘_Import’ object has no attribute ‘enclosingScope’ (-32603)
[2020-03-31 13:37:02,163] [ERROR] codeintel/service/mediator/codeintel: Request failed with message: Failed calling API method: getCompletions, message: ‘_Import’ object has no attribute ‘enclosingScope’ (-32603)
[2020-03-31 13:37:06,928] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,928] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,928] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,929] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,929] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,929] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,929] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,930] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,930] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,930] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,930] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,931] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,931] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,931] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,931] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,932] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,932] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,932] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,932] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,933] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,933] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,933] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,933] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:06,934] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:11,329] [ERROR] codeintel/service/mediator/codeintel: Request failed with message: Failed calling API method: getCompletions, message: ‘_Import’ object has no attribute ‘enclosingScope’ (-32603)
[2020-03-31 13:37:12,563] [ERROR] codeintel/service/mediator/codeintel: Request failed with message: Failed calling API method: getCompletions, message: ‘_Import’ object has no attribute ‘enclosingScope’ (-32603)
[2020-03-31 13:37:16,066] [ERROR] codeintel/service/mediator/codeintel: Request failed with message: Failed calling API method: getCompletions, message: ‘_Import’ object has no attribute ‘enclosingScope’ (-32603)
[2020-03-31 13:37:28,455] [WARNING] console-logger: Key event not available on GTK2: key=“u” modifiers=“control,shift” (1) in chrome://komodo/content/tail/tail.xul:0
[2020-03-31 13:37:44,659] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:44,660] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:44,661] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:44,662] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:44,663] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

[2020-03-31 13:37:44,664] [ERROR] console-logger: uncaught exception: [object Object] (0) in :0
Traceback (most recent call last):
File “”, line 0, in

Hi @komodo,

The description of the problem is too vague. I need more details on your actual reproduction scenarios. Please narrow this down to an minimal viable repro then share it here so I can have a look locally.

  • Carey

Ubuntu 18.04
Komodo IDE, version 12.0.1, build 91869, platform linux-x86_64. Built on Mon Feb 10 19:37:24 2020.
This is perl 5, version 26, subversion 1 (v5.26.1) built for x86_64-linux-gnu-thread-multi
(with 67 registered patches, see perl -V for more detail)
target project inside an LXD container
Added required paths to project’s additional Perl import directories

I don’t know what else can I say about the autocomplete other than it is working unreliably with the project’s packages. See https://streamable.com/g4kwl
Here is the package I was toying with https://github.com/Koha-Community/Koha/blob/3533aacef8772d43a471b558c4ae581b63a90ee7/C4/Accounts.pm

hey @komodo,

Could you also share you code intel logs when you reproduce this issue? They should be in your profile folder, codeintel3.log.

  • Carey

Thanks for the quick reply!

Here you go:

<1585679667> [2020-04-01 12:35:24,752] [DEBUG] service: Getting completions for /var/lxd/koha/home/koha/Koha/test.pl at pos 62
<1585679667> [2020-04-01 12:35:24,853] [DEBUG] service: Getting completions for /var/lxd/koha/home/koha/Koha/test.pl at pos 63
<1585679667> [2020-04-01 12:35:24,932] [INFO] peewee: Slow query, 6 ms
<1585679667> [2020-04-01 12:35:24,932] [INFO] peewee: (‘SELECT “t1”.“id”, “t1”.“path”, “t1”.“created” FROM “file” AS t1 WHERE (“t1”.“path” LIKE ?)’, [u’/var/lxd/koha/home/koha/Koha/Fcntl/SEEK_END/%‘])
<1585679667> [2020-04-01 12:35:24,938] [INFO] peewee: Slow query, 6 ms
<1585679667> [2020-04-01 12:35:24,938] [INFO] peewee: (‘SELECT “t1”.“id”, “t1”.“path”, “t1”.“created” FROM “file” AS t1 WHERE (“t1”.“path” LIKE ?)’, [u’/var/lxd/koha/home/koha/Koha/Fcntl/SEEK_END/%‘])
<1585679667> [2020-04-01 12:35:24,967] [INFO] peewee: Slow query, 6 ms
<1585679667> [2020-04-01 12:35:24,967] [INFO] peewee: (‘SELECT “t1”.“id”, “t1”.“path”, “t1”.“created” FROM “file” AS t1 WHERE (“t1”.“path” LIKE ?)’, [u’/var/lxd/koha/home/koha/Koha/Fcntl/SEEK_END/%‘])
<1585679667> [2020-04-01 12:35:25,004] [INFO] peewee: Slow query, 6 ms
<1585679667> [2020-04-01 12:35:25,004] [INFO] peewee: (‘SELECT “t1”.“id”, “t1”.“path”, “t1”.“created” FROM “file” AS t1 WHERE (“t1”.“path” LIKE ?)’, [u’/var/lxd/koha/home/koha/Koha/Fcntl/SEEK_SET/%‘])
<1585679667> [2020-04-01 12:35:25,011] [INFO] peewee: Slow query, 6 ms
<1585679667> [2020-04-01 12:35:25,011] [INFO] peewee: (‘SELECT “t1”.“id”, “t1”.“path”, “t1”.“created” FROM “file” AS t1 WHERE (“t1”.“path” LIKE ?)’, [u’/var/lxd/koha/home/koha/Koha/Fcntl/SEEK_SET/%‘])
<1585679667> [2020-04-01 12:35:25,040] [INFO] peewee: Slow query, 6 ms
<1585679667> [2020-04-01 12:35:25,040] [INFO] peewee: (‘SELECT “t1”.“id”, “t1”.“path”, “t1”.“created” FROM “file” AS t1 WHERE (“t1”.“path” LIKE ?)’, [u’/var/lxd/koha/home/koha/Koha/Fcntl/SEEK_SET/%‘])
<1585679667> [2020-04-01 12:35:25,077] [INFO] peewee: Slow query, 6 ms
<1585679667> [2020-04-01 12:35:25,077] [INFO] peewee: (‘SELECT “t1”.“id”, “t1”.“path”, “t1”.“created” FROM “file” AS t1 WHERE (“t1”.“path” LIKE ?)’, [u’/var/lxd/koha/home/koha/Koha/Fcntl/SEEK_CUR/%‘])
<1585679667> [2020-04-01 12:35:25,083] [INFO] peewee: Slow query, 6 ms
<1585679667> [2020-04-01 12:35:25,083] [INFO] peewee: (‘SELECT “t1”.“id”, “t1”.“path”, “t1”.“created” FROM “file” AS t1 WHERE (“t1”.“path” LIKE ?)’, [u’/var/lxd/koha/home/koha/Koha/Fcntl/SEEK_CUR/%‘])
<1585679667> [2020-04-01 12:35:25,148] [INFO] peewee: Slow query, 6 ms
<1585679667> [2020-04-01 12:35:25,148] [INFO] peewee: (‘SELECT “t1”.“id”, “t1”.“path”, “t1”.“created” FROM “file” AS t1 WHERE (“t1”.“path” LIKE ?)’, [u’/var/lxd/koha/home/koha/Koha/ZOOM/%‘])
<1585679667> [2020-04-01 12:35:25,155] [INFO] peewee: Slow query, 6 ms
<1585679667> [2020-04-01 12:35:25,155] [INFO] peewee: (‘SELECT “t1”.“id”, “t1”.“path”, “t1”.“created” FROM “file” AS t1 WHERE (“t1”.“path” LIKE ?)’, [u’/var/lxd/koha/home/koha/Koha/ZOOM/%‘])
<1585679667> [2020-04-01 12:35:25,206] [INFO] peewee: Slow query, 6 ms
<1585679667> [2020-04-01 12:35:25,206] [INFO] peewee: (‘SELECT “t1”.“id”, “t1”.“path”, “t1”.“created” FROM “file” AS t1 WHERE (“t1”.“path” LIKE ?)’, [u’/var/lxd/koha/home/koha/Koha/"File/Spec/%‘])
<1585679667> [2020-04-01 12:35:25,212] [INFO] peewee: Slow query, 6 ms
<1585679667> [2020-04-01 12:35:25,212] [INFO] peewee: (‘SELECT “t1”.“id”, “t1”.“path”, “t1”.“created” FROM “file” AS t1 WHERE (“t1”.“path” LIKE ?)’, [u’/var/lxd/koha/home/koha/Koha/"File/Spec/%‘])
<1585679667> [2020-04-01 12:35:25,230] [INFO] peewee: Slow query, 6 ms
<1585679667> [2020-04-01 12:35:25,230] [INFO] peewee: (‘SELECT “t1”.“id”, “t1”.“path”, “t1”.“created” FROM “file” AS t1 WHERE (“t1”.“path” LIKE ?)’, [u’/var/lxd/koha/usr/share/perl5/"File/Spec/%‘])
<1585679667> [2020-04-01 12:35:25,242] [INFO] peewee: Slow query, 6 ms
<1585679667> [2020-04-01 12:35:25,242] [INFO] peewee: (‘SELECT “t1”.“id”, “t1”.“path”, “t1”.“created” FROM “file” AS t1 WHERE (“t1”.“path” LIKE ?)’, [u’/var/lxd/koha/home/koha/Koha/"File/Spec/%'])
<1585679667> [2020-04-01 12:35:25,247] [ERROR] JsonRPC: Failed calling API method: getCompletions
Traceback (most recent call last):
File “/home/koha/Komodo-IDE-12/lib/mozilla/extensions/codeintel@activestate.com/pylib/codeintel/lib/server/jsonrpc.py”, line 59, in process
result = method"function"
File “/home/koha/Komodo-IDE-12/lib/mozilla/extensions/codeintel@activestate.com/pylib/codeintel/lib/service/init.py”, line 71, in getCompletions
completions = context.getCompletions()
File “/home/koha/Komodo-IDE-12/lib/mozilla/extensions/codeintel@activestate.com/pylib/codeintel/lib/completions.py”, line 193, in getCompletions
symbol = self.symbol_resolver.resolve(self.scope, self.symbol_name)
File “/home/koha/Komodo-IDE-12/lib/mozilla/extensions/codeintel@activestate.com/pylib/codeintel/lib/language/common.py”, line 863, in resolve
self._import_resolver.resolveImports(scope)
File “/home/koha/Komodo-IDE-12/lib/mozilla/extensions/codeintel@activestate.com/pylib/codeintel/lib/language/common.py”, line 703, in resolveImports
self.resolveImport(symbol, scope)
File “/home/koha/Komodo-IDE-12/lib/mozilla/extensions/codeintel@activestate.com/pylib/codeintel/lib/language/legacy/perl/import_resolver.py”, line 240, in resolveImport
self.resolveImports(scope)
File “/home/koha/Komodo-IDE-12/lib/mozilla/extensions/codeintel@activestate.com/pylib/codeintel/lib/language/common.py”, line 703, in resolveImports
self.resolveImport(symbol, scope)
File “/home/koha/Komodo-IDE-12/lib/mozilla/extensions/codeintel@activestate.com/pylib/codeintel/lib/language/legacy/perl/import_resolver.py”, line 240, in resolveImport
self.resolveImports(scope)
File “/home/koha/Komodo-IDE-12/lib/mozilla/extensions/codeintel@activestate.com/pylib/codeintel/lib/language/common.py”, line 703, in resolveImports
self.resolveImport(symbol, scope)
File “/home/koha/Komodo-IDE-12/lib/mozilla/extensions/codeintel@activestate.com/pylib/codeintel/lib/language/legacy/perl/import_resolver.py”, line 217, in resolveImport
scope = scope.resolve(name_parts[0]).enclosingScope
AttributeError: ‘_Import’ object has no attribute ‘enclosingScope’

@komodo,

Sorry for the delay. There’s definitely something wrong in that code but I’m not going to be able to jump on this right now. I’ll try to carve out time but I don’t know when that will be.

I’m guessing it’s at least partly related to this ticket:

  • Carey