2019-08-26 12:11:26 -07:00
|
|
|
Playground to test the analyzer plugin for `.moor` files.
|
|
|
|
|
2019-09-18 11:48:44 -07:00
|
|
|
Currently, we support
|
2019-08-26 12:11:26 -07:00
|
|
|
|
2019-09-18 11:48:44 -07:00
|
|
|
- showing errors in moor files
|
|
|
|
- outline
|
|
|
|
- (kinda) folding
|
|
|
|
|
|
|
|
## Setup
|
|
|
|
To use this plugin, you'll need to perform these steps once. It is assumed that you
|
|
|
|
have already cloned the `moor` repository.
|
|
|
|
|
|
|
|
1. Clone https://github.com/simolus3/Dart-Code and checkout the
|
|
|
|
`use-custom-file-endings` branch.
|
|
|
|
2. Run `npm install` and `npm run build` to verify that everything is working.
|
|
|
|
3. Open the forked Dart-Code repo in your regular VS Code installation.
|
|
|
|
4. Press `F5` to run the plugin in another editor instance. All subsequent
|
|
|
|
steps need to be completed in that editor.
|
|
|
|
5. In the settings of that editor, change `dart.additionalAnalyzerFileExtensions`
|
|
|
|
to include `moor` files:
|
2019-08-26 12:11:26 -07:00
|
|
|
```json
|
|
|
|
{
|
2019-09-18 11:48:44 -07:00
|
|
|
"dart.additionalAnalyzerFileExtensions": ["moor"]
|
2019-08-26 12:11:26 -07:00
|
|
|
}
|
|
|
|
```
|
2019-09-18 11:48:44 -07:00
|
|
|
6. Close that editor.
|
2019-09-20 10:31:36 -07:00
|
|
|
7. Uncomment the plugin lines in `analysis_options.yaml`
|
2019-09-18 11:48:44 -07:00
|
|
|
|
|
|
|
## Running
|
|
|
|
After you completed the setup, these steps will open an editor instance that runs the plugin.
|
|
|
|
1. chdir into `moor_generator` and run `lib/plugin.dart`. You can run that file from an IDE if
|
|
|
|
you need debugging capabilities, but starting it from the command line is fine. Keep that
|
|
|
|
script running.
|
|
|
|
2. Re-open the "inner" editor with the custom Dart plugin
|
|
|
|
2. Open this folder in the editor that runs the custom Dart plugin. Wait ~15s, you should start
|
|
|
|
to see some log entries in the output of step 1. As soon as they appear, the plugin is ready
|
|
|
|
to go.
|
|
|
|
|
|
|
|
_Note_: `lib/plugin.dart` doesn't support multiple clients. Whenever you close or reload the
|
|
|
|
editor, that script needs to be restarted as well. That script should also be running before
|
|
|
|
starting the analysis server.
|