Import with alias in intelli prompt

SyntaxEditor Python Language Add-on for WPF Forum

Posted 2 years ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Version: 21.1.3
Platform: .NET 4.8
Environment: Windows 10 (64-bit)
Avatar

Hi,

I am having trouble with imports that are using an alias.

For example I have the following import statement:

import vector.canoe as xxx

When I enter "xxx." the intelli prompt show the package "canoe". I would have assumed the content of "canoe" is shown.
What is worse is that when I change the import statement to this:

import vector.canoe.tfs as xxx

Now after "xxx." the intelli prompt still shows the package "canoe".

Am I missing something here, or is this a bug? I am a python novice, so I am not really sure, how this should behave.


Best regards, Tobias Lingemann.

Comments (5)

Answer - Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Tobias,

Thanks for reporting it, it seems to be a bug.  We've fixed it for the upcoming 22.1 version.


Actipro Software Support

Posted 2 years ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Avatar

Hi,

I just tested the current 22.1 release and think the feature has broken the normal import. Yes the alias is used correctly if specified, but if not specified the top-level-package name is used instead.

For exmaple we add these two import by default in each document:

import vector.canoe
import vector.canoe.tfs

If I now open the intelli prompt after "vector." the content of "vector.canoe.tfs" is shown. It is like the import statement uses an alias "import vector.canoe.tfs as vector". But I don't think thats the desired behavior (I am still no Python expert).


Best regards, Tobias Lingemann.

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Tobias,

Thanks, we've corrected this so both scenarios work properly.  The change is ready for the next build v22.1.1.


Actipro Software Support

Posted 2 years ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Avatar

Hi, can you say when the next build will be released?


Best regards, Tobias Lingemann.

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Tobias,

We expect a release in the next week or two.  You can also write our support address to request a preview build if you'd like to try the fix now.  Please reference this thread if you write.


Actipro Software Support

The latest build of this product (v24.1.2) was released 12 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.