EditPythonScript AutoComplete bug

Hi @dale,

If i type this in the python script editor, everything after clr.AddReferenceToFileAndPath fails to autocomplete:

import Rhino
import clr

# before below line, autocomplete works as expected
clr.AddReferenceToFileAndPath(r"C:\Test.dll")
# after above line, autocomplete stopped working eg type
Rhino.

_
c.

@Alain - is this something you can look at?

Hi @clement,

does ‘C:\Test.dll’ exist?

Hi @Alain, yes the dll exists and is loaded properly. (The real path to it is longer).

btw. one way to circumvent it is to write it like so:

tmp = clr.AddReferenceToFileAndPath(r"C:\Test.dll")

_
c.

Ok. Thanks. I’ll take a deeper look

@clement, If I run the original script and the path is a valid assembly then it works. Did you perhaps simplify the script before pasting? For example with:

import Rhino
import clr

# before below line, autocomplete works as expected
p = r"C:\Test.dll"
clr.AddReferenceToFileAndPath(p)
# after above line, autocomplete stopped working eg type
Rhino.

auto complete does NOT work.

Looking at the auto complete logic I notice that any line that starts with “import”, “from”, or “clr” has to stand on its own. In my example above the line that starts with “clr” doesn’t stand on it’s own - it depends on the line above that defines ‘p’.

We’re not planning any serious work on the auto complete logic because in the future we’re replace it with something new and more complete.

Does that make sense?

Hi @Alain, my line starting with clr is below a line which is starting with a comment # sign.

I’ll send a small video to show what i see. It does not work even when i have an empty line above the line starting with clr. My path is valid but the file name of the dll has an extra dot in it eg: Prefix.Suffix.dll

Not sure. If there is a bug and if it is fixable, why leave RH6 in this state ? Are you planning to have deep intellisense in RH7 ?

_
c.

Hi @clement,

What I meant was that the line starting wih “clr” needs to stand on it’s own and not depend on values defined in other lines. So auto completion doesn’t work after

path = r"C:\Test.dll"
clr.AddReferenceToFileAndPath(path)

no matter where path is defined. Instead it needs to be all on one line:

clr.AddReferenceToFileAndPath(r"C:\Test.dll")

That’s how it works now.

In the future we want to integrate with an existing language server so you’ll get the same auto complete as vscode for example. If a problem has an acceptable work around, affects very few people, and isn’t a trivial fix then it will have a lower priority but of course otherwise we want to fix it.

I hope that makes sense.

1 Like

In short, we’ll fix it if we can :slight_smile:

1 Like

Thanks @Alain and @stevebaer, putting it in one single line worked.

_
c.