-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Add setting to disable automatic YAML file association #1026
base: dev
Are you sure you want to change the base?
Add setting to disable automatic YAML file association #1026
Conversation
While this is a nice option, we should improve the detection on when to enable it... This feels more like a workaround for the problem. |
@frenck - Agreed that this is a workaround and better detection would be great, but I still feel like there should be an option to disable it entirely (ideally default to that behavior being disabled and allow opt-in instead of opt-out). I can't think of any other extension that modifies workspace settings like this, especially creating files when they might not already exist purely for the sake of convenience. Shouldn't need to keep the extension globally disabled and enable per workspace simply to avoid unexpected behavior. Detection is nice and all, but If there's something that you're thinking of that would be a step in a better direction, I'd be happy to modify my PR with the recommended changes. |
I don't agree with that, as it is pretty unique to be |
That's fair if we're parsing the YAML file to check the contents as well! Right now excluding my additions, the fileAssociations section appears to only check if the workspace settings file does not contain a key of There are bits on |
From what I can tell, it looks like the extension is activated for file presence of |
That is correct, I was referring to the fact that it should be improved, not worked around. |
Checking that out! I'm not a TS/JS developer typically, so this should be fun 😄 |
@frenck -- curious if you have some rough implementation guidance here. Seeing your |
I honestly think this is more up into @keesschollaart81 his alley |
Should resolve #961 without changing existing default behavior.
Changes:
vscode-home-assistant.disableAutomaticFileAssociation
(defaults tofalse
).HomeAssistantConfiguration
interface andConfigurationService
class with thedisableAutomaticFileAssociation
property (not currently used, but keeping LS configuration in sync with available configuration options).fileAssociations
section ofextension.ts
with an additional conditional check in theif
statement to read in the new configuration setting.