Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Intellisense for custom web components

I have some web components custom elements, in this case built with StencilJS. They are installed into my solution via an npm package and then included globally in a layout via a script tag.

How can I get Visual Studio to know about these elements and provide intellisense for custom elements + their attributes in .cshtml views?

StencilJS outputs a TypeScript *.d.ts file containing definitions for these elements, as well as additional JSON files describing the elements. Can Visual Studio use either of these?

It seems as though Visual Studio Code can be configured to consume this JSON by adding a reference in the html.customData setting, does Visual Studio have something equivalent?

like image 655
elwyn Avatar asked Nov 16 '22 10:11

elwyn


1 Answers

I think the comment from @Thomas is correct and this is not currently possible:

Looks like it's not possible: github.com/dotnet/aspnetcore/issues/27054 – Thomas

I have raised a suggestion here:

https://developercommunity.visualstudio.com/idea/1244541/intellisense-for-custom-web-components.html?childToView=1245502

edit: marked as duplicate, use this link:

https://developercommunity2.visualstudio.com/t/Visual-Studio-WebComponents-Intellisense/1227195?preview=true

If this is something you'd like to see in Visual Studio, head over and give it a vote so it gets some visibility.

like image 98
elwyn Avatar answered Dec 25 '22 18:12

elwyn