Commit graph

77 commits

Author SHA1 Message Date
Olivier Goffart
56d592100e Update a few dependencies 2021-10-21 12:24:48 +02:00
Olivier Goffart
ab21dc6462 Move the semantic token code to its own module 2021-08-25 13:30:28 +02:00
Olivier Goffart
11398c19eb First implementation of semantic token in the LSP 2021-08-25 13:26:50 +02:00
Simon Hausmann
01c3347d19 Make fluent the new default style
It's not ugly :-)
2021-08-10 15:56:38 +02:00
Olivier Goffart
b6137ecbc4 Error when trying to use internal builtin items 2021-08-09 17:43:22 +02:00
Tobias Hunger
9dcd107e84 Janitor: Fix clippy::single_match 2021-08-09 13:19:34 +02:00
Tobias Hunger
ce976a1dbb Janitor: Fix clippy::useless_conversion 2021-08-04 22:50:35 +02:00
Tobias Hunger
24a2021226 Janitor: Fix clippy::needless_borrow 2021-08-04 22:50:35 +02:00
Simon Hausmann
235ce85edd Fix warning about unused import
Accidentally missed in #347, amends 742c1eddfd
2021-07-23 13:57:55 +02:00
Simon Hausmann
742c1eddfd Fix alpha detection condition in the color presentation request
It needs to be not 1

Co-authored-by: Olivier Goffart <olivier@woboq.com>
2021-07-23 13:48:52 +02:00
Tobias Hunger
2cdc5848a2 Janitor: Replace float comparison dance with approx_eq from euclid
Sixtyfps uses euclid already, so let's use euclid for float comparisons
as well.

I changed the code to decide whether a number is a positive integer to
make do without a comparison along the way.
2021-07-23 13:48:52 +02:00
Tobias Hunger
27b42687fa Janitor: Fix clippy::redundant_closure 2021-07-23 13:48:52 +02:00
Olivier Goffart
a095d8322e LSP: add a "Show preview" code lense 2021-07-22 09:19:41 +02:00
Olivier Goffart
0766ebbd0d LSP: update the lsp-types crate version 2021-07-22 09:19:41 +02:00
Tobias Hunger
024faa6322 Janitor: Use float comparison dance
Color values can be calculated, so do the full comparison dance instead
of doing the bitwise comparison.
2021-07-12 15:01:19 +02:00
Tobias Hunger
88b8634007 Janitor: Remove useless drop
This was dropping a referrence, which is a no-op. So remove this drop.
2021-07-12 15:01:19 +02:00
Olivier Goffart
13bd828b96 Update license date 2021-07-02 15:55:54 +02:00
Olivier Goffart
ffb0a9881b Add command line arguments to the LSP
To set the include path, the style, or the backend
2021-06-09 17:15:49 +02:00
Olivier Goffart
6c1aa9bd8f Add a pass to always have the top level as a Window 2021-06-09 11:02:55 +02:00
Olivier Goffart
8ecc834333 LSP: forward the diagnostic from the preview to the editor
Because the preview might have more diagnostics.
2021-05-18 16:12:30 +02:00
Olivier Goffart
fd2f8eb3fb Make sure to make the UI thread also exit when the LSP server panics 2021-05-07 11:54:30 +02:00
Olivier Goffart
3ebeb1654c LSP: don't advertize things we don't support 2021-05-07 11:15:09 +02:00
Simon Hausmann
7240f5c5e9 Fix loading of relative paths on Windows
We use std::fs::canonicalize() and that may produce paths like

    `\\\\?\\C:\\foobar\\baz.60`

where the leading `\?` disables all parsing.

