-
Notifications
You must be signed in to change notification settings - Fork 83
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
feat: 570 kotlin support #573
base: main
Are you sure you want to change the base?
feat: 570 kotlin support #573
Conversation
… add `simple_kotlin()` test fixes getgrit#570
…ariable-grammar.js' fixes getgrit#570
…ch of places to enable metavariable substitution fixes getgrit#570
…ources/language-metavariables/tree-sitter-kotlin/" fixes getgrit#570
…s/edit_grammars.mjs' script fixes getgrit#570
…PatternLanguage::Kotlin` fixes getgrit#570
…uct and add it to all match statements fixes getgrit#570
ALL_LANGUAGES = re.compile( | ||
r"""\/{51} | ||
\/\/ Constants | ||
\/{51} | ||
const allLanguages = (?P<all_languages>\[ | ||
(\s*"[\w\-]+",\n?)+ | ||
(?P<last_language>\s*"[\w\-]+",) | ||
\])""", | ||
) |
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 should use GritQL for this.
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.
Good point. I don't really know GritQL well enough, yet. Whereas regex, I know all too well 🤣
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.
Thankfully this one is very simple:
`const allLanguages = [$langs]` where { $langs += `"foo"`}
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.
Very nice. Thanks. Might be worthwhile for me to spend a bit of time learning GritQL after this PR then!
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'm just going to add "At least 10 test cases, including rewrites and metavariables." as you mentioned on the issue description. From your perspective, once I do that (assuming they all pass or are fixed as needed) would this PR be ready to merge? Or have I missed something else?
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 think I'd opt to remove this file, since it will potentially require maintenance and doesn't really make things much faster/easier as-is.
…es/lsp and crates/wasm-bindings fixes getgrit#570
Please also add at least one binary/CLI test in |
…n tests as examples of GritQL syntax see https://docs.grit.io/language/syntax
…e some parsing it not happening correctly
…ython-metavariable-grammar with fewer $.grit_metavariable but at 'higher' level fixes getgrit#570
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.
LGTM
61 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
/claim #570
fixes #570
todo:
resources/add_language.py
and run it withpython resources/add_language.py --lang kotlin
edit_grammars.mjs
node ./resources/edit_grammars.mjs kotlin
crates/core/languages/src/kotlin.rs
cargo test --package marzano-language --lib -- kotlin::tests --show-output
PatternsDirectory
struct in crates/gritmodule/src/patterns_directory.rs add it to all match statementscargo test --package marzano-core --lib -- test::simple_kotlin --exact --show-output
Greptile Summary
This is an auto-generated summary
Hi! Looks like you've reached your API usage limit. You can increase it from your account settings page here: app.greptile.com/settings/usage