neovim
neovim copied to clipboard
fix(python): import semantic_tokens from basedpyright
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).
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 :)
:( 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?
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.
Also, I assume ["@lsp.type.namespace.python"] = {}, wouldn't fix this?
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?
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" },
},
})
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)?
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 :)
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.
Eh, might remove the code in the future but thank you for bringing this information back to us :)