python-lsp / python-lsp-server

Fork of the python-language-server project, maintained by the Spyder IDE team and the community
MIT License
1.75k stars 186 forks source link

Support workspace symbols #511

Open eyalk11 opened 6 months ago

eyalk11 commented 6 months ago

It simply works. (Telescope lsp_workspace_symbols)

The only comment is that the formatting of document.path and d.module_path was different (don't know why the hell) - (C:\... vs uri or \...) , so I used the full path for telescope to handle this.

eyalk11 commented 6 months ago

I really suggest to use it with https://github.com/natecraddock/workspaces.nvim/issues/29 . LSP workspace folders is just hell. I improved the commit a bit. but would like to hear from you before investing more time in publishing this.

Just want to make sure the general tendency is to include this after fixes.

ccordoba12 commented 5 months ago

Hey @eyalk11, thanks for your contribution! I think Jedi provides a better way to extract workspace symbols than doing it file by file, which seems inefficient.

Besides that, your work is also missing tests.

eyalk11 commented 5 months ago

What is the better method? I mean I suppose it doesn't parse all the files by default.

feakuru commented 1 month ago

i'd like to help with this, but i'm reading jedi docs and i can't find any included method to extract workspace symbols, only getting names from a singular script. @ccordoba12 could you clarify what exactly you meant here?

ccordoba12 commented 1 month ago

@feakuru, you can take a look at what jedi-language-server does. If I'm not mistaken, they implemented getting workspace symbols the right way with Jedi.