Commit graph

16 commits

Author SHA1 Message Date
Tobias Hunger
cf1984f544 compiler: Add a test for mapping offset to/from line/column
... in SourceFile. Let's hope that this will finally make sure that
this works properly!
2023-04-27 21:07:26 +02:00
Tobias Hunger
31147fecd7 compiler: Fix mapping from offset to line/column in SourceFile 2023-04-27 21:07:26 +02:00
Tobias Hunger
bb3109443a compiler: Allow mapping from line/column to offset
Add a method to the SourceFile so that we can map back from line/column
values to offsets.
2023-04-27 21:07:26 +02:00
Olivier Goffart
4076df928d Fix panic when getting the line, column of diagnostic with invalid span
Introduced in cbc0c790a3
2023-04-19 12:35:17 +02:00
Olivier Goffart
cbc0c790a3 Make Disagnostice::line_colunm 1 based
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
2023-04-19 11:02:33 +02:00
Tobias Hunger
893983e8d3
Slintpad: Add picker mode where you can click on something in the preview and the editor focuses on that (#2567)
* 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
2023-04-18 23:11:08 +02:00
Olivier Goffart
8cefde7c3a Remove space before => in quote_spanned
That's the style encouraged by the documentation
2023-03-24 11:14:48 +01:00
Olivier Goffart
20973bdb7b Report warnings from the slint! macro 2023-03-24 11:14:48 +01:00
Tobias Hunger
3ac01c3f07 clippy: Fix clippy warnings 2023-03-09 09:35:29 +01:00
Olivier Goffart
a0d057b8b8 Enable the new syntax by default 2023-01-07 14:18:10 +01:00
Simon Hausmann
7122d22c88 janitor: use the new default attribute for enums 2022-12-05 10:20:39 +01:00
Olivier Goffart
c1c52a2b86 Make the test pass without defining the SLINT_EXPERIMENTAL_SYNTAX env variable 2022-11-21 22:01:52 +01:00
Olivier Goffart
81b53e2ae0 LSP: fetch the file content from cache instead of from disk to compute the line number
Otherwise it doesn't work with the web extension. And the file must anyway be in the cache
2022-06-02 21:45:50 +02:00
Tobias Hunger
4230ac2572
Update copyright information to reflect name change
Also run resue over the codebase and fix complaints from that tool.
2022-02-09 10:27:47 +01:00
Olivier Goffart
03534039d6 Replace more .60 by .slint
Mainly an automated change with
    git grep -O"sed -i 's/\.60/.slint/g'" -w "\.60"

and some manual checks
2022-02-02 10:12:31 +01:00
Tobias Hunger
e6b24bceec [reorg]: Set up and populate the internal directory
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)