-
Notifications
You must be signed in to change notification settings - Fork 73
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
fix: add missing default highlight groups #219
Conversation
Thanks for the PR! Happy to merge it, but I'd like to dig in a bit first so I understand what's going on. The current LSP spec doesn't list any of those symbol kinds, and neither does the upcoming spec. What language servers are you using that returns these values, and can you give me a short code snippet that includes one or two of them? |
Hey @stevearc ! I'll be honest, I'm not completely sure. I am the lead developer of AstroNvim and someone that uses it ran into this issue where a I can see if I can figure out what language servers it was that was returning these types of symbols but it might take me a few days. Thanks for all your help in advance! |
Ah, those icons were copied from lspkind.nvim and I didn't think much about it at the time, but there's several values that aren't a SymbolKind. After looking around, it seems that they are part of a different enum value, CompletionItemKind. This makes sense, because lspkind.nvim aims to provide symbols inside the completion popup. It still doesn't explain why a Could you point me to the user report? I'm happy to take this on from the AstroNvim side, and I really would like to figure out what's going on here. |
Yeah I can let you know if I can get the user to be able to replicate the issue. They say they have run into this a lot but cannot currently replicate. I also couldn't think of a reason why it would be happening. For now I'm just going to close this PR. If I'm able to replicate or get you some details where Aerials |
Ok @stevearc ! I found an example for you reported by an AstroNvim user! With this file import { GAME_TITLE } from "../../constants/strings";
import { Hamburger, Question } from "../../icons";
import { ReactComponent as TimelineLogo } from "../../icons/Timeline.svg";
import { Button } from "../button/Button";
type Props = {
setIsInfoModalOpen: (value: boolean) => void;
setIsStatsModalOpen: (value: boolean) => void;
setIsDatePickerModalOpen: (value: boolean) => void;
setIsSettingsModalOpen: (value: boolean) => void;
};
export const Navbar = ({
setIsDatePickerModalOpen,
setIsInfoModalOpen,
}: Props) => {
return (
<div className="flex items-center justify-between p-3" >
<Button
variant="secondary"
isIconButton
onClick={() => setIsDatePickerModalOpen(true)}
>
<Hamburger />
< /Button>
< h1 className="flex flex-col items-center gap-2 text-center text-base leading-none dark:text-white" >
{GAME_TITLE} < span className="sr-only" > by Timeline < /span>
< span className="flex items-end gap-1 text-2xs leading-none text-blackAlpha-700 dark:text-whiteAlpha-700" >
by < TimelineLogo width={71} height={10} />
</span>
< /h1>
< Button
isIconButton
variant="secondary"
onClick={() => setIsInfoModalOpen(true)}
>
<Question />
< /Button>
< /div>
);
}; If you go to a line in the
This is not a real Here is a terminal recording showing me replicating the issue: https://asciinema.org/a/q9eAYNw2HVymiNJwH4h0sr7RC I'm not sure how the internals of Aerial work or why that would be popping up where the |
Actually @stevearc I think this might be coming from the treesitter backend. The error goes away once the language server initializes so it's definitely coming from the treesitter provided backend that we have active before the LSP is setup |
Yes, I can confirm that I can replicate this 100% of the time if I disable the |
I think what we want to do is to make sure that we have symbols/icons and highlights for each treesitter node type that is here: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#highlights I have been looking for a better resource for a full list of documented node types for |
Ah shit, this makes sense now. Thank you for coming up with a repro! I have made some mistakes, and I've also allowed some contributions that have had mistakes in the treesitter backend. I'll tighten these up and see if it fixes your issue. |
Thanks so much! Let me know if you want me to do any testing for you as you make changes. Thanks so much for this plugin as well, the support for different backends is incredibly useful for supporting basically every buffer I ever have open :) |
The icon list had several values that are not SymbolKind, they were CompletionItemKind (which we don't need). I've removed those values, and also added nerd font icons for SymbolKinds that didn't have them before.
@mehalter okay, I believe I have fixed the issue and also added checks to make sure it doesn't happen again. Let me know if you still see any problems! |
Awesome, seems to be working perfectly in my quick testing. The AstroNvim community is forever in your debt! |
I noticed that there are some missing default highlight groups. I ran into this while using
require("aerial").get_location(true)
to build a breadcrumbs section in the statusline and some highlight groups were missing.Thanks for all your hard work on this plugin! It's truly a gem!