python-language-server icon indicating copy to clipboard operation
python-language-server copied to clipboard

Add support for class method overrides

Open johnybx opened this issue 7 years ago • 21 comments

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.

johnybx avatar Oct 04 '19 19:10 johnybx

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

karthiknadig avatar Oct 08 '19 07:10 karthiknadig

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?

jakebailey avatar Oct 08 '19 16:10 jakebailey

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.

johnybx avatar Oct 09 '19 07:10 johnybx

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

imuxin avatar Dec 24 '19 08:12 imuxin

+1, would be a very useful feature

antonwnk avatar Feb 01 '20 17:02 antonwnk

+1 waiting for this and it will be very helpful

shrhawk-entertainer avatar Mar 23 '20 11:03 shrhawk-entertainer

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

shrhawk-entertainer avatar Apr 02 '20 18:04 shrhawk-entertainer

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 avatar Apr 02 '20 18:04 jakebailey

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

johnybx avatar Apr 07 '20 08:04 johnybx

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

b99andla avatar Jun 11 '20 11:06 b99andla

This would be a very useful feature +1

swd543 avatar Sep 29 '20 08:09 swd543

This would be a very useful feature +1

+1

dbulgakov7 avatar Feb 02 '21 17:02 dbulgakov7

+1

shreeraviadhikari avatar Feb 16 '21 14:02 shreeraviadhikari

+1

gabhinav001 avatar Feb 25 '21 05:02 gabhinav001

+1

j-pong avatar Mar 12 '21 04:03 j-pong

+1

Object905 avatar Aug 10 '21 06:08 Object905

+1

eugene-s avatar Aug 31 '21 08:08 eugene-s

+1

farib-reasonal avatar Sep 01 '21 13:09 farib-reasonal

+1,It would be a great feature add up and down arrow on children class method and parent class method.

Cheng-2v avatar Sep 07 '21 08:09 Cheng-2v

+1

allania7med11 avatar Sep 22 '21 16:09 allania7med11