Commit Graph

5394 Commits

Author SHA1 Message Date
Pavel Marek
f811f2ef73 Convert ImportSymbolAnalysis to mini pass 2024-11-06 19:36:32 +01:00
Pavel Marek
ad6504d901 Move ScalaConversions from runtime to engine-common 2024-11-06 18:13:48 +01:00
Kaz Wesley
867c77d5cc
New markdown editor (#11469)
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`.
2024-11-06 16:54:32 +00:00
Pavel Marek
701bba6504
Convert Array_Like_Helpers.map to a builtin to reduce stack size (#11363)
The ultimate goal is to reduce the method calls necessary for `Vector.map`.

# Important Notes
- I managed to reduce the number of Java stack frames needed for each `Vector.map` call from **150** to **22** (See https://github.com/enso-org/enso/pull/11363#issuecomment-2432996902)
- Introduced `Stack_Size_Spec` regression test that will ensure that Java stack frames needed for `Vector.map` method call does not exceed **40**.
2024-11-06 11:14:48 +00:00
Paweł Grabarz
9703cb1dd0
Align esbuild versions across packages (#11459)
Part of #11458

Should get rid of the "magical" CI failure: https://github.com/enso-org/enso/actions/runs/11576387008/job/32225209090#step:7:254
2024-11-05 23:43:27 +00:00
James Dunkerley
86c1cd9953
Support for 1904 date format. (#11496)
- Adds support for reading Excel workbooks in 1904 date format.
- When writing to a workbook in 1904 format, will write dates correctly.

![image](https://github.com/user-attachments/assets/c17cd65d-1a09-4aa8-a946-8d427a2b7c22)

![image](https://github.com/user-attachments/assets/66796dac-4271-4bd1-acb3-1127afb5ec0b)
2024-11-05 23:10:34 +00:00
Sergei Garin
7ffd5b5ee6
Fix TOS modal (#11473) 2024-11-05 22:36:38 +00:00
Pavel Marek
3df57557ca
Only single native image is built at a time (#11497)
#10783 introduced another definition of a buildnativeimage task. Since that time, our CI is transiently failing on out of memory error. This PR ensures that there can be just a single `buildNativeImage` task running at a time.

# Important Notes
Manually tested by running
```
sbt:enso> all engine-runner/buildNativeImage project-manager/buildNativeImage
```
And looking at spawn subprocesses. On develop, I have two `native-image` processes, on this PR, there is just a single one.
2024-11-05 18:33:58 +00:00
Jaroslav Tulach
73abe909ef
Use GraphBuilder to construct an alias Graph (#11491) 2024-11-05 18:56:05 +01:00
Sergei Garin
0f8f6da273
Add transitions support for zustand 'useStore' (#11474) 2024-11-05 17:08:08 +00:00
Sergei Garin
0e434cd318
Replace special characters while uploading a file (#11356)
Closes: https://github.com/enso-org/cloud-v2/issues/1489

This PR replaces all special characters with `:`
2024-11-05 15:36:28 +00:00
Dmitry Bushev
47943a2e62
Add compression to the metadata code snapshot (#11470)
close #11420

Changelog:
- update: add zlib compression to the `snapshot` metadata field
- add: implement nodejs `zlib` for polyglot ydoc-server
- add: implement nodejs `Buffer` for polyglot ydoc-server
2024-11-05 11:57:43 +00:00
James Dunkerley
c5734a8fc8
Improved Google Analytics integration (#11484)
- Enhanced Google Analytics API.
- Now published as a type with static methods not a module.
- Bump version and add Admin API.
- Moved the reading logic to Java from Enso.
- Add dependency on Standard Table allowing report to be built into a Java Table directly.
- New `Google_Credential.new` method.
![image](https://github.com/user-attachments/assets/54e3ad87-045f-4e40-b609-337d827c5d02)
- Ability to list accounts for a credential (`Google_Analytics.list_accounts`).
![image](https://github.com/user-attachments/assets/296c6dcc-3b24-43fa-b909-5e74c40d77a1)
- Ability to list properties (either for an account or for all) (`Google_Analytics.list_properties`).
![image](https://github.com/user-attachments/assets/e420c824-d08e-48d0-b21c-560b4c7c4809)
- Simple object structure of `Google_Analytics_Account`, `Google_Analytics_Property` and `Google_Analytics_Field` with some helper methods.
- Widget for `account`, `property` and `credentials`.
![image](https://github.com/user-attachments/assets/221c1450-964d-4fce-af8b-2273aa8739a1)
![image](https://github.com/user-attachments/assets/e1daf1dd-2ade-4c33-875c-4e3cb1544fe6)
![image](https://github.com/user-attachments/assets/cd37b018-4fad-4771-9f48-1448f0076ef9)
- Widget for `dimensions` and `metrics` with defaults and then reading from Admin API.
![image](https://github.com/user-attachments/assets/3a4b1d42-9555-499d-90da-04d7586ab4c1)
![image](https://github.com/user-attachments/assets/16efcb11-3547-4eaf-9f28-944fa21c4aa2)
- Added widget for `start_date` and `end_date` on `Google_Analytics.read`.
- Bug fix for `parse` with auto type by reordering to allow numeric dates to be parsed.
- **ToDo**: better exception handling.
2024-11-05 10:11:42 +00:00
Hubert Plociniczak
35e5ed53d2
Don't cancel aborted jobs immediately (#11375)
* Don't cancel aborted jobs immediately

Rather than cancelling Futures that capture jobs' logic,
this change introduces a two-level system:

- interrupt all jobs softly via ThreadInterrupted at safepoints
- if safepoint is not executed within some time period or it is
  but the job is still not cancelled, trigger a hard-interrupt
  by cancelling the job explicitly, if possible

Closes #11084.

* Only cancel Future when you mean it

Soft-cancelling a future only to later call it with `mayInterrupt` set
to `true` has no effect in the latter case.
Changed the logic so that interrupting a Future will really enforce it.

Ocassionally some commands should not attempt to run soft cancellations
- we know they will re-execute the program.

* Replace Thread.sleep with Future.get

No while loops etc, it's much easier to reason about what is soft and
hard interrupt supposed to do.

* Better comments/logs

* nit

* PR review

* Make test more robust
2024-11-05 10:33:02 +01:00
Jaroslav Tulach
988316f910
Make Graph.nextId() private (#11486) 2024-11-05 05:21:10 +01:00
Kaz Wesley
42fc2af5cd
Fix tests after semantic merge conflict (#11488)
Force merging to repair CI.
2024-11-04 22:24:14 +00:00
Jaroslav Tulach
dd107e0ab1
Ensure EnsoMultiValue returns some Meta.type_of (#11480) 2024-11-04 20:47:25 +01:00
Kaz Wesley
2b3bd2cc90
Move documentation into documentable types (#11441)
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.
2024-11-04 15:33:53 +00:00
Ilya Bogdanov
d3beac3a90
Consider additional self types (#11451)
Fixes #11427

Before:

https://github.com/user-attachments/assets/fc16cefd-f264-4410-bd30-1747c580da1a

After:

https://github.com/user-attachments/assets/e85b8fb3-35c4-4d18-a9a0-2aeb69201b6f
2024-11-04 15:08:59 +00:00
Adam Obuchowicz
2bbd909705
Implement the limit of 256 cells in the Table Editor (#11448)
Fixes #10864

[Screencast From 2024-10-30 13-45-48.webm](https://github.com/user-attachments/assets/9ed2384a-de85-4059-a0fe-c0a45b2fe07c)
2024-11-04 09:10:59 +00:00
Jaroslav Tulach
4cb943b5ed
Occurences in Java. Don't expose setters for Scope vars. (#11464)
Another change motivated by work on #11365. Continuation of #11419.
2024-11-01 17:14:10 +00:00
Sergei Garin
7487a3b4d2
Addtional tiny performance follow-up (#11460)
This PR mostly improve performance of the assets table:
1. It removes calc of the `clipPath` on scroll which triggers position recalculation in `Navigator2D`
2. Adds caching for parsing a category (we do this a lot across components but we have only a few categories) and runtime validatation has relatively large perf penalty
3. Adds dom-based virtualization for rows (we still need to add proper react based virtualization though)
2024-11-01 13:03:21 +00:00
Dmitry Bushev
5f5254772b
Ydoc native image (#10783)
close #10757

Changelog:
- add: native-image configuration to the `ydoc-server` project
- add: native-image overrides for loom executors replacing them with platform threads
- update: Helidon `4.1.2`
- fix: issues related to the native-image build
2024-10-31 19:57:50 +00:00
Pavel Marek
536a49f35d
Fix Meta.get_qualified_type_name when run as single file (#11401)
`Meta.get_qualified_type_name` correctly returns fully qualified type name when running a single file from a project with `enso --run Proj/src/Main.enso`.
2024-10-31 15:25:45 +00:00
Radosław Waśko
aad1107a8e
Add widget for name_filter (#11455)
- Closes #11310
2024-10-31 14:05:08 +00:00
Radosław Waśko
2619399799
Enso_File integration update: Multi-part upload and presigned URL for download (#11440)
- Closes #11330
- Closes #11331
2024-10-31 13:11:42 +00:00
Radosław Waśko
cf5326fbd1
Fixing small bugs uncovered by type checker (#11422)
Once our libraries and tests are compiled with basic inference of method types, some warnings were reported:
```
X:\NBO\enso\built-distribution\enso-engine-0.0.0-dev-windows-amd64\enso-0.0.0-dev\lib\Standard\Database\0.0.0-dev\src\DB_Column.enso:1003:19: warning: Calling member method `div` on type Number will result in a No_Such_Method error in runtime.
1003 |         halfway = scale.div 2
|                   ^~~~~~~~~~~
X:\NBO\enso\built-distribution\enso-engine-0.0.0-dev-windows-amd64\enso-0.0.0-dev\lib\Standard\Image\0.0.0-dev\src\Matrix.enso:381:21: warning: Invoking a value that has a non-function type (type Image) will result in a Not_Invokable error in runtime.
381 |     to_image self = Image (Image.from_vector self.normalize.to_vector self.rows self.channels)
|                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
X:\NBO\enso\built-distribution\enso-engine-0.0.0-dev-windows-amd64\enso-0.0.0-dev\lib\Standard\Table\0.0.0-dev\src\Internal\Multi_Value_Key.enso:94:22: warning: Calling static method `new` on (type Illegal_State) will result in a No_Such_Method error in runtime.
94 |         Error.throw (Illegal_State.new "Ordered_Multi_Value_Key is not intended for usage in unordered collections.")
|                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

This PR attempts to fix them.

There was also an expected error in the Examples:
```
X:\NBO\enso\built-distribution\enso-engine-0.0.0-dev-windows-amd64\enso-0.0.0-dev\lib\Standard\Examples\0.0.0-dev\src\Main.enso:139:36: warning: Calling static method `frobnicate` on (type No_Methods) will result in a No_Such_Method error in runtime.
139 | no_such_method = Panic.recover Any No_Methods.frobnicate . catch
|                                    ^~~~~~~~~~~~~~~~~~~~~
```
To avoid getting a warning, I wrapped this in `(_ : Any)` to make the warning go away. The behaviour of the function is unchanged.
2024-10-31 12:49:50 +00:00
Sergei Garin
fdab2233ac
Add React compiler (#11405)
This PR adds React Compiler to the dashboard
Read more about the compiler: https://github.com/reactwg/react-compiler/discussions/5

- This PR expects that these PRs are merged:
- #11380
- #11382

## Reasoning

On our codebase adding React compiler led to significant perf improvements across the whole app. But the most impact was on the AssetsTable (see video attachment). Adding React compiler reduced the rerender scope of the AssetsTable from the whole table to the certain elements that changed, and made the table much more usable.

Without compiler (page freezed):

https://github.com/user-attachments/assets/16505b40-123b-4153-9c22-880f5dfa211c


Compiler solves the issue:

https://github.com/user-attachments/assets/6a298876-f28d-4b3d-8247-50b0c7ecb7f8

This PR requires thorough testing of the dashboard for potential bugs introduced by the compiler
2024-10-31 12:10:22 +00:00
somebody1234
c6e87c2a17
Optimize asset table rendering (#11382)
- Depends on:
- #11380
- Some optimizations for re-rendering assets table:
- Omit `visibilities` from `state` in favor of passing each `AssetRow`'s `visibility` directly to the row. This minimizes spurious `state` updates.
- Pass `id` and `parentId` to `AssetRow` instead of the entire object. This ensures that re-fetches do not force a re-render of the `AssetRow` - we are no longer passing a reference to the object, so we are now comparing by string comparison (which is almost always stable).

# Important Notes
None
2024-10-31 10:36:10 +00:00
James Dunkerley
610ee5fdec
Expand and improve pretty for core data types, vector and table. (#11438)
-  Alter default `Any.pretty` so constructor is prefixed with type name (as needed now).
![image](https://github.com/user-attachments/assets/72d5ff2f-b567-47e2-becf-2e4acd4d089d)
-  Tests for `pretty` on `Date`.
- `pretty` for  `Date_Time` and  `Time_Of_Day` improved to not have as much noise.
- `pretty` for  `Period`,  `Date_Range` and  `Range`.
- Added custom `pretty` for  `Vector` and  `Array` as built-in method doesn't call through to overrides.
- Added custom `pretty` for  `Column` and  `Table`.
- Bug fix for `pretty` in `Time_Zone` so calls through to `pretty` of the zone_id to ensure safely escaped.
- Initial `default_widget` for `Date` and `Time_Of_Day`.
- Improve widget for `Date.to_date_time`.
![image](https://github.com/user-attachments/assets/18bc1d88-8ea9-42d0-8a9c-bc873e5d6835)
- `to_text`, `to_display_text` and `pretty` for `Enso_Secret`
![image](https://github.com/user-attachments/assets/d850c109-d1af-4b6f-a450-013c4d137805)
- private constructor for `Enso_Secret` as can't be correctly built directly.
- Use `_` for the testing methods in `HTTP` to clarify they shouldn't be used in general code.
2024-10-31 10:04:52 +00:00
Paweł Grabarz
950a93ddeb
Display error message when viewed graph doesn't exist. (#11452)
Fixes #11211

<img width="258" alt="image" src="https://github.com/user-attachments/assets/7adea4f6-774a-49ac-8c86-5e785df2acff">

When the "go back" button is clicked, the user is sent back to the `main` function graph. The breadcrumbs are also present on that view and can be used for navigation.

Current design of the error state is improvised, likely to be changed once we have some design guidance about it.
2024-10-31 07:48:48 +00:00
Ilya Bogdanov
0d731adeff
Add undo/redo buttons to the top bar (#11433)
Closes #11222

https://github.com/user-attachments/assets/66f8dfd1-a7c4-497a-8ff6-a22f56dbb1dd
2024-10-30 17:01:35 +00:00
Paweł Grabarz
0cf1c021ce
Add enter node button to the dropdown menu (#11447)
Fixes #11179

<img width="223" alt="image" src="https://github.com/user-attachments/assets/9b5ba054-717f-4124-98df-3d076bc73b32">
2024-10-30 16:55:12 +00:00
Ilya Bogdanov
6566b2da2f
Fix help panel (#11421)
Fixes #11392

The issue was caused by somewhat cumbersome logic of updating/overriding displayed suggestion. I’m not sure if it even was working correctly at any time.


https://github.com/user-attachments/assets/51e6fcd4-2198-40a2-86e7-8fcfa8b8b8d5
2024-10-30 14:14:28 +00:00
Paweł Grabarz
29f1f0d4e1
Add IDE version to window title. (#11446)
Fixes #10966

![image](https://github.com/user-attachments/assets/a46e38e9-1ff3-4eb4-9a88-901d684dc205)
2024-10-30 13:48:59 +00:00
Gregory Michael Travis
dc50a7e369
HTTP response caching, with TTL and LRU logic (#11342) 2024-10-30 12:50:35 +00:00
Nikita Pekin
10d76ca614
chore(flake.nix): Add missing macOS-specific dependencies of enso-formatter (#11430)
When compiling the `enso-formatter` binary for use in `~/.cargo/bin` (for the `cloud-v2` repo), the formatter requires some additional dependencies that are not currently provided in the nix build environment. This PR adds those dependencies to `flake.nix` so that `enso-formatter` compiles successfully.

cc @somebody1234
2024-10-30 11:15:37 +00:00
Adam Obuchowicz
39c44e7adb
Table Input Widget: Size persistence (#11435)
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.
2024-10-30 09:34:58 +00:00
Gregory Michael Travis
442123bba0
Fix Float.parse benchmark regression (#11402) 2024-10-29 22:39:32 +00:00
Dmitry Bushev
74220f243a
Dependency tracking between nodes is too coarse grained (#11428)
close #11237

Changelog:
- update: implement special case for a line removal when calculating the changeset

# Important Notes
Note that the graph is still re-calculated when the node is re-added (by pressing `ctrl-z`). The reason is that the engine processes edits on the textual level and there is not enough information to do similar workarounds. The issue becomes irrelevant when we switch to the direct tree manipulation in Ydoc.

https://github.com/user-attachments/assets/c85afde8-6386-44df-82b5-6fb0cca5205b
2024-10-29 15:33:53 +00:00
Jaroslav Tulach
15575b495a
Skeletal PanicExceptionTest and more logging when AssertionError happens (#11393) 2024-10-29 15:47:12 +01:00
Gregory Michael Travis
5b8bc86cf9
Clean up SQLite file after the SQLite file tests have run. (#11416) 2024-10-29 12:48:11 +00:00
Jaroslav Tulach
71acb83e7f
Removing useless GraphOccurrence.Global & some encapsulation (#11419)
Work on #11365 made me realize that `GraphOccurrence.Global` isn't really used anywhere. Simplifying the code by removing it and associated methods.
2024-10-29 10:23:22 +00:00
James Dunkerley
78d9e34840
Excel before 1900 and AWS signed requests. (#11373) 2024-10-28 20:20:06 +00:00
Sergei Garin
5bf064f97f
Open enso devtools on call of toggleDevtools() (#11423)
This PR changes the behavior of `toggleDevtools()` function and shows `ensoDevtools` with `tanstack` devtools
2024-10-28 15:53:40 +00:00
Sergei Garin
12267c6d98
Batch refetches for different listDirectory queries (#11380)
This PR moves invalidation of the `listDirectory` queries into a separate `useQuery` to sync mutliple invalidations into a single one
2024-10-28 14:44:23 +00:00
Sergei Garin
fae18c0a04
Add eslint-react-compiler (#11404)
* Add React compiler eslint rules and fix issues across reusable components

* Fix compiler errors

* Remove fail-on-warnings for eslint

* Set max-warnings to 41 to match the amount of warnings introduced by react-compiler

* Add comment for lint task
2024-10-28 15:58:41 +03:00
Dmitry Bushev
db0582d11c
Metadata should not depend on absolute text spans (#11390)
close #11304

Changelog:
- update: add `ide.snapshot` optional metadata field containing the source code of the file
- update: `syncFileContents` method tries to repair the metadata spans when it detects that the source file was edited and the received code does not match the code stored in the `ide.snapshot` metadata field

# Important Notes
Tested in gui
2024-10-28 09:41:46 +00:00
Dmitry Bushev
d16fd63525
Reload insight script on file change (#11415)
Changelog:
- update: reload insight script when the file was edited
2024-10-28 09:17:53 +00:00
Ilya Bogdanov
6111a35ccc
New component menu (#11398)
Closes #11244

- The new dropdown contains all buttons that were present on the wheel before. (except for disabled ‘Write always’)
- The color component stays the same for now
- The visualization toggle button does not change the color depending on the state.


https://github.com/user-attachments/assets/a4d711be-5526-41aa-8e24-6be52e187844

**UPDATE**:

The ‘Edit component’ button was replaced with the ‘Help’ button, which toggles the Help tab of the right-dock panel. The behavior is displayed on the video:

https://github.com/user-attachments/assets/6da8c34a-8bc3-4be4-b0b6-982bf709e986

The ‘Help’ item in the dropdown list preserves its current behavior (opening API docs in the browser).

# Important Notes
- I failed to fix an issue with the unmatching colors of the dropdown menu and the circular menu. If somebody wants to check it out – you are welcome. For now, we just transition to pure white without any transparency to mitigate the issue.
2024-10-26 19:36:16 +00:00