CoatiSoftware / SourcetrailPythonIndexer

Python Indexer for Sourcetrail based on jedi, parso and SourcetrailDB
GNU General Public License v3.0
90 stars 28 forks source link

Type annotation and f-strings errors: `Unexpected token of type "OP" encounted.` #61

Open grenki opened 4 years ago

grenki commented 4 years ago

example:

@attr.s
class A:
     b: int = attr.ib()

a = 2
log.warning(f'a: {a}')

Do you have python 3.6+ support?

Maybe issue caused by environment. I use pipenv environment, and tool reports "The python binary is potentially unsafe"

Thank you for this awesome tool :)

mlangkabel commented 4 years ago

Hi @grenki, I am very sorry for the late reply. Can you tell us what operating system you are using to run Sourcetrail?

As far as I know, the Python indexer uses the Python version of the Python environment that is configured in your Sourcetrail project settings. If nothing is configured, the environment will be auto detected. You can try to specify a Python 3.6 environment explicitly.

I tried to index the code snippet you provided and it worked without any errors for Sourcetrail 2019.4.102