Language server with nvim: should typed Props be visible in hover definition? #931
-
Hello! As always with my nvim setup, I can never tell if I'm using it wrong, or if the LS doesn't have a feature. I'm pretty bad at configuring things 😅 Overall, my hover definition for astro components leaves something to be desired: and I'm not sure if that's a me problem, or a LS problem I have a layout with: ---
interface Props {
// `title` of a page is the HTML title attribute, and is more specific than `heading`
title: string;
// `description` is the HTML meta description attribute
description: string;
// `heading` is the <h1> of the page and usually less descriptive than `title`
heading?: string;
}
const { title, description, heading } = Astro.props;
--- And use it with: ---
import Layout from "@layouts/default.astro";
---
<Layout title="Hello, World!" description="Home Page">
<h1>Hello, world!</h1>
</Layout> Hovering over the (alias) function Layout(_props: Props): any
import Layout (and my tsconfig.json is: {
"extends": "astro/tsconfigs/strictest",
"compilerOptions": {
"verbatimModuleSyntax": true,
"baseUrl": ".",
"paths": {
"@layouts/*": ["src/layouts/*"]
}
}
} ) https://docs.astro.build/en/guides/typescript/#component-props suggests that more advanced typing comes from the VSCode plugin, but I'm not sure if that's just from the LS or what. Do I have something wrong, and I should see my specific props in the hover definition? Or is this what the LS offers? What's interesting, if I ask autocomplete what the LS knows, I do see my props, so the LS does seem to know the exist (although it doesn't include the comment/docstring?) Appreciate any lessons learned here! I didn't want to file an issue since I assume it's my fault. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
At this time it is intended that it just shows Props, yes! Your comments are not JSDoc, that's why they don't show (you need |
Beta Was this translation helpful? Give feedback.
At this time it is intended that it just shows Props, yes!
Your comments are not JSDoc, that's why they don't show (you need
/**
style comments)