Handle warnings in diagnostics

For the new LSP, we handle errors, but not warnings.

If there are any other leftovers for the diagnostics that should be done, feel free to use this issue too.

Acceptance criteria

  • Warnings are handled in diagnostics.
  • We add diagnostic tests.