languageservices
languageservices copied to clipboard
Fix: correct error handling for non-string keys in YAML validation
Description This PR fixes the incorrect error messages that appear when YAML files contain non-string keys (numbers, null, boolean values) in the GitHub Actions VSCode extension. I think the issue is caused by the YAML parser assuming all keys are strings without proper type conversion.
Changes Made
- Modified the YAML parser to properly convert all scalar values to strings before processing
- Replaced the type assertion as string with explicit string conversion using String()
- Added special handling for null values to convert them to empty strings, matching the GitHub Actions runner behavior
- Fixed JavaScript errors like i.indexOf is not a function that occurred with numeric keys
- Ensured boolean keys (true/false) are properly stringified
Fix #185