When `baz.60` imports another `.60` file using a relative path `../fob.60`,
we call `Path::join()`, which really just appends strings, producing

    ``\\\\?\\C:\\foobar\\../fob.60`

When calling `canonicalize()` again on this path, the function fails,
because any parsing was disabled,
so neither the forward slash nor the .. are resolved.

So while the forward slash handling could be solved with `components()` we
still run into

    https://users.rust-lang.org/t/unable-to-parse-relative-directories-in-windows-unc-paths/8164

To circumvent all this, use the dunce crate to canonicalize in a way on Windows
that avoids UNC paths.
2021-04-27 11:02:23 +02:00
Olivier Goffart
f620351cbf Go to definition of structs
Also add the struct in the outline
2021-04-24 15:06:58 +02:00
Olivier Goffart
f0050c2a08 LSP: add outline 2021-04-24 15:06:58 +02:00
Olivier Goffart
847f3b26e4 Hide internal type in auto-completions 2021-04-23 15:06:37 +02:00
Olivier Goffart
5f15c9b363 LSP: goto definition on a "PREVIEW" comment will show the preview 2021-04-23 14:45:48 +02:00
Olivier Goffart
dc7a782fd5 LSP: don't advertize things we don't support 2021-04-22 20:15:07 +02:00
Simon Hausmann
e6d8f0c900 lsp: Provide a simple implementation of the color representation request
This allows conveniently picking colors through the color picker, for recognized
color literals.
2021-04-20 11:23:55 +02:00
Olivier Goffart
59654472d2 LSP: color providers 2021-04-18 23:27:14 +02:00
Olivier Goffart
63844a5907 LSP: auto-completion in paths
For import and @image
2021-04-18 15:16:12 +02:00
Olivier Goffart
80e92e3ed5 LSP: Use snippets for keyword completion 2021-04-18 13:14:41 +02:00
Olivier Goffart
06f2223bb2 LSP: move code around 2021-04-17 12:50:47 +02:00
Olivier Goffart
131f4d6682 LSP: Improvements on complete ergonomics 2021-04-17 08:57:42 +02:00
Olivier Goffart
deaaef8cd3 LSP Preview: detect if the component to preview is a Window
Then we don't need to wrap Window in Window
2021-04-16 11:34:21 +02:00
Olivier Goffart
546d4aa689 LSP: completion of property names in binding
If there is already a ':' or a '=>'
2021-04-16 11:34:21 +02:00
Olivier Goffart
fe14099af9 Go to definition of callback connection and two ways binding 2021-04-16 09:23:44 +02:00
Olivier Goffart
702b3fc67a Jump to definition of a property 2021-04-16 08:59:33 +02:00
Olivier Goffart
4ce2929b34 LSP: Move the completion code to its own module 2021-04-16 07:59:16 +02:00
Olivier Goffart
bcce36385d LSP: code action to preview a particular component 2021-04-15 18:55:57 +02:00
Olivier Goffart
0e69ac1036 LSP: Auto complete the class names 2021-04-14 19:19:51 +02:00
Olivier Goffart
a3d29c6ba0 LSP: Jump to definition when the cursor is in a import statement 2021-04-14 18:50:12 +02:00
Olivier Goffart
130cc22207 LSP: fix completion or go to symbol of the file url constains special characters
such as space or so.
We were not decoding the URL properly if the URL was encoded
2021-04-14 18:09:44 +02:00
Olivier Goffart
9ce63b80b9 VS extension: Add a status bar bar item with status of the preview 2021-04-14 15:01:25 +02:00
Olivier Goffart
84e0b24550 Some refactoring of the syntax_nodes module
Ensure that the node always contains the write kind by panicking
if it doesn't.

Add some documentation for the macro that declares them
2021-04-14 11:46:49 +02:00
Olivier Goffart
7a65f31cc1 the source_file is not optional 2021-04-13 17:26:24 +02:00
Olivier Goffart
84501e630a Rename SyntaxNodeWithSourceFile to SyntaxNode
Same for SyntaxToken
2021-04-13 17:10:56 +02:00
Olivier Goffart
bc757d2367 LSP: disable the debug tooltip 2021-04-12 19:54:50 +02:00
Simon Hausmann
ae5eb7b24a Fix updates of the preview on Windows
Use the same cannonical path for `preview::load_preview` and `preview::set_contents`.
Rust's `cannonicalize()` function produces a UNC path, so it's important to use
on both call sites to that we can find the same doc.
2021-04-09 17:56:49 +02:00
Simon Hausmann
5e8b738b70 Don't automatically show the preview window when reloading
When the user closes the window explicitly, don't make it suddnely pop up again when editing the .60.
2021-04-09 10:32:03 +02:00