neovim icon indicating copy to clipboard operation
neovim copied to clipboard

fix(python): import semantic_tokens from basedpyright

Open akthe-at opened this issue 1 year ago • 7 comments
trafficstars

Fixes Issue #256. Initial testing shows that produces a favorable change but is difficult for me to know if it bothers any other languages other than the 4 I looked at (Python, R, SQL, Lua).

akthe-at avatar Mar 24 '24 10:03 akthe-at

We recently set @lsp.type.variable in https://github.com/rose-pine/neovim/pull/240 to solve other issues so if we can only add the python changes I'd accept that :)

mvllow avatar Mar 25 '24 21:03 mvllow

:( It will still be broke if we do just that, will need to research more and figure out a way to make it work both ways. I don't know rust but is there a correct vs incorrect example from Tom's issue that I could use while trying to work this out?

akthe-at avatar Mar 25 '24 21:03 akthe-at

Hmm, I'd try svelte if you're familiar with starting node-related apps.

<script>
let site = "example";
</script>

<a href="{site}.com"></a>

In that example, site or perhaps {site} should be coloured differently than the rest of the string which would be gold.

mvllow avatar Mar 25 '24 22:03 mvllow

Also, I assume ["@lsp.type.namespace.python"] = {}, wouldn't fix this?

mvllow avatar Mar 25 '24 22:03 mvllow

I just tested your latest suggestion and that does not work :\ I am not much of a color scheme expert. I am trying to look at other color scheme repos that are not having this issue for reference to see but there is just so many different variables and tokens that I don't know what to think anymore. Catppuccin and Tokyonight are both not facing this issue if their code makes anymore sense to you?

akthe-at avatar Mar 26 '24 01:03 akthe-at

This local override solves the issue for me, exactly what @akthe-at did in the pull requests.

    require("rose-pine").setup({
      highlight_groups = {
        ["@lsp.type.variable"] = {},
        ["@lsp.type.namespace.python"] = { link = "@variable" },
      },
    })

dhruvinsh avatar Mar 26 '24 12:03 dhruvinsh

Latest commit fixes that single item you brought up regarding the svelte variable within string highlight but I was not sure if there were other problems/issues in svelte or other languages that created the need for the previous change(s)?

akthe-at avatar Mar 31 '24 10:03 akthe-at

Ah that's a good solution. I'll have to double check and make sure svelte was the only outlier here this week. Appreciate the update :)

mvllow avatar Mar 31 '24 14:03 mvllow

wow, none of this would have been needed if we had waited for this, sorry. https://github.com/DetachHead/basedpyright/pull/229 If you need to make any regressions because issues caused from this, just know it won't impact the python and the python type could be stripped out as unnecessary at this point.

akthe-at avatar Apr 19 '24 01:04 akthe-at

Eh, might remove the code in the future but thank you for bringing this information back to us :)

mvllow avatar Apr 19 '24 03:04 mvllow