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

Move TextMate scope.terraform to source.terraform #921

Merged
merged 1 commit into from
Feb 7, 2022
Merged

Conversation

jpogran
Copy link
Contributor

@jpogran jpogran commented Feb 4, 2022

This commit changes the TextMate scopeName from scope.terraform to source.terraform inside the Terraform TextMate Grammar file.

The current scopeName for the Terraform TextMate grammar is scope.terraform:

"scopeName": "scope.terraform",

According to the TextMate documentation, the scopename should follow this naming conventions:

scopeName — this should be a unique name for the grammar, following the convention of being a dot-separated name where each new (left-most) part specializes the name. Normally it would be a two-part name where the first is either text or source and the second is the name of the language or document type.

This means we need to change the Terraform scope name to source.terraform.

This should not affect any existing themes or current syntax as themes are targeted towards the most specific token scope, like comment.line.double-slash, and not the language scopeName. Themes would be affected if our scopes were named comment.line.double-slash.terraform and we were changing the terraform part, but we have not named our scopes that way so we are unaffected.

This commit changes the TextMate scopeName from `scope.terraform` to `source.terraform` inside the Terraform TextMate Grammar file.

The current scopeName for the Terraform TextMate grammar is `scope.terraform`: https://github.com/hashicorp/vscode-terraform/blob/59987ae480a970b5955c94260abfa41fccb8577e/syntaxes/terraform.tmGrammar.json#L2

According to the TextMate documentation, the scopename should follow this naming conventions:

> scopeName — this should be a unique name for the grammar, following the convention of being a dot-separated name where each new (left-most) part specializes the name. Normally it would be a two-part name where the first is either text or source and the second is the name of the language or document type.

This means we need to change the Terraform scope name to `source.terraform`.

This should not affect any existing themes or current syntax as themes are targeted towards the most specific token scope, like `comment.line`.double-slash, and not the language scopeName. Themes would be affected if our scopes were named `comment.line.double-slash.terraform` and we were changing the terraform part, but we have not named our scopes that way so we are unaffected.
@jpogran jpogran self-assigned this Feb 4, 2022
@jpogran jpogran added the syntax label Feb 4, 2022
@jpogran jpogran requested a review from a team February 4, 2022 17:42
Copy link
Member

@dbanck dbanck left a comment

Choose a reason for hiding this comment

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

LGTM!

@jpogran jpogran merged commit b1de58d into main Feb 7, 2022
@jpogran jpogran deleted the change_scope_name branch February 7, 2022 13:40
@jpogran jpogran added this to the 2.20.0 milestone Feb 18, 2022
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants