Python-language-server: Add support for class method overrides

Created on 4 Oct 2019  路  15Comments  路  Source: microsoft/python-language-server

Hi,
It would be nice to have features simular to pycharm which show overriden methods of classes, suggest methods which can be overriden or should be (not implemented methods for example).
I did not find any issues or milestones related to this.

blocked enhancement upstream-lsp upstream-vscode

Most helpful comment

Hi, all
I do really think the indicator of overwrote method is a good design for programming. And I made an example below, which is provided by pycharm, FYI.
image

All 15 comments

Moving this to Language Server repo. This would be a feature on LS.

Can you provide some specific examples? We do have override support already through completions, where writing def something will recognize that the base class has a method and then complete to a placeholder which calls it.

I'm not entirely certain how we'd show that something is an override, at least from the LSP point of view, since there doesn't seem to be any way to make a visual indicator.

And by suggesting something that isn't implemented, do you mean something that's been marked as abstract by a base class, but has not yet been implemented to complete?

Hi,
the complete on base class method works nicely but it would be useful to have some visual indicator that would show that method overrides base class method (for example pycharm has little bullet next to line number with arrow which indicates method override and also shows info about Class.method where class is name of base class as we can inherit from multiple classes).

By suggesting something that isn't implemented I mean when you use for example use abstractmethod decorator from abc. I would be nice to have suggestions or maybe some shortcut which would show little window which method should / could be implemented with option to add them like this

These are probably more visual aspects but not sure though.

Hi, all
I do really think the indicator of overwrote method is a good design for programming. And I made an example below, which is provided by pycharm, FYI.
image

+1, would be a very useful feature

+1 waiting for this and it will be very helpful

@jakebailey any updates when it will be available? one of the important features for Pycharm users!

No updates. This sort of thing is not in the language server specification. As far as I know, VS Code (our main user) doesn't have support for these sorts of sidebar icons in their UI other than for the built-in debugger, and without it being in the LSP specification we'd have to implement this custom.

Potentially, this could be a code lens, but those are much more space-wasting than an icon to the side.

@jakebailey this issue was moved from LS by @karthiknadig so maybe you could give it second thought ?

Just wanted to added another +1 on this, this is whats keeping us to move away from IntelliJ at the moment.

This would be a very useful feature +1

This would be a very useful feature +1

+1

+1

+1

+1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xobs picture xobs  路  66Comments

kaushall picture kaushall  路  37Comments

DonJayamanne picture DonJayamanne  路  36Comments

brettcannon picture brettcannon  路  29Comments

MikhailArkhipov picture MikhailArkhipov  路  46Comments