This is a hacky approach, but does help a lot with the tedious fixes.
See https://rust-lang.github.io/rust-clippy/master/index.html#/unnecessary_map_or
```
__CARGO_FIX_YOLO=1 cargo clippy --fix --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::unnecessary_map_or
cargo fmt --all
```
Updated the version from 1.1 to 1.2
Renamed the header to "Slint Royalty-free Desktop, Mobile, and Web Applications License"
Added definition of "Mobile Application" and grant of right
Moved "Limitations" to 3rd section and "License Conditions - Attributions" to 2nd section
Added flexibility to choose between showing "MadeWithSlint" as a dialog/splash screen or on a public webpage
Moved the para on copyright notices to section under "Limitations"
Semi-random selection of clippy topics that were
uncontroversial before:-).
Leaves about 84 deduplicated issues in the code base
according to clippy from nightly.
The preview can not leave it up to the interpreter to handle element selection
and highlighting. So add new functions to the interpreter (behind the
"highlight" feature-gate) to query positions of elements.
This exposes some of the code that is used by the existing highlighting code
and extends it where needed.
Two use-cases need to be covered:
1. Query the positions of a component (given by source file path and offset).
This is then used to highlight all occurences of a component as the
cursor position in a source file changes.
2. Query the position of an element (given as `ElementRc`).
This is used when selecting elements in the UI. We need to work at
the element level for this, not at the component level.
Also make the `highlight` module public but feature-gated, so that we
can put helper-types there.
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 includes slint-viewer, slint-interpreter (when loading path, not
string), slint-compiler.
(This would also include internal things such as
`import { Xxx } from "foo.rs"`, if we didn't check for .slint or .60
extension before)
But that doesn't include anything that's not opening the source by path
(so not the lsp which use its own representation coming from the editor,
or varius tools like the updater and fmt which also open the files
themselves)
Commit 893983e8d3 "fixed" it to be 0 based as it was
documented. But that's a change of behavior so restore the previous behavior and
document it properly
* compiler: Make mapping from source offset to line/column more reusable
* compiler: Improve mapping of offset to line/column
* Fix unit tests after line mapping update
* interpreter: Add code to have a element picker mode
* slintpad: Add picker mode to the preview
* slintpad: Do not try to highlight "empty" highlight requests
* Slintpad: Cycle through all the possible elements in design mode
* Slintpad: Ignore builtins and eat less clicks
* Slintpad: Highlight the element selected in design mode
* Slintpad: Do not use static mut variable in design mode
* slintpad: Rename `set_current_element_information_callback`
* Interpreter: Do not use unsafe in design mode code
Done with: @ogoffart and @tronical
Move "internal" crates into the `internal` directory. This first batch
includes most of sixtyfps_runtime but leaves the rendering backends
alone for now.
pre-commit applied some cleanups to the moved files:
- Consistent newline at end of file policy
- trimming trailing whitespace
- Formatting Cargo.toml files.
2022-01-31 16:00:50 +01:00
Renamed from sixtyfps_compiler/diagnostics.rs (Browse further)