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
|
2019-09-24 11:50:23 -07:00
|
|
|
- folding
|
|
|
|
- (very, very limited) autocomplete
|
|
|
|
- some quickfixes to make columns nullable or non-null
|
2019-10-01 08:58:17 -07:00
|
|
|
- navigation for references in sql queries
|
2019-09-18 11:48:44 -07:00
|
|
|
|
|
|
|
## Setup
|
2019-10-01 08:58:17 -07:00
|
|
|
To debug this plugin, you'll need to perform these steps once. It is assumed that you
|
2019-09-18 11:48:44 -07:00
|
|
|
have already cloned the `moor` repository.
|
|
|
|
|
2019-10-01 08:58:17 -07:00
|
|
|
1. Make sure you run version `3.5.0` or later of the Dart extension in VS Code.
|
|
|
|
2. In the editor settings, change `dart.additionalAnalyzerFileExtensions`
|
2019-09-18 11:48:44 -07:00
|
|
|
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-10-01 08:58:17 -07:00
|
|
|
3. 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.
|
2019-10-01 08:58:17 -07:00
|
|
|
2. Open this folder in the code instance
|
|
|
|
3. 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.
|
2019-09-18 11:48:44 -07:00
|
|
|
|
|
|
|
_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.
|
2019-10-01 08:58:17 -07:00
|
|
|
|
|
|
|
## Troubleshooting
|
|
|
|
|
|
|
|
If the plugin doesn't start properly, you can
|
|
|
|
|
|
|
|
1. make sure it was picked up by the analysis server: You set the `dart.analyzerDiagnosticsPort`
|
|
|
|
to any port and see some basic information under the "plugins" tab of the website started.
|
|
|
|
2. When setting `dart.analyzerInstrumentationLogFile`, the analysis server will write the
|
|
|
|
exception that caused the plugin to stop
|