suoto / hdl_checker

Repurposing existing HDL tools to help writing better code
GNU General Public License v3.0
187 stars 22 forks source link

Type DefaultDict cannot be instantiated; #75

Closed kdurant closed 4 years ago

kdurant commented 4 years ago
[object Object]
[Error - 5:03:20] Request textDocument/hover failed.
  Message: TypeError: Type DefaultDict cannot be instantiated; use collections.defaultdict() instead
  Code: -32602 
suoto commented 4 years ago

Which Python version and OS are you getting this?

kdurant commented 4 years ago

python3.6 win10

suoto commented 4 years ago

Can't tell much without logs. Might be something to do with the cache state; have you tried cleaning up the the _hdl_checker folder in the project's root?

kdurant commented 4 years ago

Hdl_checker without settings, only install HDL Checker LSP Client in vscode Project without _hdl_checker folder Only one file in project

suoto commented 4 years ago

Which HDL Checker version are you using? You can check it via hdl_checker -V

suoto commented 4 years ago

Closing due to inactivity, please reopen if/when the requested info is provided.

suoto commented 4 years ago

This issue seems to happen on Python 3.5, not Python 3.6, will investigate further, but if adding Python 3.5 to the CI tests is too much of a hassle it won't be worth it since its end of life is only 7 months away.

Tcenova commented 4 years ago

Can confirm this occurs on Python 3.5 on Ubuntu 16.04. It seems that the typing library was added to Python 3.5 and the pip package has no impact according to: https://pypi.org/project/typing/. It must be that the older version of the typing library did not support the instantiation of a DefaultDict.

suoto commented 4 years ago

Might be, I've tested with Python 3.5 locally and didn't get this so it's not really Python version specific indeed.

In any case, I'll remove uses of DefaultDict to fix this issue, feel free to reopen this or open another issue if there's other problems :+1: