shannonhochkins/ha-component-kit

InteliSense stopped picking up generated types after upgrade from 1.0.12 to 13

Closed this issue · 9 comments

Changing versions back and forth, .13 stops displaying completions for me, it works in .12. New version still errors when the invalid entity is passed, it's just the completion that stopped showing up. I'm working in PyCharm – basically WebStorm with Python support.
Tried invalidating caches, changing configuration, but it seems to be because of the library
Maybe you know something that might have caused it.

I do test thoroughly before I deploy, sometimes it's easy to miss things, when you create an issue can you please be a bit more detailed? What does your tsconfig look like? Does your generated type file have everything inside it? Have you tried restarting the ts server? Restarting vscode?

I have setup types correctly for lights / climates, but that's it currently - in the home assistant gihub repository, they have custom types for each entity type by domain, eg here: https://github.com/home-assistant/frontend/blob/155e9d9e95a85a3bb555f238fadd2c00ca7d3d69/src/data/alarm_control_panel.ts#L27

I have looked at potentially scraping and pulling theese from the github repository, however haven't found a nice solution for this yet as they're not named consistently, but i will do some further digging

Okay then, if it works all well for you. If someone has the same issue, I found a workaround – copying the generated entity names into the index.d.ts file in linked local @hakit/core
Works good enough, I won't burden you with that then as we have different IDEs, and debugging types linking being now in new (better, but somehow not liked by JetBrains IDE) format you upgraded to is pain

It still may help to see your setup yo enderatand what night be causing you to have issues mate!

sure, you can see my setup here https://github.com/yep-dev/ha-react-dashboard
so again, the only change I was doing was changing the @hakit/core version and installing it back and forth that caused it to lose those completions, but that could be because my setup or IDE can't accommodate the changes

I will check this out a little later and see if I can spot anything!

you mentioned:

format you upgraded to is pain

Why is it a pain?

I setup a completely new fresh test and it's all working with intellisense, I don't believe there's anything wrong with the types, I also checked out your repo and ran the type sync and intellisense and type validation is working fine so I'd say it is something to do with your IDE, bit hard to replicate unfortunately

debugging types linking being now in new (better, but somehow not liked by JetBrains IDE) format you upgraded to is pain

I meant that debugging [stuff not liked by my IDE] (that just happens to be the new format) is pain

the mian difference i can see, is that at the bottom of the old types, there was a large export list re-exporting every type, the only thing i can think of is that for some reason your IDE isnt picking uop the types because of this, but i dont think so...