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

Build 2018.8.0-alpha0: outline: __init__ method attributes incorrect #2384

Closed
derekwallace opened this issue Aug 13, 2018 · 7 comments
Closed
Assignees
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@derekwallace
Copy link

vscode Insiders
manually installed vscode-python 2018.8.0-alpha0

Good news is that outline shows the methods inside the class.
I think there are a number of bugs with what it displays.

There seems to be some issue with attributes.
In the following you see a number of attributes.
dCache*. these are all defined in the init method. Why are they show outside the class?
If you click on the attribute, it brings you to line 1 of the file, which is a comment.

image

here is the init
image

For this method the local variables are withing the method.
image

In this example its confused with "cls" which is used for a class method.

image

image

@derekwallace derekwallace changed the title Build 2018.08-alpha0: outline: __init__ method attributes incorrect Build 2018.8.0-alpha0: outline: __init__ method attributes incorrect Aug 13, 2018
@d3r3kk d3r3kk added bug Issue identified by VS Code Team member as probable bug area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. needs verification labels Aug 13, 2018
@MikhailArkhipov
Copy link

Why are they show outside the class?
See #2224
Structure is known when analysis complete. However, waiting on its completion is a non-trivial issue.

@derekwallace
Copy link
Author

I'm not clear what point you are trying to make. Outline is much better (shows method in class) but it has bugs as per my description.

@MikhailArkhipov
Copy link

What you see is #2224. This one is basically a duplicate. Information is not available until analysis completes and it takes a while to complete. Since #2224 is still in works what you see is a partial result.

@brettcannon
Copy link
Member

I can't reproduce the attribute issue, but I do see a problem with classmethod. With the following code:

class Spam:

    def __init__(self):
        self.answer = 42

    @classmethod
    def cls_meth(cls, arg):
        return self.answer * arg

I get the following outline (notice how cls is at the same level as Spam and all methods are attributed to cls):
capture

@MikhailArkhipov
Copy link

MikhailArkhipov commented Aug 16, 2018

@brettcannon - LSP returns information as list, not as a tree. Any nesting is some VSC 'heuristic' most probably based on names. LSP does not support https://code.visualstudio.com/updates/v1_25#_document-symbols. VS Code features do not reflect in LSP at all, LSP is not specific to VS Code and is changed on case by case basis.

@d3r3kk (great name, wrong Derek) @derekwallace - tooltip is auto-generated by vscode, we don't provide anything.

@MikhailArkhipov
Copy link

MikhailArkhipov commented Aug 16, 2018

@MikhailArkhipov
Copy link

microsoft/PTVS#4661

@lock lock bot locked as resolved and limited conversation to collaborators Oct 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

4 participants