-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Add 'gel' extension and alias to EdgeQL #7401
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow the instructions in CONTRIBUTING.md for adding a new extension. Please also use and correctly complete the PR template… it's there for a reason.
@lildude, sincere apologies for not following the process. As an open source maintainer myself I should have had better judgement. We've updated the commit / PR message, please take another look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend replacing your one-liner samples with more representative examples as they're used to train the classifier and very small samples are known to cause incorrect results.
- extensions: ['.gel'] | ||
rules: | ||
- language: EdgeQL | ||
pattern: | ||
# We definitely want the match unicode characters as part of the \w | ||
- '(?i:^\s*using\s+(extension|future)[^\n]*?;)' | ||
- '(?iu:^\s*module\s+(\w+|`.+?`)\s*\{)' | ||
- '(?iu:^\s*abstract\s+(inheritable\s+)?annotation\s+(\w+|`.+?`)::(\w+|`.+?`))' | ||
- '(?iu:^\s*abstract\s+(constraint|index|link|property)\s+(\w+|`.+?`)::(\w+|`.+?`))' | ||
- '(?iu:^\s*(alias|function)\s+(\w+|`.+?`)::(\w+|`.+?`))' | ||
- '(?iu:^\s*(optional|required|single|multi)?\s*global\s+(\w+|`.+?`)::(\w+|`.+?`))' | ||
- '(?iu:^\s*(abstract\s+)?(scalar\s+)?type\s+(\w+|`.+?`)::(\w+|`.+?`))' | ||
negative_pattern: | ||
# Check for common comments that are invalid in EdgeQL. | ||
# | ||
# The caveat is that they technically would be legal inside string | ||
# literals, but it is extremely unlikely to have such string literals in | ||
# the Gel schema (i.e. appearing as defaults or annotations). However, to | ||
# reduce the possibility of false positives here we also restrict illegal | ||
# comment detection to the beginning of a line. | ||
- '^\/\/.+$' | ||
- '^\/\*.*?\*\/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unnecessary as this is the only language associated with the .gel
extension so we'll never get to the heuristics.
- extensions: ['.gel'] | |
rules: | |
- language: EdgeQL | |
pattern: | |
# We definitely want the match unicode characters as part of the \w | |
- '(?i:^\s*using\s+(extension|future)[^\n]*?;)' | |
- '(?iu:^\s*module\s+(\w+|`.+?`)\s*\{)' | |
- '(?iu:^\s*abstract\s+(inheritable\s+)?annotation\s+(\w+|`.+?`)::(\w+|`.+?`))' | |
- '(?iu:^\s*abstract\s+(constraint|index|link|property)\s+(\w+|`.+?`)::(\w+|`.+?`))' | |
- '(?iu:^\s*(alias|function)\s+(\w+|`.+?`)::(\w+|`.+?`))' | |
- '(?iu:^\s*(optional|required|single|multi)?\s*global\s+(\w+|`.+?`)::(\w+|`.+?`))' | |
- '(?iu:^\s*(abstract\s+)?(scalar\s+)?type\s+(\w+|`.+?`)::(\w+|`.+?`))' | |
negative_pattern: | |
# Check for common comments that are invalid in EdgeQL. | |
# | |
# The caveat is that they technically would be legal inside string | |
# literals, but it is extremely unlikely to have such string literals in | |
# the Gel schema (i.e. appearing as defaults or annotations). However, to | |
# reduce the possibility of false positives here we also restrict illegal | |
# comment detection to the beginning of a line. | |
- '^\/\/.+$' | |
- '^\/\*.*?\*\/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've included the heuristics largely because we've found a lot of .gel
files that have nothing to do with our database schema (https://github.com/search?type=code&q=NOT+is%3Afork+path%3A*.gel has ~1.8K code hits). So we didn't think it would be appropriate to target all .gel
files indiscriminately.
If you're saying that regardless of that intent, this is not how the heuristics work and would not help there, we can remove them, of course.
EdgeDB got recently renamed to Gel [1]. The schema language extension changed from `.esdl` to `.gel`. This PR adds `.gel` as a recognized file extension and `gel` as a recognized code-block language selector. [1] https://www.geldata.com/blog/edgedb-is-now-gel-and-postgres-is-the-future
I've added a more representative example. It's still synthetic, but it's based much more closely on actual real schema files. |
Description
EdgeDB got recently renamed to Gel [1]. The schema language extension changed from
.esdl
to.gel
. This PR adds.gel
as a recognized file extension andgel
as a recognized code-block language selector.[1] https://www.geldata.com/blog/edgedb-is-now-gel-and-postgres-is-the-future
Checklist:
.esdl
(https://github.com/search?type=code&q=NOT+is%3Afork+path%3A*.esdl). The new extension (taking heuristics into account) is currently ~95 hits in the search, though.