Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Semantic highlighting recognising magic method decorated with lru_cache as function #2816

Closed
Bobronium opened this issue May 15, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@Bobronium
Copy link

Bobronium commented May 15, 2022

Environment data

  • Language Server version: 2022.5.1 (pyright e0e07d31)
  • OS and version: 12.3.1 (21E258)
  • Python version (& distribution if applicable, e.g. Anaconda): 3.10, pyenv

Code Snippet

from functools import lru_cache


class Foo:
    @lru_cache(maxsize=1)
    def __str__(self):
        return "magic"
Screenshots image image image

Repro Steps

  1. Enable semanticTokenColorCustomizations by putting this in settings.json:
    "editor.semanticTokenColorCustomizations": { "enabled": true },
  1. Open code snippet in editor
  2. Use >Inspect Editor Tokens and Scopes to spot the bug

Expected behavior

Magic methods decorated with lru_cache show this info:

semantic token type | magicFunction
modifiers | declaration

Actual behavior

Magic methods decorated with lru_cache show this info:

semantic token type | function
modifiers | decorator

Logs

Too large to fit here. Will post if necessary.

@heejaechang heejaechang added the needs investigation Could be an issue - needs investigation label May 16, 2022
@github-actions github-actions bot removed the triage label May 16, 2022
@bschnurr bschnurr added enhancement New feature or request and removed needs investigation Could be an issue - needs investigation labels Jun 10, 2022
@judej
Copy link
Contributor

judej commented Jun 13, 2022

Moving this issue to discussion as an enhancement request for comments and upvotes.

@microsoft microsoft locked and limited conversation to collaborators Jun 13, 2022
@judej judej converted this issue into discussion #2920 Jun 13, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants