JetBrains / MPS-extensions

MPS-extensions aims to ease language development within MPS.
https://jetbrains.github.io/MPS-extensions/
Apache License 2.0
82 stars 50 forks source link

Querylist: support model checking #817

Closed alexanderpann closed 5 months ago

alexanderpann commented 6 months ago

Open question:

The feature can be tested here.

slisson commented 6 months ago

The implementation of needsUpdate can be as simple as in AbstractTypesystemEditorChecker and at least that's required. Otherwise, MPS consumes a lot of unnecessary CPU time. I attached a profiler and the repeated execution of the QueryListChecker is the biggest hotspot.

The implementation of QueryListChecker.update is very inefficient. For each node it checks the whole model and then filters the messages for that node. Running the checkers only once per model will already improve the performance a lot and shouldn't be much effort. It should also be possible to check only root nodes instead of the whole model.

Would also be nice if I could disable this feature globally, because of the potential performance issues.

Nodes that are not attached to a model shouldn't even be shown in the editor. At least in earlier MPS version this didn't work.

alexanderpann commented 5 months ago

Nodes that are not attached to a model shouldn't even be shown in the editor.

I enabled this feature a while ago for read-only editors where it is supported. I guess there is still no way that we can make it work with model checking.

slisson commented 5 months ago

I optimized the performance a bit more. Also added actions so that users can disable/enable the model checker themselves.