Skip to content
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

Fix schema resolution using Samba share on Windows #3313

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

edoren
Copy link

@edoren edoren commented Dec 1, 2024

Hello!

While using this extension via the Samba share addon on Windows I noticed that the schemas were not working properly, in the logs I noticed that only the first backslash was being replaced and this was triggering the issue in the schema resolution of yaml-language-server:

Applying schemas to 10 of your configuration files...
Assigning /%5C192.168.1.102%5Cconfig%5Cconfiguration.yaml the configuration.yaml schema
Assigning /%5C192.168.1.102%5Cconfig%5Cautomations.yaml the configuration.yaml/automation schema
Assigning /%5C192.168.1.102%5Cconfig%5Cautomations.yaml the configuration.yaml/automation schema
Assigning /%5C192.168.1.102%5Cconfig%5Cscripts.yaml the configuration.yaml/script schema
Assigning /%5C192.168.1.102%5Cconfig%5Cscenes.yaml the configuration.yaml/scene schema
Assigning /%5C192.168.1.102%5Cconfig%5Cbinary_sensor.yaml the configuration.yaml/binary_sensor schema
Schemas updated!

I also saw this comment from someone that had a similar issue. After this change the entry is registered properly and the schemas work:

Applying schemas to 10 of your configuration files...
Assigning //192.168.1.102/config/configuration.yaml the configuration.yaml schema
Assigning //192.168.1.102/config/automations.yaml the configuration.yaml/automation schema
Assigning //192.168.1.102/config/automations.yaml the configuration.yaml/automation schema
Assigning //192.168.1.102/config/scripts.yaml the configuration.yaml/script schema
Assigning //192.168.1.102/config/scenes.yaml the configuration.yaml/scene schema
Assigning //192.168.1.102/config/binary_sensor.yaml the configuration.yaml/binary_sensor schema
Schemas updated!

Copy link
Collaborator

@frenck frenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi there @edoren 👋

The CI is failing, could you please take a look?

Thanks! 👍

../Frenck

@edoren
Copy link
Author

edoren commented Dec 11, 2024

It seems replaceAll is part of es2021, I can do the change to update it on the tsconfig.json, but before that, is there any reason why es2020 is still used?

@frenck
Copy link
Collaborator

frenck commented Dec 12, 2024

@edoren I wish I could tell you :) I'm not a JS developer at all.

../Frenck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants