Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Remove '---' from firstLineMatch#118

Open
sgpinkus wants to merge 1 commit intoatom:masterfrom
sgpinkus:patch-1
Open

Remove '---' from firstLineMatch#118
sgpinkus wants to merge 1 commit intoatom:masterfrom
sgpinkus:patch-1

Conversation

@sgpinkus
Copy link

@sgpinkus sgpinkus commented Jun 4, 2022

Description of the Change

Remove '---' from firstLineMatch. There is no need for it. It is actually a hindrance rather than help because it gobbles up a possible way for YAML sub languages (like Ansible playbooks) to override language-yaml grammar choice. For example they language-ansible could use --- # ansible or similar but this is not possible because language-yaml matches everything using the document separator on first line. Also I can think of at least one other file type that starts with "---" by convention (Jekyll .md templates) so starting with '---' is not very YAML specific.

Alternate Designs

Could do 'firstLineMatch': '^(#cloud-config|---)\s*$' but I don't see any benefit to that.

Benefits

As described above: Allow other yaml based grammars to use --- in their firstLineMatch.

Possible Drawbacks

Will break detection of files that are yaml, start in '---' but don't use one of the numerous file extension matches listed.

There is no need for it. It is actually a hindrance rather than help because it gobbles up a possible way for YAML sub languages (like Ansible playbooks) to override language-yaml grammar choice. For example they `language-ansible` could use `--- # ansible` or similar but this is not possible because language-yaml matches *everything* using the document separator on first line. Also I can think of at least one other file type that starts with "---" by convention (Jekyll .md templates) so starting with '---' is not very YAML specific.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant