maralla / completor.vim

Async completion framework made ease.
MIT License
1.27k stars 63 forks source link

Fixing problem with json dumping failure of PosixPath. #308

Closed fx-kirin closed 3 years ago

fx-kirin commented 3 years ago

Currently jump-to-definition isn't working properly with python3 because PosixPath cannot be converted into json format directly.

This is a quick patch to fix it.

[I 210128 20:25:06 __init__:96] Exception e=TypeError('Object of type PosixPath is not JSON serializable')

It was hard to find this bug because json dump failure didn't have any output to logger. I think exception handling of json dumping failure should be added too.

fx-kirin commented 3 years ago

jedi has already abandoned python 2.7 support. Does completor still need 2.7 support?

maralla commented 3 years ago

Thanks for your contribution! I think to fix the problem we can just change the line to use str(d.module_path). Would you mind to modify your fix?

fx-kirin commented 3 years ago

No problem. Done!