You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 27, 2019. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 27, 2019. It is now read-only.
Symbol search on joxeankoret/maltindex doesn't seem to work #25
My guess is py2 syntax is throwing off the parser we use for symbols. If the implementation hasn't changed, I used the builtin parse which is very fast but will expect py3 syntax.
Can work around this somehow (like try the python 3 parser and then fall back to the python 2 parser)? How much of a pain would that be? I'm guessing there's a fair amount of Python 2 out there still both in OSS and private code.
If we fall back to a Python 2 parser, it probably can't be the stdlib parser since our langserver is in Python 3. We could fall back on a different parser though (which would be slower).
I've seen a technique where you shell out to a small python2 program and have it output a JSON serialization of the AST that it parsed using its stdlib parser.
That should work, as long as we make the program we shell out to take a list of things to parse. Otherwise the overhead of starting up python will dominate. We could go back to using a more relaxed parser like jedi does, but it is much slower. So I think using the subprocess approach would be worth it.
Activity
keegancsmith commentedon Jun 27, 2017
My guess is py2 syntax is throwing off the parser we use for symbols. If the implementation hasn't changed, I used the builtin parse which is very fast but will expect py3 syntax.
akhleung commentedon Jun 27, 2017
Yeah, we're still using the builtin parser for workspace symbols (global references too)
beyang commentedon Jun 29, 2017
Can work around this somehow (like try the python 3 parser and then fall back to the python 2 parser)? How much of a pain would that be? I'm guessing there's a fair amount of Python 2 out there still both in OSS and private code.
akhleung commentedon Jun 29, 2017
If we fall back to a Python 2 parser, it probably can't be the stdlib parser since our langserver is in Python 3. We could fall back on a different parser though (which would be slower).
sqs commentedon Jun 29, 2017
I've seen a technique where you shell out to a small python2 program and have it output a JSON serialization of the AST that it parsed using its stdlib parser.
keegancsmith commentedon Jun 30, 2017
That should work, as long as we make the program we shell out to take a list of things to parse. Otherwise the overhead of starting up python will dominate. We could go back to using a more relaxed parser like jedi does, but it is much slower. So I think using the subprocess approach would be worth it.