mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
compiler: Store an optional version number with the document
A None value means the file on disk is the golden version. We have an editor, the LSP and the preview that all need to at least notice when they have newer data then their peers. So IMHO it makes sense to have an optional document version around. The language server protocol makes use of a version number already. This patch moves that code into the compiler so that it is stored with the actual data getting versioned.
This commit is contained in:
parent
dc536ac599
commit
d785f2d5df
20 changed files with 116 additions and 52 deletions
|
@ -22,7 +22,7 @@ use crate::typeregister::TypeRegister;
|
|||
/// At this point, it really should already contain the basic Types (string, int, ...)
|
||||
pub(crate) fn load_builtins(register: &mut TypeRegister) {
|
||||
let mut diag = crate::diagnostics::BuildDiagnostics::default();
|
||||
let node = crate::parser::parse(include_str!("builtins.slint").into(), None, &mut diag);
|
||||
let node = crate::parser::parse(include_str!("builtins.slint").into(), None, None, &mut diag);
|
||||
if !diag.is_empty() {
|
||||
let vec = diag.to_string_vec();
|
||||
#[cfg(feature = "display-diagnostics")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue