Commit graph

17 commits

Author SHA1 Message Date
Olivier Goffart
28ae8f7bc4 Refactoring: split ElementType away from the types used as property type
These are two different concept, and it is confusing to keep them in the
same enum

We want to support component without any base element, and Void is
already used for global component, so do this refactoring before
2022-10-26 14:50:44 +02:00
Olivier Goffart
8f03e2cff1 WIP: make the vscode extension work as web extension
This refactor the LSP to be possible to compile for wasm.
When using wasm we can't use the lsp-server crate because that one use the
stdin/stdout to communicate.
Instead, we need will do the communication in TypeScript using the vscode
language server protocol library, and serialize the types to wasm. Fortunately
that's easy because the lsp-types crate contains all the serialized types.

This also "duplicate" the extension as a web extension that do not use process
to start the LSP, but use a web worker. Some of the extension code could
be refactored to avoid some duplication (like the status bar handling and such).
And add a "browser" entry point in the package.json

Finally, add a browserServerMain.ts entry point for our worker, it will try to load
the wasm code.

Currently this doesn't wirk: the browserServerMain.ts can't load the wasm.

Also todo is to write the code so that the wasm code can send the response and
notifications.

To debug, I type these commands in editor/vscode directory

    npm run compile-web
    code --extensionDevelopmentKind=web --extensionDevelopmentPath=$PWD   ../..
2022-05-31 17:44:56 +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
Tobias Hunger
de4e195280
Rename internal crates and add a README.md to them
The README.md contains the warning that used to be in lib.rs.

Add README.md files to all internal crates

... pointing to the official public crate to use instead.

Rename internal crates

fixup: README files

fixup rename
2022-02-07 13:12:48 +01:00
Simon Hausmann
cab22f8355 Rename the sixtyfps-compilerlib crate 2022-02-01 18:08:18 +01:00
Tobias Hunger
bfca0e3573 Mass update copyright messages to be more REUSE compliant 2021-12-22 10:06:12 +01:00
Olivier Goffart
639c358896 Refactor the LookupResult
Separate Enumeration and Expression, so get rid of the isize::MAX hack
And this will allow having more non-expression results (eg: namespaces)
2021-12-08 16:35:11 +01:00
Tobias Hunger
4c7ecc57d8 Janitor: Fix clippy::or_fun_call 2021-08-04 22:50:35 +02:00
Tobias Hunger
24a2021226 Janitor: Fix clippy::needless_borrow 2021-08-04 22:50:35 +02:00
Tobias Hunger
5cf23f102e Janitor: Fix clippy::redundant_pattern_matching 2021-08-04 22:50:35 +02:00
Olivier Goffart
13bd828b96 Update license date 2021-07-02 15:55:54 +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
59654472d2 LSP: color providers 2021-04-18 23:27:14 +02:00
Olivier Goffart
3f3a4c4ec9 Store the actual property declaration node
so that the goto definition can go to the right location
2021-04-18 14:19:38 +02:00
Olivier Goffart
41057c9e55 LSP: Goto definition in expressions 2021-04-17 12:50:47 +02:00
Olivier Goffart
06f2223bb2 LSP: move code around 2021-04-17 12:50:47 +02:00