We still get some updates from the editor that we do not really need
anymore, but we also get updtaes from the LSP now.
This fixes e.g. the property value being out of sync right after you
changed it in the property editor.
After checking if the instance field is null, we await the promise that
would guarantee DOM attachment. While we await, the browser processes
other microtasks, and we might end up in render() again. This time the
instance field is also null, but the ensure_attached_to_dom promise is
already resolved, so we would create the first slint component and the
associated window. Later we would return from the first await. At this
point the instance field is already set, so we should re-use the
existing window, but since we're not checking anymore, we'll go ahead
and create a second window on the same canvas element.
Fixes#1926
Do not interact with the language server directly in vscode, but use
vscode.commands.executeCommand(...) instead. The online_editor will of
course need to continue to interact with the language server directy, so
this unshares a bit of code. It is not too much and straight forward
code, so that is not too bad.
* Tools: trigger updates for properties view more often
So far you had to move the cursor to refresh the properties view after
start-up. This is no longer necessary.
Put the shared code into an NPM package. This makes especially vscode
much happier as it does not need to build code outside its project root
anymore:-)
For Ninja builds we instruct the compiler to generate a dependency file.
This would include paths like builtin:/native/../common/slint-logo-light.svg,
which my version of Ninja on Windows doesn't like at all and just flat out aborts on.
It doesn't make sense for us to emit those as dependencies, so this patch excludes
builtin paths.
... which includes the document service for a couple of commits now.
This improves the update, decouples the properties from the editor
widget and makes the proerties widget more similar to the outline
widget.
This works around the setBinding calling back into the client, which
would cause the LSP to panic as there already was a mutable reference to
the document cahce held.
I was using the editor positions/ranges before, but converting between
LSP and editor values requires having the text at hand as we need to map
from utf-8 to utf-16 based numbering.
This forced all the LSP operations to happen in the editor itself, and
the editor exposing interfaces for the other parts of the online editor
to use. I plan to de-emphasize the editor for the LSP going forward, so I
need to switch out the addressing being used.