keesschollaart81 / vscode-home-assistant

Visual Studio Code Extension for Home Assistant. ⭐ if you think this is cool!
MIT License
551 stars 117 forks source link

FR: Mark non-existing entities #251

Open andriej opened 4 years ago

andriej commented 4 years ago

Lately I've ran in "let's clean up some things" mood and I've found out that my .yaml's contain a lot of non-existant (anymore) entities. Example? Recorder's include/exclude list of particular entities - some of them are like 30 versions of HA old.

Would be great feature to have those entities that does not exist in HA marked-down/underlined, so any further edit of files will not leave them behind.

bieniu commented 4 years ago

Yeah, such feature is missing a lot.

keesschollaart81 commented 4 years ago

It's indeed an awesome idea I could use myself as well! Thanks! I'm not sure if I can/will build this in the next couple of weeks but I leave the issue open as I really want to have this and build it some time!

phixion commented 4 years ago

came here to request the same. I think .storage/core.{entity,device}_registry holds the relevant information

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

andriej commented 4 years ago

I think it's still worth keeping open :-)

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

andriej commented 4 years ago

Still :-)

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

andriej commented 4 years ago

Still valid

phixion commented 4 years ago

@keesschollaart81 thank you

ThomDietrich commented 2 years ago

Is there any activity or update on this? Feels like one of the most relevant missing features for the otherwise great extension. Thanks

frenck commented 2 years ago

@ThomDietrich Nope! Feel free to contribute it.

ThomDietrich commented 2 years ago

JS/TypeScript is my weak spot 🙈 zero experience but Hey, just yet another programming language 😄

Would you be able to share how difficult this task might be and which risks you see? Would be useful for me and maybe for anyone else listening

frenck commented 2 years ago

Would you be able to share how difficult this task might be and which risks you see?

I am not able to judge that.

kubawolanin commented 2 years ago

I was looking at this issue and would like to help implementing this. Once we finalize #1880 to a mergeable form, it should be fairly easy to access entities on the extension level. It even might be a contribution point on the language server side (diagnostics?).

Implementation-wise: When onDocumentChange event is triggered, we'll need to iterate over all entity-like strings in the opened document, and then compare them with a list of available/subscribed entities. If a match is not included in the list, return a warning.

ThomDietrich commented 2 years ago

Hey Kuba, so delighted to see you again after all these years! Sounds like a plan 🚀 Thanks for #1880 which looks great and for considering the ticket here.

kubawolanin commented 2 years ago

I made some progress today 💪🏻 image