Commit graph

28 commits

Author SHA1 Message Date
Tobias Hunger
750efffbd7 Fix assert in LSP (SubElement != Component) when renaming properties 2025-05-06 21:31:24 +02:00
Yuri Astrakhan
5356fdcf89 Fix clippy issues, plus a few manual cleanups
* Run `cargo clippy --fix`
*  `BackendSelector` is easier to instantiate with auto `Default`
2025-02-06 17:28:51 +01:00
Tobias Hunger
e24e9ffb60 lsp: Improve renaming of properties
Make that work accross exports for properties that
are accessible to the outside world.

Add a few tests for it.
2025-01-27 14:04:00 +01:00
Tobias Hunger
f9d5b1684c lsp: Support export modules when renaming 2025-01-23 12:28:20 +01:00
Tobias Hunger
af03842bf7 lsp: rename Globals 2025-01-20 11:04:13 +01:00
autofix-ci[bot]
0304c7a410 [autofix.ci] apply automated fixes 2025-01-17 18:03:30 +01:00
Tobias Hunger
de0fcc4805 lsp: Rename properties 2025-01-17 18:03:30 +01:00
Tobias Hunger
f4b09226c4 lsp: Wire up more renaming for component, structs and enums
... and their usages and imports/exports

Use the token_info to do this.
2025-01-17 10:27:12 +01:00
Tobias Hunger
70742a212d lsp: Import more types in rename_component 2025-01-13 16:27:24 +01:00
Tobias Hunger
eb4fa61f25 lsp: Simplify tests in rename_component
No behavior change is intended...
2025-01-13 16:27:24 +01:00
Tasuku Suzuki
346d1c2df3 Fix typos
Ran `typos .` and fixed all typos that do make sense.
https://crates.io/crates/typos
2025-01-13 08:35:20 +01:00
Tobias Hunger
56697f27ea lsp: Improve test to rename components 2025-01-07 16:18:46 +01:00
Tobias Hunger
cfb2324526 lsp: Rename structs and enums
... but only when directly on the name of the struct
when it is declared.
2025-01-07 16:18:46 +01:00
Tobias Hunger
7893c5a00c lsp: Generalize some renaming related functionality 2025-01-07 16:18:46 +01:00
Tobias Hunger
6b4db19fb0 lsp: Extract common code needed to rename a DeclaredIdentifier 2025-01-07 16:18:46 +01:00
Olivier Goffart
5b3ea5cdd5 LSP: record dependencies and invalid all dependents when a dependencies changes
Fixes #5797
2024-11-14 14:35:22 +01:00
Tobias Hunger
1a306dd155 live-preview: Use TextRange and TextSize in property information
The Properties are no longer sent out straight to the editor, so
we do not need to convert our internal `TextRange` and `TextSize`
to `lsp_types::Range` and `lsp_types::Position`.

We are noweadys turning that straight back into offsets -- which is
just another name for `TextSize` (or pairs of offsets).
2024-08-23 18:58:44 +02:00
Tobias Hunger
1c447db8ca lsp: Build without SourceFileInner::version()
... in preparation to removing that functionality.
2024-08-21 16:55:13 +02:00
Olivier Goffart
cf88676a18 LSP: fix renning the tests without the preview feature 2024-07-25 22:40:30 +02:00
Tobias Hunger
bc35d49328 lsp: Remove UpdateElement Preview-to-LS-message
We can do that inside the Live preview now and just return the
WorkspaceEdit.
2024-06-25 19:51:59 +02:00
Tobias Hunger
3d52486acb live-preview: Use production code in test
... over implementing the same fucntionality again for the tests.
2024-06-25 10:56:11 +02:00
Tobias Hunger
37d6922983 live_preview: Wire up component renaming 2024-06-21 14:40:50 +02:00
Tobias Hunger
1cc63ea428 lsp: Borrow new_name in rename_component 2024-06-21 14:40:50 +02:00
Tobias Hunger
58148b4ca7 live-preview: Add test for component renaming with relative paths
.. and fix the code to handle them.
2024-06-19 17:11:24 +02:00
Tobias Hunger
49d4fc5d0f live-preview: Handle add_new_component 2024-06-19 11:45:37 +02:00
Tobias Hunger
67200c81ff live-preview: Compile-test element moves in can_move function
Compile test the result of an element move in the `can_move` function
to catch all cases where the move would be problematic.

Shuffle some test code around to allow for testing this new
functionality.
2024-06-14 16:59:39 +02:00
Tobias Hunger
6c034372a1 lsp: Encapsulate DocumentCache better
The Document cache is a specialized typeloader now, make it provide the
necessary APIs directly, so that we can be sure nobody will do anything
that breaks the data:-)
2024-06-12 10:15:29 +02:00
Tobias Hunger
704cfff41f lsp: Rename components
Only handle rename requests when on the component name in the component
definition.

Handle exports/imports in the entire project as needed.
2024-06-03 16:12:31 +02:00