Quick-fix for #11798: If a code-editor edit cannot be applied, revert it in the editor view and display a message "Unable to apply source code edit." This prevents module corruption, but can be inconvenient when trying to perform an edit involving certain syntactically-incorrect intermediate states that are not currently representable. An upcoming PR will provide a more comprehensive solution for that case.
Convert HTML clipboard data to Markdown when pasting into documentation editor:
https://github.com/user-attachments/assets/e87ba419-7465-48a7-bb08-101a76012a72
# Important Notes
- The best HTML-to-Markdown converter available seems to be Lexical. It's a large dependency, but this implementation lazily loads it only when rich pasting functionality is needed. In the future, we could cut it down a lot; we only need (parts of) the node definitions, the transformers, and (parts of) the core.
- Not all formatting in the example webpage is supported yet; some issues added to #11772.
- Also: Fix undo/redo in documentation editor (prevent graph editor from also handling).
* Ctrl+click to follow link; clicking link opens a popup. Fixes#11692.
- Ctrl+click to follow link (and add hover text)
- When editing, if the cursor is in a link a popup allows following the link.
- Text filters (e.g. recognizing links) now apply to text dragged into the
editor, or pasted with the context menu, besides pasting with the keyboard
(uses new feature from updated CM).
- Simplify CM editors by moving setup and reactivity patterns into shared
helpers.
- Add integration tests for link interactions in component comments and documentation panel.
- Fix code editor tooltips (fixes#11740).
- All lines containing selected text show markup
Fix performance issue reported by @JaroslavTulach on Discord.
- Fix accumulation of unreferenced AST objects when reconciling module content with `syncToCode`.
- Add a unit test checking that `syncToCode` does not allocate unneeded objects in the module.
Fixes#10768.
Fixes#11729
The issue was quite rare indeed: it happened only when somehow nodes had idmap and metadata cleared from the file, and then only metadata change was applied.
In this case, because there was no idMap change, idMapToPerstist was also empty; metadata were stored with proper ids, but those ids weren't assigned to any span.
Fixes#11406
Also refactored the right panel state into its own store, so it is less coupled with the graph editor.
<img width="439" alt="image" src="https://github.com/user-attachments/assets/73e6bb92-235f-497d-9cff-126dc4110f8b">
The function definition widget tree displays the icon, name and all arguments. The name is editable, everything else right now is just read-only. The icons next to the arguments are just placeholders intended to be replaced with a "drag handle" icon.
Also fixed issues with missing rounded corners on the ag-grid widget.
<img width="263" alt="image" src="https://github.com/user-attachments/assets/cb61f62a-755c-4865-ba6c-ab9130167713">
Fixes#11716
The previoud implementation of restoring execution context assumed, that any synchronization in progress on connection close will fail - but actually if the synchronization just waited for executionContext/create, it might be successfull and effective after reconnecting.
Also, show "Language Server connection lost" when the actual language server connection is lost, and dismiss the message on reconnect.
# Important Notes
The hibernation still does not work properly - connection to Project Manager is not restored.
close#11481
Changelog:
- update: handle `MultiTypeValue` results in the execution instrument
- update: language server protocol supports multi-type values
- update: GUI uses only the first type of a multi-type value when
# Important Notes
GUI uses only the first type of the intersection. See the difference between `Integer&Text` and `Text&Integer`:
https://github.com/user-attachments/assets/29efc89b-c223-4043-8dff-9cdae1987f0c
* Render tables in documentation.
Also:
- Separate parser for our flavor of Markdown from the CodeMirror integration;
move the parser into ydoc-shared and use for Markdown line-wrapping.
- Introduce our own version of yCollab extension; initially just the upstream
version translated to Typescript and our code style.
- Refactor CodeEditor.
* CHANGELOG, prettier
* Apply @farmaazon review.
* Fix
* Lint
* Cleanup
* Integration tests for GraphNodeComment
Also a little refactoring in preparation for new implementation.
* Workaround stuck CI
* Revert "Workaround stuck CI"
This reverts commit 74313842ba.
* Fix merge
---------
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Implements #11240.
https://github.com/user-attachments/assets/4d2f8021-3e0f-4d39-95df-bcd72bf7545b
# Important Notes
- Fix a Yjs document corruption bug caused by `DeepReadonly` being replaced by a stub; introduce a `DeepReadonly` implementation without Vue dependency.
- Fix right panel sizing when code editor is open.
- Fix right panel slide-in animation.
- `Ast.Function` renamed to `Ast.FunctionDef`.
Move documentation into documentable types (implements #11302).
# Important Notes
GUI:
- Distinguish expression and statement
- `Ast.Ast` is still present, as the base class for AST objects. Most references to `Ast.Ast` are now references to `Ast.Expression`. Operations on blocks use `Ast.Statement`.
- `Ast.parse` has been replaced with: `Ast.parseExpression`, `Ast.parseStatement`, and `Ast.parseBlock`
- `syncToCode` is internally context-aware; it parses the provided code appropriately depending on whether its AST is an expression, a statement, or the top level of a module.
- Remove `wrappingExpression` / `innerExpression` APIs: Wrapper types have been eliminated; modifier lines are now fields inside parent types.
- Simplify AST printing:
- Fully implemented autospacing in `concreteChildren` implementations; the type returned by `concreteChildren` now ensures that spacing has been fully resolved.
- Eliminate `printBlock` / `printDocs`: `concreteChildren` is now aware of indentation context, and responsible for indentation of its child lines.
- The `Pattern` type is now parameterized to identify the AST type it constructs. The `Pattern.parseExpression` function helps create a `Pattern<Expression>`.
- Refactor `performCollape` for testability.
- e2e tests: Improve table viz test: It still doesn't pass on my Mac, but these changes are necessary if not sufficient.
Compiler (TreeToIr):
- An expression in statement context is now found in an `ExpressionStatement` wrapper.
- Documentation for a `Function` is now found inside the function node.
- Deduplicate some polyglot-function logic.
Fixes#10861
Every widget may set metadata on its AST. Because once widget picker will be implemented a single AST node may have many possible widgets, their settings are kept in a map keyed by their name/key.
Move annotations into fields of Function and ConstructorDefinition.
# Important Notes
New syntax: Constructor argument-definition lines
- Each argument in a type-constructor definition may be specified on its own (indented) line.
Relaxed syntax: Unparenthesized arguments to annotations
- A generic annotation now uses the rest of the line as its argument expression; the expression no longer needs to be parenthesized.
Eliminate `private` modifier-node: `private` is a field in supporting types, or a single-token node in the case of `private` declarations.
# Important Notes
- Rust parser tests: Switch to a builder-style API for defining expected `Function` ASTs to allow further changes to `Function` fields without rewriting all the tests again.
- TreeToIr: Fix discarded module-level `diag`; add a test that covers module diagnostics.
- Syntax: Disallow `private` methods in function blocks. (Previously this was enforced in the compiler.)
Align `Assignment`/`Function` distinction in AST with compiler's implemented semantics:
- The ambiguous case `funcOrVar = expression` is now parsed as a `Function` when in a `Type` definition or in the top level of a module. I.e. it is an `Assignment` in contexts where the RHS is evaluated immediately when the binding is evaluated, and a `Function` in contexts where the RHS is evaluated each time the bound name is evaluated.
- `Assignment` statements now may only occur in function bodies.
Correcting this distinction lays the groundwork for #11302.
Other changes:
- Fixed incorrect source code locations for negative literals and negated expressions.
# Important Notes
New APIs:
- The parser now exposes a `parse_block` entry point, which allows parsing input lines as if in the body of a function. The previous entry point has been renamed to `parse_module`.
Fixes#10668Fixes#8484
Summary of changes:
* `gui2` and `dashboard` are merged to `gui` directory. Various configs were merged (package.json, playwrigth, TS...). The src and e2e directories are split to `dashboard` and `project-view` for now.
* E2E tests run two servers on different ports. The tests are organized in projects. This is also to be changed soon, as we plan to [use better mocking in GUI/ProjectView](#9726)
* ESlint configs were merged to central `eslint.config.mjs`, and that file was moved to repository root. We kept the dashboard lints, but they can be relaxed. The dashboard code was changed to meet GUI lints.
* Also, the versions of linter plugins were bumped, and code fixed.
* The ide-desktop/client no longer has `dashboard` dependency - the only type used there was moved to common package.
* `common` package moved to `app`.
Fixes#10948
The problem was in the binary reconnecting: we sent the first "initProtocol" message, but the connection was reset, and then we try to initialize again. While looking good, the problem was that the party websocket we use queued the first initProtocol message and re-send it by itself on reconnect. Our initProtocol was also sent, but it did not get any response, blocking any further request like `writeBytes`.
Fixes#10976https://github.com/user-attachments/assets/00b2279d-2acf-468b-8c3c-aa6885cba23d
Addressed issue of empty body block being incorrectly "repaired" into an empty group, geneating invalid `()` syntax. Appending nodes to an empty function now actually replaces its body block, instead of creating a temporary orphan body block node.
Note that empty main function is still considered an error on the engine side, but it doesn't impact the IDE in negative way. Things work again as soon as a node is inserted.
Also fixed a few issues causing hot-reloading to break. Now edited AST code properly hot-reloads all affected modules without breaking the app.
Reactively track reads of fields of all `Ast` objects residing in the `graphStore`'s `syncModule` (i.e. the committed module state). Tracking includes reading the `parent` field of a node.
Note that non-`Ast` structured fields (e.g. `ArgumentDefinition`) are not themselves reactive--an access is tracked when obtaining the object from the `Ast`, not when accessing the inner object's fields. Structured fields are low-level, and mostly not exposed outside `Ast`, so I don't think transitively proxying them would be worth the overhead.
Implements #10697.
Fixes#10293
The Table Editor Widget allows adding rows and columns, editing cells and renaming columns.
[Screencast from 2024-08-07 13-17-37.webm](https://github.com/user-attachments/assets/d2e708b5-6516-4107-bc17-f018e455c111)
# Important Notes
* The parts of Table Visualization which were useful for the widget were put in vue component. On this occasion, we use aggrid vue.
# Important Notes
The command to run the gui dev environment has been changed. Invoking the old command will print a message about that.
From now on, use `pnpm dev:gui2` in repository root.