Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish an official extension for vscode #194

Open
ghisvail opened this issue Nov 23, 2017 · 12 comments
Open

Publish an official extension for vscode #194

ghisvail opened this issue Nov 23, 2017 · 12 comments

Comments

@ghisvail
Copy link

Are there any plans to make the vscode-client available as an official extension, or is it designed for internal use only?

It could join the family of existing language server plugins like Java, Scala or Rust. There is already a Python plugin officially sponsored by Microsoft but it is significantly heavier in comparison.

Thoughts?

@gatesn gatesn mentioned this issue Jul 4, 2018
@gvanrossum
Copy link

What is meant by “heavier” and which is heavier, pyls or the MS extension?

@gatesn
Copy link
Contributor

gatesn commented Jul 4, 2018

The MS extension could be considered a fat client. There’s a fair bit of typescript code that calls into Python where necessary.

Pyls tried to keep all logic in the server. The src/extension.ts file has all the client logic we need.

I’m not sure if @ghisvail is referring to performance? I’ve not compared the two.

In terms of features, I’d say currently the MS extension is more complete. Although goes without saying, any work done to further Pyls will benefit all language server clients.

@gvanrossum
Copy link

gvanrossum commented Jul 4, 2018

Got it. I also noticed what I'd call buggy behavior when using pyls. E.g. when there's a class C, typing x = C() is quite insistent in suggesting chr instead and hitting Enter leaves the line looking x = chr with the cursor at the end of the line. I personally find it quite bad if just typing correct code results in something other than what I literally typed. (Then again MS software has been auto-correcting straight quotes into "smart" ones for decades, so I realize I'm at the losing end of this debate.) Quite likely I should report this somewhere else though (perhaps it's due to Jedi?)

@gatesn
Copy link
Contributor

gatesn commented Jul 5, 2018

Our completion wrapper is indeed a very thin layer over Jedi: https://github.com/palantir/python-language-server/blob/develop/pyls/plugins/jedi_completion.py

I would be willing to consider alternatives, or even build one if it makes sense, but Jedi seems like the standard tool even now.

I’d be interested to know if you are aware of any other solutions? Currently we need Pyls to support Python 2, although I’m hoping we can remove that requirement by end-of-year and include some of the vast capabilities of tools like Mypy as standard.

@gvanrossum
Copy link

I don't know much about how Jedi works -- IIRC I tried it a few years ago and found it rather primitive. If the behavior I saw yesterday is due to Jedi I don't think it's mature enough.

At Dropbox we're going to work on deeper integrating of mypy with various editors, and LSP is one of our targets. (I came across pyls doing some research for this project.) The main reason why we think that mypy will be more effective than Jedi is that we now have a mypy daemon which keeps all inferred type information in memory. It can also quickly update this information whenever a file is changed. It's too soon to say how successful we'll be, but it's quite possible that eventually mypy will be able to replace Jedi for most or all of its functionality. (Note that mypy supports Python 2 too.)

@micbou
Copy link

micbou commented Jul 6, 2018

when there's a class C, typing x = C() is quite insistent in suggesting chr instead and hitting Enter leaves the line looking x = chr with the cursor at the end of the line.

I don't think this is an issue with Jedi. If completion is requested after x =, Jedi returns the class C and chr among other candidates. It's then up to the client to avoid displaying and selecting chr after typing C(. So I would say it's a bug with the client or VS Code itself (unless I didn't understand the issue).

@matangover
Copy link

@gvanrossum, is there any news regarding integration of mypy with various editors? I could not find any information. I am interested on working on a mypy-based language server -- I've made a proof of concept with dmypy providing hover/go-to-definition functionality within VS Code. (It has helped that Python 3.8 added end_line and end_col_offset to the AST.)

@gvanrossum
Copy link

@matangover Sorry, there's no progress. We may start working on this over the summer, but no promises.

@adamal
Copy link

adamal commented Jun 12, 2020

It's a year later. Is the idea abandoned?

@ccordoba12
Copy link
Contributor

Unfortunately, we don't have plans to create a VSCode extension for this server because most contributors use it for other editors and IDEs.

@munael
Copy link

munael commented Jul 21, 2020

Can we add some documentation on enabling it for some IDEs? I assumed that installing the pip package would somehow register it for vscode to catch, but that doesn't seem to be the case.

@Stercator
Copy link

@ccordoba12 What about the developers who want to simply use the extension (without developing it)? I mean, it strikes me from the ReadMe and integration-related questions/issues that there's so little support on actually using it. Or maybe I just had overly optimistic expectations regarding "readiness for use"...
The description sounds like the perfect extension, and given that it reuses existing components, it sounds even within reach. But without an actual integration, it stays just a dream (for hobbyist coders like me).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants