Skip to content

Add implements and signature to syntax highlighting#1468

Merged
dbartol merged 2 commits intogithub:mainfrom
dbartol:dbartol/pmod-highlight/work
Aug 23, 2022
Merged

Add implements and signature to syntax highlighting#1468
dbartol merged 2 commits intogithub:mainfrom
dbartol:dbartol/pmod-highlight/work

Conversation

@dbartol
Copy link
Copy Markdown
Contributor

@dbartol dbartol commented Aug 23, 2022

This PR adds syntax highlighting for the new, still-experimental "parameterized modules" feature in the QL language.

signature is added as an "annotation keyword", highlighted only if it appears before a module, class, or predicate declaration. implements is added as a context-sensitive keyword, available only within a module defintion (but outside the module body).

@dbartol dbartol requested a review from a team as a code owner August 23, 2022 19:02
@dbartol dbartol added bug Something isn't working Complexity: Low A good task for newcomers to learn, or experienced team members to complete quickly. labels Aug 23, 2022
Copy link
Copy Markdown
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

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

Hmmm...signature is working as expected, but implements is not. Is something wrong with this syntax?

_Extension_Development_Host__definitions_ql_—_vscode-codeql-starter__Workspace_●

- match: '(?#simple-id)'
name: entity.name.type.namespace.ql

# The `extends` clause of a class definition.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
# The `extends` clause of a class definition.
# The `implements` clause of a class definition.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Doesn't implements only apply to modules?

Copy link
Copy Markdown
Contributor Author

@dbartol dbartol Aug 23, 2022

Choose a reason for hiding this comment

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

(I admit that would have been more apparent had I remembered to change the comment...)

Copy link
Copy Markdown
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

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

Ah...yes. That works now. Thanks.

@dbartol dbartol merged commit d1d48b3 into github:main Aug 23, 2022
@dbartol dbartol deleted the dbartol/pmod-highlight/work branch August 23, 2022 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Complexity: Low A good task for newcomers to learn, or experienced team members to complete quickly.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants