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

Outliner no alerting if functions or classes are doubled - other case #7003

Open
ManPython opened this issue Mar 1, 2025 · 4 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@ManPython
Copy link

Please not close ticket, coz can't edit and comment this (don't know why):
#6992 (comment)

Environment data

  • Pylance version: XXX
  • OS and version: XXX
  • Python version (& distribution if applicable, e.g. Anaconda): XXX

Code Snippet

def bike1():
    pass

def bike2():
    pass

def bike3():
    pass


def bike4():
    pass

def bike1(): #
    pass

def bike1():
    pass

def bike5():
    pass

def bike1(): #
    pass

class test(): #
    test = 1

class test(): #
    test = 1

class test1():
    test = 1

class test(): #
    test = 1

Repro Steps

Image

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Mar 1, 2025
@debonte debonte assigned debonte and unassigned heejaechang Mar 2, 2025
@debonte
Copy link
Contributor

debonte commented Mar 2, 2025

If you set "python.analysis.typeCheckingMode" to "basic" (or any value other than "off") you will get diagnostics for these redeclarations:

Image

@debonte debonte added enhancement New feature or request waiting for user response Requires more information from user and removed needs repro Issue has not been reproduced yet labels Mar 2, 2025
@ManPython
Copy link
Author

The case was to offer support for this in outline elements as counter, alert as feature request.
Very often in problems window is soo many not important alerts, that hard to watching there.

@github-actions github-actions bot added user responded Was "waiting for user response" and they responded and removed waiting for user response Requires more information from user labels Mar 2, 2025
@debonte
Copy link
Contributor

debonte commented Mar 2, 2025

Thanks, I understand your request. It's unlikely that we'll implement this feature unless there's strong support from other community members via up-votes. In the meantime, the reportRedeclaration diagnostic is my best suggestion. If your Problems pane is filled with diagnostics that you consider unactionable you could suppress them as described here or change the severity of particular diagnostics as described here.

Looks like the "Convert to discussion" feature is still broken. Once that is fixed, I'll transfer this issue to our enhancement discussions section.

I think this issue better describes your request, so I'll move this one (when possible) and close #6992 (now).

@debonte debonte removed the user responded Was "waiting for user response" and they responded label Mar 2, 2025
@ManPython
Copy link
Author

The case is important coz AI doing this type duplication, eg. building new class, but functions this same, etc.

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

No branches or pull requests

3 participants