DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Extend DIAdem Python AutoComplete

Solved!
Go to solution

Is there a way to extend Python Autocomplete for user-specific DIAdem to directories other than Site-Packages?

 

For example, in VSC you can edit the settings.json to add paths to:

  • python.analysis.extraPaths (for importing)
  • python.autoComplete.extraPaths (for autocompletion)

JoshRew_0-1626804101087.png

So stuff imported from "C:\Repositories\Python\MyLibraryOther\__init__.py" is directly visible on import alongside stuff in SitePackages:

JoshRew_6-1626805157740.png

 

I've been able to add further locations to the active DIAdem Python Path via:

import site
site.addsitedir('C:/Repositories/Python/')

 

With that, I can "use" the script contents from both "Other" and "Site-Packages" items:

JoshRew_8-1626805377915.png

 

But I can only "see" items located within the Site-Packages folder:

JoshRew_7-1626805263313.png

 

-Josh Rewerts

Message 1 of 3
(697 Views)
Solution
Accepted by topic author JoshRew

Hi Josh,

 

R&D says, "Currently only packages installed under the "normal" Python path are included in the autocomplete.  But it would be possible to retrofit something like this as a feature in a future release."

 

Would you be willing to add that to the DIAdemIdeas page?  Suggestions always mean more coming straight from customers...

 

Good to hear from you,

Brad Turpin

Principal Technical Support Engineer

NI

0 Kudos
Message 2 of 3
(495 Views)