Commit Graph

4621 Commits

Author SHA1 Message Date
Hubert Plociniczak
38df86e33d
Compile parser using musl (#9806)
To workaround problems with `glibc` we need to build parser in the backend with C stdlib statically linked using musl. Uses the arguments presented in #9521.

# Important Notes
No problems in tests so far.
2024-04-29 13:22:41 +00:00
Pavel Marek
660c5e7a9d
Atom constructors can be private (#9692)
Closes #8836.

Atom constructors can be declared as private (project-private). project-private constructors can be called only from the same project. See the encapsulation.md docs for more info.

---------

Co-authored-by: Jaroslav Tulach <jaroslav.tulach@enso.org>
Co-authored-by: Radosław Waśko <radoslaw.wasko@enso.org>
Co-authored-by: Hubert Plociniczak <hubert.plociniczak@gmail.com>
Co-authored-by: Kaz Wesley <kaz@lambdaverse.org>
2024-04-29 14:43:18 +02:00
Radosław Waśko
16e1999040
Fix copy_to/move_to edge case when source and target are the same (#9798)
- Adds tests for an edge case where the source and target of copy/move operation are the same.
- And fixes the behaviour to be as expected.
2024-04-29 12:29:07 +00:00
Adam Obuchowicz
210f0482a4
Set of improvements: selection "committed" state and "add new compnent" button hitbox fix. (#9775)
1. Did selection refactoring as follow-up of #9519. Now the circular menu visibility or node extension is altered only when selection is ended (before, node shrank once the selection started a bit less blinking).

[Screencast from 2024-04-24 10-56-05.webm](https://github.com/enso-org/enso/assets/3919101/744e7579-80dd-4d44-a545-7af812239be2)

3. Fixes #9699 I don't know why the add-node button shape was done in :before element, if it happily works by shaping the main div itself.

[Screencast from 2024-04-24 10-51-57.webm](https://github.com/enso-org/enso/assets/3919101/004aede5-ea00-4e30-9a3d-6e2574e3b755)
2024-04-29 11:31:26 +00:00
Hubert Plociniczak
25224a8acf
Compile-time shapeless in runtime-compiler (#9805)
Marking the `shapeless` dependency as compile-time only.

# Important Notes
If we want to ditch the dependency completely then, if we want to keep the check in place, we would have to replace with its runtime equivalent:
```
--- a/engine/runtime-compiler/src/main/scala/org/enso/compiler/pass/IRPass.scala
+++ b/engine/runtime-compiler/src/main/scala/org/enso/compiler/pass/IRPass.scala
@@ -148,6 +148,9 @@ object IRPass {
def unsafeAs[T <: Metadata: ClassTag]: T = {
+      if (implicitly[ClassTag[T]].runtimeClass == Metadata.getClass) {
+        throw new InternalError("Type argument must be specified")
+      }
```
Not sure if we want to do it still after this change.

Note that `project-manager` uses that and some other definitions as well.
2024-04-29 09:50:05 +00:00
somebody1234
d58b5f2a7d
Change heuristics for showing missing .env error (#9491)
- Fix #9479

# Important Notes
None
2024-04-29 07:27:00 +00:00
Michał Wawrzyniec Urbańczyk
447f4b5ac6
Use macos-12 runner for x64 macOS jobs (#9801)
GitHub made arm64 runners generally available and changed macos-latest label to point to them.
The runner architecture is coupled with GH-hosted runners OS version: macos-13 is the last one to run on x64.

This PR essentially brings back the previous behavior, by explicitly requesting that all our x64 macOS jobs are run on macos-12 (as was before). 
We should eventually migrate to macos-13 for x64 macOS and macos-14/macos-latest for arm64 macOS. However, this leads to issues with `npm install` getting stuck, so it should be probably reattempted after the CI rework.
2024-04-29 02:09:09 +02:00
Radosław Waśko
8e03e3be9c
Print pending groups in-line and include their reason, also add progress bar to the runner (#9796)
- Closes #9534 by printing the pending groups with pending reason
- Re-introduces original ordering of tests
- Adds a progress bar to the test suite runner in 'interactive' mode (if ANSI colors are enabled, progress bar will also be)
2024-04-26 16:05:05 +00:00
Jaroslav Tulach
c5bf2384e4
Removing Truffle API dependency from runtime-compiler project (#9785)
Fixes #8888 by removing dependency on Truffle API and `polyglot-api` from `runtime-compiler` project.
2024-04-26 13:14:22 +00:00
James Dunkerley
c5179309fd
Improve Table Viz handling of Numbers (#9793)
- Added support for NaN, Infinity and -Infinity in the Table viz.
- Simplified the logic so all the formatting in a single place in the Table viz.
- Sorted Number formatting for BigInt and < 10000.

![image](https://github.com/enso-org/enso/assets/4699705/1486eb7e-df87-4516-90d0-75fda1e9743d)

![image](https://github.com/enso-org/enso/assets/4699705/e55c0e6b-bd3c-4dcf-a65f-41f8516568a6)
2024-04-26 07:52:40 +00:00
somebody1234
cb31bcaf8e
Remove special-cased injected Google Analytics tag (#9787)
- #9779 introduced (incorrect) detection to determine when to inject the Google Analytics tag. Instead, it should be injected by CI, because sending Google Analytics events is undesirable in development mode.

# Important Notes
None
2024-04-25 19:19:42 +00:00
Radosław Waśko
df4a7efcdd
Add AWS SSO JARs to the Standard.AWS library (#9782)
As reported by our users, when using the AWS SSO, our code was failing with:
```
Execution finished with an error: To use Sso related properties in the 'xyz' profile, the 'sso' service module must be on the class path.
```

This PR adds the missing JARs to fix that.

Additionally it improves the license review tool UX a bit (parts of #9122):
- sorting the report by amount of problems, so that dependencies with unresolved problems appear at the top,
- semi-automatic helper button to rename package configurations after a version bump,
- button to remove stale entries from config (files or copyrights that disappeared after update),
- button to add custom copyright notice text straight from the report UI,
- button to set a file as the license for the project (creating the `custom-license` file automatically)
- ability to filter processed projects - e.g. `openLegalReviewReport AWS` will only run on the AWS subproject - saving time processing unchanged dependencies,
- updated the license search heuristic, fixing a problem with duplicates:
- if we had dependencies `netty-http` and `netty-http2`, because of a prefix-check logic, the notices for `netty-http` would also appear again for `netty-http2`, which is not valid. I have improved the heuristic to avoid these false positives and removed them from the current report.
- WIP: button to mark a license type as reviewed (not finished in this PR).
2024-04-25 18:44:51 +00:00
Radosław Waśko
0c989c6938
Writing to Data Links (#9750)
- Closes #9292
- and also closes #9522
2024-04-25 17:55:49 +00:00
GregoryTravis
b150b091b0
Convert Vector.new_builder to Vector.build in Standard.Base (#9754)
* Vector.build

* new_builder deprecated

* convert one

* convert vector_spec

* limit param

* convert vector

* docs

* changelog

* wip

* rename limit to capacity

* wip

* review

* append comments

* review

* wip

* wip

* fix tests

* docs

* wip

* wip

* fix filter warning propagation

* doc weird dependencies

* fix tests

* cleanup

* check builder result
2024-04-25 10:38:29 -04:00
Kaz Wesley
12cbd900b4
Node creation improvements (#9781) 2024-04-25 09:18:38 -04:00
somebody1234
3a53d470eb
Google Analytics events for opening and closing the app, and opening and closing projects (#9779)
- Closes #9778
- Add `open_app`, `close_app`, `open_workflow`, and `close_workflow` events
- Miscellaneous fixes for Google Analytics:
- Fix `open_chat` and `close_chat` events firing even when chat is not visible
- Add Google Analytics script to GUI2 entrypoint (i.e. the entrypoint used by the desktop app)

Unrelated changes:
- Add Nix development shell to allow Nix users to build GUI2 and the build script
- Java dependencies have *not* been added in this PR to keep things simple

# Important Notes
None
2024-04-25 11:33:59 +00:00
Jaroslav Tulach
0d495ffd97
Make conversion of double to BigDecimal exact (#9740)
Resolves #9607 by computing `Number.hash` by converting given number to `Float` first and then computing the hash. Also the conversion from `Float.to Decimal` is exact - done via `new BigDecimal(double)`. There is `Decimal.new` that handles the user-friendly conversion. However as a result `Decimal.from 2.1 != Decimal.new 2.1` - that's the only way to ensure consistency between hash code and conversions.
2024-04-25 11:22:50 +00:00
Adam Obuchowicz
5807c5c112
Restore state after reconnecting (#9755)
Fixes: #8522

Execution context is refactored slightly: now we have a single `sync` function to synchronize both visualization and execution stack.

Tested hibernation on Linux: I was able to continue my work  🎉

# Important Notes
The Refinement Notes state, that the execution mode should be set before updating the stack, but actually it makes an error on startup (changing context automatically re-executes programs, what fails if there's no frame on the stack).
2024-04-25 09:02:47 +00:00
Jaroslav Tulach
931baa4276
Towards simplifying runtime-compiler dependencies (#8894) 2024-04-25 10:03:42 +02:00
Jaroslav Tulach
a786ad2d0a
Use InteropLibrary when accepting String values (#9773)
While investigating #9749 a JavaScript call to `Polyglot.eval("enso", ....).eval_expression("id")` was made. It crashed as JavaScript isn't using `String` but `TruffleString` to represent strings.
2024-04-24 14:50:41 +00:00
James Dunkerley
fb9cf38914
Excel_Workbook.read_many (#9759)
- Some minor linting fixes.
- Adjust `headers` parameter so a dedicated type.
![image](https://github.com/enso-org/enso/assets/4699705/989f464d-df95-410e-a03b-36661f1c4a37)
- Fix bug with `read` on an `Excel_Workbook` so error handled more gracefully and not panicking to UI.
![image](https://github.com/enso-org/enso/assets/4699705/23b4575f-daad-4719-a5cc-30d064bd7f7a)
- Fix bug when writing to a file with an `Excel_Format` with an invalid extension which was causing a panic.
![image](https://github.com/enso-org/enso/assets/4699705/dc0e055c-c1b6-482f-b129-eb69f6554d72)
- Add `read_many` to `Excel_Workbook` allowing reading more than one sheet at a time.
2024-04-24 13:16:44 +00:00
Ilya Bogdanov
717f6bb330
Display argument placeholders for autoscoped constructors (#9737)
Fixes #9635 

<img width="925" alt="Screenshot 2024-04-18 at 2 43 09 PM" src="https://github.com/enso-org/enso/assets/6566674/fbdce484-ac0b-4e30-8577-1c9dc419dffe">
2024-04-24 13:40:42 +02:00
Adam Obuchowicz
70985932b1
Selection panel (#9771)
Fixes #9519

[Screencast from 2024-04-23 12-57-01.webm](https://github.com/enso-org/enso/assets/3919101/873925db-1c9b-43e5-8144-6503c362baa0)

# Important Notes
I decided to go against our refinement notes, as in the action the blinking does not look bad, and seeing "live" how many nodes are selected may be useful.
2024-04-24 08:56:44 +00:00
Jaroslav Tulach
ff62c1e25f
Access non-self arguments when widget annotations are computed (#9410) 2024-04-24 03:58:32 +02:00
AdRiley
6f3e649e7a
Make errors propagate out of each (#9742)
Make errors propagate out of each
2024-04-23 17:14:54 +00:00
Jaroslav Tulach
96fdb67204
Special treatment for ..True and ..False (#9767) 2024-04-23 15:26:41 +02:00
AdRiley
4a97bfa31f
Add table running functionality for Sum, Mean, Min, Max. (#9577)
* Add Table.Running

* Code Review fixes

* Code Review changes

* Change null handling
2024-04-23 09:45:43 +01:00
GregoryTravis
d665f4d9c2
Change ‘decimal’ to ‘float’ in Numbers_Spec (#9718) 2024-04-23 08:09:42 +00:00
GregoryTravis
bc61d686c1
Integer.to_decimal and Float.to_decimal (#9716) 2024-04-23 08:06:31 +00:00
Hubert Plociniczak
58009b7c04
In-memory suggestions (#9751)
This change replaces an sqllite-backed suggestions' repo with a simple, in-memory, one.
As `completion` functionality has been implemented completely in GUI, there is no need to support it in backend, which simplifies a lot of functionality.

Closes #9650 and #9471.

# Important Notes
Loading suggestions and sending them to GUI on startup is almost instantaneous. Previously it would take ~10s just for `Standard.Base`.
2024-04-22 11:02:17 +00:00
Jaroslav Tulach
11dda5b9bc
Allow ..Nothing to resolve to Nothing (#9746) 2024-04-22 06:54:07 +02:00
AdRiley
fa6b7f859f
Add new icons (#9756)
Restore, Clone, Group (Only Group is mine the others were already in Figma)

![image](https://github.com/enso-org/enso/assets/1720119/f74c3afa-f490-427a-b675-584077b202bb)
2024-04-20 09:48:58 +00:00
AdRiley
ceaba7f48d
Make excel writer work for custom types (#9752) 2024-04-20 10:34:06 +01:00
Kaz Wesley
6426478c97
Copy/paste improvements (#9734)
Copying nodes:
- Multiple nodes supported.
- Node comments and user-specified colors included.
- Google Sheets data can be pasted to produce a `Table` node, handled the same way as Excel data.

# Important Notes
- Fix E2E tests on OS X.
- Add E2E and unit tests for clipboard.
- Use the lexer to test text escaping; fix text escaping issues and inconsistencies.
2024-04-19 16:33:51 +00:00
somebody1234
7c571bd460
Fix opening templates on Local Backend (#9748)
- Close #9747
- Fix creating projects from templates on Local Backend

# Important Notes
None
2024-04-19 14:07:23 +00:00
Adam Obuchowicz
de406c69fa
Automatic reconnect with Language Server. (#9691)
Fixes #8520

If the websocket is closed not by us, we automatically try to reconnect with it, and initialize the protocol again. **Restoring state (execution contexts, attached visualizations) is not part of this PR**.

It's a part of making IDE work after hibernation (or LS crash).

# Important Notes
It required somewhat heavy refactoring:
1. I decided to use an existing implementation of reconnecting websocket. Replaced (later discovered by me) our implementation.
2. The LanguageServer class now handles both reconnecting and re-initializing - that make usage of it simpler (no more `Promise<LanguageServer>` - each method will just wait for (re)connection and initialization.
3. The stuff in `net` src's module was partially moved to shared's counterpart (with tests). Merged `exponentialBackoff` implementations, which also brought me to
4. Rewriting LS client, so it returns Result instead of throwing, what is closer our desired state, and allows us using exponentialBackoff method without any wrappers.
2024-04-19 13:39:45 +00:00
Dmitry Bushev
f23455d223
Should not use auto-scoping for atom types (#9743)
close #9738

Do now use autoscope syntax for type definitions without constructors.

# Important Notes
https://github.com/enso-org/enso/assets/357683/5147b9a6-f5f4-4e5e-8b3a-3d2fa3eab2d5


https://github.com/enso-org/enso/assets/357683/db1beff8-53de-4ea1-a087-b84e571904e8
2024-04-19 09:48:31 +00:00
GregoryTravis
681df82697
Implement Vector.build: implementation and some tests (#9725)
* Vector.build

* new_builder deprecated

* convert one

* convert vector_spec

* limit param

* convert vector

* docs

* changelog

* rename limit to capacity

* review

* append comments

* review
2024-04-18 17:52:48 -04:00
James Dunkerley
16126a0c71
Working through various issues from OKR / blog use. (#9739)
- Fixed `list_directory` so that it works with defaults and uses the `Folder_Browse`.
![image](https://github.com/enso-org/enso/assets/4699705/cf8eb187-a1fe-4eb7-a017-e7bb40e30e12)
- Adjusted types of `order_by` in `Aggregate_Column.First` and `Aggregate_Column.Last` so supports single `Sort_Column`.
- Adjusted types of `order_by` in `Aggregate_Column.First` and `Aggregate_Column.Last` so an empty Vector is valid (treated as Nothing).
- Adjusted `Count_Distinct` so if an empty set of columns then equivalent to `Count`.
- Use the multi-select widget for `columns` in `Count_Distinct`.
![image](https://github.com/enso-org/enso/assets/4699705/86e8f3c1-9cbe-4fb3-b6fd-43b937346082)
- Sort the widget for `order_by` in `First` / `Last`.
![image](https://github.com/enso-org/enso/assets/4699705/d624544c-6f4d-42ef-bb97-79b68aa60569)
- Bug fix for widgets with both tagValues and dynamic data. (Thanks @farmaazon).
- Use the multi-select for various things.
2024-04-18 21:50:20 +00:00
GregoryTravis
56ae80a66b
Add tests for BigDecimal internal representation methods (#9717) 2024-04-18 20:42:41 +00:00
Kaz Wesley
0de490be24
Text literals: Accept unpaired-surrogate escape codes. (#9731)
* Text literals: Accept unpaired-surrogate escape codes.

Unpaired surrogates are not allowed by Unicode, but they occur in practice
because many systems accept them; for example, they may be present in filenames
on Windows (which are otherwise constrained to UTF-16).

Programs written in Enso should be able to work with them, if only because they
represent edge cases that should be tested when converting encodings and at
other system boundaries.

- Generalize the representation of interpreted-text-escapes in the lexer, so
  that we are not tied to the strict Unicode of Rust's `str`.
- Move some doc-comment code from the parser to test utilities.
- Simplify token serialization.
2024-04-18 09:21:05 -04:00
Hubert Plociniczak
a444934806
Fix bundled engine after GraalVM upgrade (#9735)
The change fixes the problem with suggestions loading by
1. Making sure that bundle is always the first on the search path for editions and engine
2. Passing language home to language server

Verified by building/running AppImage locally (previously would fail).

Closes #9728. Regressed in #9647.
2024-04-18 10:14:34 +00:00
Jaroslav Tulach
c8dcd48f1a
Support also COMMAND_RUN and COMMAND_DEBUG actions (#9041)
Turns out that #8923 isn't enough to support debugging of `Vector_Spec.enso` when root of Enso repository is opened as a folder/workspace. To allow debugging of `Vector_Spec.enso` two changes are needed. One is provided in this PR, the other one will be integrated as https://github.com/apache/netbeans/pull/7105
2024-04-18 04:42:49 +00:00
GregoryTravis
86ecd3e027
Add Decimal.floor, .ceil, and .trunc (#9694) 2024-04-17 18:42:38 +00:00
Radosław Waśko
34f3331561
Implement recursive argument for File.delete (#9719)
- Closes #8993
2024-04-17 16:53:45 +00:00
Radosław Waśko
0310eb46ab
Highlight stack trace elements from the current project in Test suite reports (#9724)
If ANSI coloring is enabled, stack trace entries corresponding to the currently running project will be highlighted in bold:
![image](https://github.com/enso-org/enso/assets/1436948/b02da409-b67c-421c-a6d0-07a6cbbaf5f8)
2024-04-17 13:22:29 +00:00
Radosław Waśko
41a39eb019
Fix Json.parse "" edge case and add a test for it (#9722)
- Fixes #9720
2024-04-17 08:48:48 +00:00
Hubert Plociniczak
d6f7afc624
Open Java modules for Snowflake setup (#9664)
# Important Notes
Some workarounds are being considered but we need this change sooner than later.
2024-04-16 21:01:32 +00:00
Radosław Waśko
fda41cbfd1
Writing Cloud files (#9686)
- Closes #9291
2024-04-16 14:01:03 +00:00
Sergei Garin
30a80db4b0
Refetch user session when it expires (#9632) 2024-04-16 11:21:26 +00:00