KomodoKomodo integrates GritQL as a Visual Studio Code extension, allowing you to create, preview and run GritQL codemods right from your favourite code editor. In the future, we want to support more codemod runners and programming languages! Requirements
You can install the Grit CLI from NPM:
Alternatively, you can also install Grit with an installation script:
Once you have installed the CLI, you can optionally run Installation GuideTo install Komodo in VS Code, we need vsce (short for "Visual Studio Code Extensions), a command-line tool for packaging, publishing and managing VS Code extensions. You can install it with:
Now, after clonning this repository, you can generate your own On Komodo's root directory, run:
In VS Code
Alternatively, you can run the following command in your terminal:
Once installed, you should notice the Komodo icon in VS Code's Activity Bar (the leftmost pannel, where your Explorer and Search icons are) Current FeaturesCreate GritQL codemods**Search And Replace Queries**: These are the simplest kind of GritQL queries. Match any valid code fragment and replace it with another one. You can also use [GritQL metavariables](https://docs.grit.io/language/patterns#metavariables) **Complex Queries**: If you want to add more specific matching and replacing conditions, you need a complex GritQL query. We provide a text box where you can write your own. Don't forget the backticks (\`...\`) and the arrow operator (`=>`)!Pre-Defined Patterns: Grit allows you to create you own patterns inside of Markdown files ( Example: Markdown file of a codemod that removes Run codemodsTo run any of the queries, just click on the Run button. If you want to run a Pre-Defined pattern, click on its name in the Pre-Defined Patterns tab. After running a codemod, a new VS Code tab will open showing the affected files and lines. You can also click on the file icon alongside these file names to open the complete document. Preview ResultsIf you are unsure of the effects of your codemod, or just want to test it, you may check the Only Preview checkbox. You will notice the same effect as running a codemods, but your files will be unchanged. Supported LanguagesRight now, we support every programming language that GritQL does. From the Grit documentation:
Current Limitations
Additional Links |