DaGhostman / vscode-tree-view

VSCode extension that probvides mail symbol overview of the currently opened file
MIT License
29 stars 4 forks source link

It works for php but doesn't work for python #100

Closed reese-repo closed 5 years ago

reese-repo commented 5 years ago

it works for php but doesn't work for python. I try install filbert by myself, but still not work.

vscode 1.32.1 os ubuntu 18.04.2

DaGhostman commented 5 years ago

Hmm, python is enabled by default, but I recall having issues with the support a while back, could you provide a little more info:

  1. Is it happening for all python files?
  2. Could you provide a minimal example that reproduces the issue?
reese-repo commented 5 years ago
  1. Yes, all python files.And vscode outline works.
  2. 
    #!/usr/bin/env python3
    # -*- coding:utf-8 -*-

a = 'abc' b = 'defhig'

a, b = sorted([a, b], key=lambda x: len(x), reverse=True)

print([a, b])


3. Does this extension need any extensions or softwares or configs? It also desn't work with python files on my macbook.
DaGhostman commented 5 years ago

there shouldn't be any need for configs although the case you are describing here is interesting I have a suspicion that the issue comes from a, b = ... not being handled properly. Doesn't it work when you remove that line?

Also what will the expected output be?

Thanks!

DaGhostman commented 5 years ago

Related to https://github.com/differentmatt/filbert/issues/71

Unfortunately there is nothing that could be done for this, if the parser doesn't understand what is happening there is no way for the extension to guess/know/extrapolate the tree.

And while I do understand your frustration, there is nothing I could do right now, will be keeping a close eye on this one, but until then ... :disappointed:

reese-repo commented 5 years ago

@DaGhostman I get some progress.It could parse very simple syntax.

#!/usr/bin/env python3
# -*- coding:utf-8 -*-

a = 1
b = 2

a, b = b, a

But it also doesn't work for complex syntax.

DaGhostman commented 5 years ago

To some extent I think it makes sense for it to break, the possibilities are quite a number and given the fact that it [filbert] hasn't been updated for a while ... :disappointed:

reese-repo commented 5 years ago

Last filbert version was published 3 years ago and never updated after that. So sad. Do you have a plan B for it ?

DaGhostman commented 5 years ago

Unfortunately no, when I was looking for a python parser there weren't any, maybe if the community picks it up and a more maintained fork comes up, I will look into fixing this, but until then there is nothing I can do.

If you stumble upon a good alternative, please reopen this or submit a new issue