Commit Graph

2555 Commits

Author SHA1 Message Date
Ilya Bogdanov
1a87e47729
Hide skip and freeze buttons behind feature flag (#4109)
[Task](https://www.pivotaltracker.com/story/show/184347909)

Skip and freeze buttons are no longer visible by default.
2023-02-03 13:52:51 +00:00
Hubert Plociniczak
50f376e365
JGit should run its bookkeeping in the background (#4116)
JGit ops generally run fast (as in a few milliseconds) except for the first commit. The initialization + first commit was taking at least 3.5 seconds constistenly, but only in the first test case. Now, this led to frequent timeouts down the chain when the request was expected to finish fast.
The bookkeeping involved some timestamping and other expensive calls in order to calculate clock drift. The default appears to be to run it in a blocking mode, hence adding at least 3 seconds to the first command call.

Setting the job to run in the background makes the cost of the repo initialization acceptable (~300 milliseconds on a cold JVM). The other commands are unaffected and take < 10 milliseconds.

# Important Notes
Added a test to ensure that we don't introduce the regression. Marked it as potentially flaky because it uses timestamps and it is  therefore prone to random system hiccups.
2023-02-03 10:37:28 +00:00
Michael Mauderer
349cc210e0
Bump rustc to nightly-2023-01-12 (#4053)
Bump rustc nightly-2022-08-30 and fix new errors and lints.
https://www.pivotaltracker.com/story/show/184229094
2023-02-02 23:05:25 +00:00
Michał Wawrzyniec Urbańczyk
b8a4a70f10
Cloud fixes (#4114)
This PR aims to fix current issues with cloud IDE.

1. Backend image:
  * bumping the system version to avoid glibc version mismatch on parser;
  * explicitly installing required GraalVM components;

2. Frontend upload:
  * update to follow the new file naming;
  * uploading the whole shaders subtree.
2023-02-02 20:34:45 +01:00
Michał Wawrzyniec Urbańczyk
29582b7ee1
Fix for the cargo-installed build script usage. (#4096)
Use both current directory and current exe location for deducing the repository root location.
2023-02-02 20:34:20 +01:00
Ilya Bogdanov
89dc7a5726
Mark nodes with yellow stripes if their evaluation produced warnings (#4101)
[Task](https://www.pivotaltracker.com/story/show/184237388)

Nodes with warnings are highlighted with yellow stripes. Colors for dataflow errors and panics also changed.


https://user-images.githubusercontent.com/6566674/216285009-9d29eb84-f663-4f2e-a6c8-4c4f593bd1ef.mp4
2023-02-02 17:03:46 +00:00
Ilya Bogdanov
0a6e58fc99
Fix documentation locking while moving around with arrow keys (#4108)
Fixes [bug](https://www.pivotaltracker.com/story/show/184367981). It also sets the display delay to 0, as requested by @wdanilo


https://user-images.githubusercontent.com/6566674/215985281-e1abb094-a776-4863-b556-daca638cc5e1.mp4
2023-02-02 14:28:25 +00:00
James Dunkerley
dcd6d740bb
Fix bug with Delimited_Format web reader. (#4112)
- Mistake using `if_nothing` not `is_nothing`.
- Cache the File_Format types to save calling over and over.
2023-02-02 07:11:49 +00:00
Adam Obuchowicz
a103c8d82f
Cached_shape macro rendered to special texture. (#4089)
This PR contains the first implementation of `cached_shape!` macro, which should help us with reducing draw calls in our application.

```rust
mod icon1 {
use super::*;
ensogl_core::cached_shape! { 32 x 32;
() {
let shape = Circle(16.px()).fill(color::Rgba::green());
shape.into()
}
}
}

mod icon2 {
use super::*;
ensogl_core::cached_shape! { 202 x 312;
() {
let shape = Rect((200.px(), 310.px())).fill(color::Rgba::red());
shape.into()
}
}
}
```

The above code creates two cached shapes. They are similar to normal shapes (created with `shape!` macro), except that:
1. they do not allow for any parametrization
2. They are rendered at the application start to the special texture with cached shapes.

The texture will be used in next PRs to cache all Component Browser icons on the texture and draw all of them just by single, fast draw call. In the future, more shapes can be cached, further reducing draw calls and making them simple.

# Important Notes
The results are presented in `cached_shapes` debug scene: there are two shapes displayed and a scaled cached texture is displayed in the background.
2023-02-01 17:58:20 +00:00
Jaroslav Tulach
6735fa99c8
Prevent errors in log when closing a context (#4107)
Hold all executors associated with `EnsoContext` and close them when the context is being closed.
2023-02-01 16:27:45 +00:00
Hubert Plociniczak
a618dd6901
Don't attempt to access JGit config in VCS ops (#4105)
There is no need for JGit to try to save file attributes to its config in `<home>/jgit/config`. This change ensures that JGit operates on a stub file, without polluting users' configs, similarly to user's git config.

Additionally, noticed that all FS operations during `init` are rather slow and saw at least on one occassion when the handler timed out because of that (https://www.pivotaltracker.com/story/show/184359934). This change provides an init-specific timeout for `vcs/init`.

# Important Notes
This change should reduce chances of failures during VCS initialization.
2023-01-31 21:57:57 +00:00
James Dunkerley
0790ce494f
New set function, parse a column (#4097)
- New `set` function design - takes a `Column` and works with that more easily and supports control of `Set_Mode`.
- New simple `parse` API on `Column`.
- Separated expression support for `filter` to new `filter_by_expression` on `Table`.
- New `compute` function allowing creation of a column from an expression.
- Added case sensitivity argument to `Column` based on `starts_with`, `ends_with` and `contains`.
- Added case sensitivity argument to `Filter_Condition` for `Starts_With`, `Ends_With`, `Contains` and `Not_Contains`.
- Fixed the issue in JS Table visualisation where JavaScript date was incorrectly set.
- Some dynamic dropdown expressions - experimenting with ways to use them.
- Fixed issue with `.pretty` that wasn't escaping `\`.
- Changed default Postgres DB to `postgres`.
- Fixed SQLite support for starts_with, ends_with and contains to be consistent (using GLOB not LIKE).
2023-01-31 20:48:16 +00:00
Radosław Waśko
c965ad3455
Review Table.order_by (#4104) 2023-01-31 18:29:02 +00:00
Hubert Plociniczak
d3b350f460
Custom type conversion to double from large long (#4099)
When a large long would be passed to a host call expecting a double, it would crash with a
```
Cannot convert '<some long>'(language: Java, type: java.lang.Long) to Java type 'double': Invalid or lossy primitive coercion
```

That is unlikely to be expected by users. It also came up in the Statistics examples during Sum. One could workaround it by forcing the conversion manually with `.to_decimal` but it is not a permanent solution.

Instead this change adds a custom type mapping from Long to Double that will do it behind the scenes with no user interaction. The mapping kicks in only for really large longs.

# Important Notes
Note that the _safe_ range is hardcoded in Truffle and it is not accessible in enso packages. Therefore a simple c&p for that max safe long value was necessary.
2023-01-31 15:13:00 +00:00
Ilya Bogdanov
945aa2b2d7
Avoid relying on order of updates for hierarchy index (#4094)
[Task](https://www.pivotaltracker.com/story/show/184279344).

This PR fixes the hierarchy index of the suggestion database and removes a bunch of warnings from the console:

![image](https://user-images.githubusercontent.com/6566674/215051255-6cb22349-1e72-4717-96c0-66db9bf2020f.png)

Now we also correctly display documentation for all types. Previously some methods, namely for the `Text` type, were not present in the documentation. No visual changes to IDE were made.
2023-01-31 12:52:09 +00:00
Paweł Buchowski
9002df986e
Fix missing /home/ensodev directory (#4103)
The new jgit integration tries to create config file in ~/.config/jgit/config. We are creating default ensodev with explicit `-M, --no-create-home`. As long as there wasn't any strong reasoning behind that this commit changes it to fix problems with initialising jgit.

Error that this PR fixes:

```
Jan 30 11:21:47 ip-172-31-0-83.eu-west-1.compute.internal enso_runtime[3853]: [error] [2023-01-30T11:21:47.185Z] [org.eclipse.jgit.util.FS] Cannot save config file 'FileBasedConfig[/home/ensodev/.config/jgit/config]'
Jan 30 11:21:47 ip-172-31-0-83.eu-west-1.compute.internal enso_runtime[3853]: java.io.IOException: Some(Creating directories for /home/ensodev/.config/jgit failed)
Jan 30 11:21:47 ip-172-31-0-83.eu-west-1.compute.internal enso_runtime[3853]:   at org.eclipse.jgit.util.FileUtils.mkdirs(FileUtils.java:413)
Jan 30 11:21:47 ip-172-31-0-83.eu-west-1.compute.internal enso_runtime[3853]:   at org.eclipse.jgit.internal.storage.file.LockFile.lock(LockFile.java:140)
Jan 30 11:21:47 ip-172-31-0-83.eu-west-1.compute.internal enso_runtime[3853]:   at org.eclipse.jgit.storage.file.FileBasedConfig.save(FileBasedConfig.java:184)
Jan 30 11:21:47 ip-172-31-0-83.eu-west-1.compute.internal enso_runtime[3853]:   at org.eclipse.jgit.util.FS$FileStoreAttributes.saveToConfig(FS.java:761)
Jan 30 11:21:47 ip-172-31-0-83.eu-west-1.compute.internal enso_runtime[3853]:   at org.eclipse.jgit.util.FS$FileStoreAttributes.lambda$5(FS.java:443)
Jan 30 11:21:47 ip-172-31-0-83.eu-west-1.compute.internal enso_runtime[3853]:   at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
Jan 30 11:21:47 ip-172-31-0-83.eu-west-1.compute.internal enso_runtime[3853]:   at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
Jan 30 11:21:47 ip-172-31-0-83.eu-west-1.compute.internal enso_runtime[3853]:   at java.base/java.lang.Thread.run(Thread.java:829)
```
2023-01-31 10:39:20 +00:00
Jaroslav Tulach
f54464881f
enso4igv can open engine/language-server & co. projects (#4098)
In order to investigate `engine/language-server` project, I need to be able to open its sources in IGV and NetBeans.

# Important Notes
By adding same Java source (this time `package-info.java`) and compiling with our Frgaal compiler the necessary `.enso-sources*` files are generated for `engine/language-server` and then the `enso4igv` plugin can open them and properly understand their compile settings.

![Logical View of language-server project](https://user-images.githubusercontent.com/26887752/215472696-ec9801f3-4692-4bdb-be92-c4d2ab552e60.png)

In addition to that this PR enhances the _"logical view"_ presentation of the project by including all source roots found under `src/*/*`.
2023-01-31 08:40:04 +00:00
Dmitry Bushev
3de488fc46
Fix vcs-restore edit notification (#4100)
Changelog:
- fix: vcs/restore sends proper text edit
- refactor: restore original `OpenFileNotification` name
2023-01-30 21:08:30 +00:00
Hubert Plociniczak
be91b1e8dd
Create static wrappers for builtin types (#4077)
https://github.com/enso-org/enso/pull/3764 introduced static wrappers for instance methods. Except it had a limitation to only be allowed for types with at least a single constructor.
That excluded builtin types as well which, by default, don't have them. This limitation is problematic for Array/Vector consolidation and makes builtin types somehow second-citizens.

This change lifts the limitation for builtin types only. Note that we do want to share the implementation of the generated builtin methods. At the same time due to the additional argument we have to adjust the starting index of the arguments.
This change avoids messing with the existing dispatch logic, to avoid unnecessary complexity.

As a result it is now possible to call builtin types' instance methods, statically:
```
arr = Array.new_1 42
Array.length arr
```
That would previously lead to missing method exception in runtime.

# Important Notes
The only exception is `Nothing`. Primarily because it requires `Nothing` to have a proper eigentype (`Nothing.type`) which would messed up a lot of existing logic for no obvious benefit (no more calling of `foo=Nothing` in parameters being one example).
2023-01-30 19:54:51 +00:00
Radosław Waśko
b9dbfd036f
First steps of the Problem Handling refactor to the new design (#4086)
Implements:
- https://www.pivotaltracker.com/story/show/184226137
- https://www.pivotaltracker.com/story/show/184226434
- https://www.pivotaltracker.com/story/show/184226462
2023-01-30 16:48:06 +00:00
Dmitry Bushev
6b912968e4
Send all pending expressions (#4006)
For graying out the nodes, the engine need to send IDE a set of values that will be computed before executing the program (and the IDE colors them gray). In general, it is tricky to do because we cannot know for sure which exactly nodes will be computed without running the program. But we can estimate based on the invalidated values, which nodes are expected to be executed during the next run, and send them to the IDE. This logic is simpler than the previous approach, and turned out working pretty well in practice.

[Peek-gray-out.webm](https://user-images.githubusercontent.com/357683/215092755-0010e41d-a2cf-447a-900e-4619408effa0.webm)
2023-01-30 11:46:44 +00:00
Jaroslav Tulach
53efcf0a17
Propagate subjectToInstrumentation flag via ExpressionProcessor (#4090)
`subjectToInstrumentation` needs to be propagated via `ExpressionProcessor`.
2023-01-30 05:48:19 +00:00
Dmitry Bushev
7e8f49e86f
vcs/restore triggers execution (#4095)
Changelog:
- update: `vcs/restore` command triggers program execution
2023-01-28 06:09:23 +00:00
Ilya Bogdanov
3ad4689dfa
Allow removing all nodes from the scene (#4084)
Fixes [bug](https://www.pivotaltracker.com/story/show/184272392).


https://user-images.githubusercontent.com/6566674/214796891-d0cd0bb3-28ce-41fc-b3a2-2bb93fd9d96c.mp4
2023-01-28 04:37:40 +00:00
Dmitry Bushev
b65dd1f3fe
Warnings API (#4093)
Add information about warngins associated with the value to the expression update payload.
2023-01-28 03:13:38 +00:00
Wojciech Daniło
ce5b078130
Dependency cleaning (#4092) 2023-01-27 23:39:37 +01:00
Hubert Plociniczak
9b26077775
Provide better diagnostics when handlers crash (#4091)
In the event when the action of the underlying actor crashes really bad, the result of the future will be `Failure`. All such results will be then wrapped in `Status.Failure` via `pipeTo` (unlike `Success` which just forwards the response).

In some cases we don't handle `Status.Failure` messages, meaning we are rather left in the dark to the reason of the failure with a non-informative message `Received unknown message: class akka.actor.Status$Failure`.

I'm keeping this change small on purpose to keep this change self-contained. I think there are more cases but it needs careful investigation into how messages are being sent.

# Important Notes
This PR does not attempt to fix the underlying problem of the ticket, yet. We should however have a better overview where/why things go wrong.
2023-01-27 10:54:37 +00:00
Wojciech Danilo
a84f8c25e8 Fixing broken Electron configuration. 2023-01-27 06:45:41 +01:00
Ilya Bogdanov
9e4dd9d708
Documentation display delay and hovered item preview caption (#4075)
This PR adds a configurable delay before displaying documentation ([task](https://www.pivotaltracker.com/story/show/183970872)) and a "hovered item preview" caption on top of the panel when you hover some not-selected entry. ([task](https://www.pivotaltracker.com/story/show/183970838)). The caption design will be adjusted in a future PR with a style update.


https://user-images.githubusercontent.com/6566674/214233481-10550fcf-a106-4b11-b5a2-15283745cbbf.mp4
2023-01-27 01:34:35 +00:00
Wojciech Daniło
da84e34b9a
Shaders precompilation (#4003) 2023-01-27 01:09:09 +01:00
Jaroslav Tulach
ca2f108513
Enable asserts in the tests (#4074)
Enso unit tests were running without `-ea` check enabled and as such various invariant checks in Truffle code were not executed. Let's turn the `-ea` flag on and fix all the code misbehaves.
2023-01-26 21:41:35 +00:00
Hubert Plociniczak
ad6419f204
Reload module's sources when LS reloads buffer (#4083)
LS needs to notify runtime that modules' sources need to be reloaded from FS, once its own buffer has been reloaded as well.

# Important Notes
Discovered during integration of https://github.com/enso-org/enso/pull/4050.
The test illustrates the problem if we don't reload module's sources - the sources essentially become stale even though they have changed.
2023-01-26 19:07:54 +00:00
Kaz Wesley
1097c41297
Fix lexing bug encountered when doc-comments contain space-only lines (#4070)
See: https://www.pivotaltracker.com/story/show/184249780
2023-01-26 12:53:20 +00:00
Michał W. Urbańczyk
0a89d75d68 Added -f flag to gu install invocation to see if it helps with installing native-image. 2023-01-26 12:12:21 +01:00
James Dunkerley
359d4f56df
Initial Widget Dynamic Metadata (#4082)
Adjusts the old mock to use new attributes.
Expanded examples for dynamic widgets.
2023-01-25 14:16:10 +00:00
James Dunkerley
60f0e96047
Update starts_with, ends_with and contains to new API design (#4078)
- Updated `Text.starts_with`, `Text.ends_with` and `Text.contains` to new simpler API.
- Added a `Case_Sensitivity.Default` and adjusted `Table.distinct` to use it by default.
- Fixed a bug with `Data.fetch` on an HTTP error.
- Improved SQLite Case Sensitivity control in distinct to use collations.
2023-01-25 11:47:27 +00:00
Dmitry Bushev
3dbceef163
Default visualization preprocessor handles errors (#4080)
When the function is visualized with the `default_preprocessor` method, it returns a dataflow error that shows up in the logs as
```
Cannot encode class org.enso.interpreter.runtime.error.DataflowError to byte array.
```

PR handles dataflow errors in the preprocessor and fallbacks the `to_display_text` value. As a bonus, we get a function visualization.
2023-01-25 03:37:21 +00:00
Radosław Waśko
778d28fba3
Table with no columns is not valid, No_Output_Columns is always an error (#4073)
Implements https://www.pivotaltracker.com/story/show/184226020
2023-01-25 02:40:23 +00:00
Ilya Bogdanov
366f231765
New documentation panel (#4066)
This PR implements HTML generation from documentation IR for all suggestion database entries and replaces the old documentation panel with a newer one.

Additional adjustments to the looks of the documentation would be applied separately in a future PR. This PR focuses on the fastest possible delivery of a usable documentation panel. We want to test it in real-world use cases and gather feedback for future improvements.

Documentation demo scene with mocked data:

https://user-images.githubusercontent.com/6566674/213436313-88753ed8-346f-423e-956e-7db39f5dc266.mp4


Component browser with actual engine-provided data:


https://user-images.githubusercontent.com/6566674/213436375-d0ec074b-f7a6-4deb-a7de-3adee999cc86.mp4

# Important Notes
- Fixed language protocol data structures.
- Scrolling to the selected method is also implemented here.
- Also, the selected item is highlighted with yellow.
- Only some pieces of information we have are displayed. For example, we don't display return types for methods or types of arguments.
- A bunch of code related to previous implementation is removed, but probably not all of it.
2023-01-25 01:10:10 +00:00
Hubert Plociniczak
c85377f0ac
Eliminate various compiler warnings (#4079)
Slipped through review of https://github.com/enso-org/enso/pull/3862
2023-01-24 22:58:35 +00:00
Michael Mauderer
38906b39da
Implement Lazy Text Visualisation. (#3910)
Implements [#183453466](https://www.pivotaltracker.com/story/show/183453466).

https://user-images.githubusercontent.com/1428930/203870063-dd9c3941-ce79-4ce9-a772-a2014e900b20.mp4

# Important Notes
* the best laziness is used for `Text` type, which makes use of its internal representation to send data
* any type will first compute its default string representation and then send the content of that lazy to the IDE
* special handling of files and their content will be implemented in the future
* size of the displayed text can be updated dynamically based on best effort information: if the backend does not yet know the full width/height of the text, it can update the IDE at any time and this will be handled gracefully by updating the scrollbar position and sizes.
2023-01-24 20:55:36 +00:00
Dmitry Bushev
bf9508603f
Add Meta.get_annotation (#4049)
- add: `GeneralAnnotation` IR node for `@name expression` annotations
- update: compilation pipeline to process the annotation expressions
- update: rewrite `OverloadsResolution` compiler pass so that it keeps the order of module definitions
- add: `Meta.get_annotation` builtin function that returns the result of annotation expression
- misc: improvements (private methods, lazy arguments, build.sbt cleanup)
2023-01-24 21:28:33 +03:00
Michael Mauderer
5b5a2be829
Use focus information to prevent new node creation on pressing enter in Project Name and Code Editor. (#4068)
This PR fixes the Component Browser opening when pressing enter while editing either the Project Name or the text in the Code Editor. This is achieved by using our focus management system to check whether something is focused. The Component Browser only appears if nothing else is focused.
2023-01-24 15:09:39 +00:00
Marcin Kostrzewa
242bd52942
Unboxed atoms (#3862)
Introduces unboxed (and arity-specialized) storage schemes for Atoms. It results in improvements both in memory consumption and runtime.
Memory wise: instead of using an array, we now use object fields. We also enable unboxing. This cuts a good few pointers in an unboxed object. E.g. a quadruple of integers is now 64 bytes (4x8 bytes for long fields + 16 bytes for layout and constructor pointers + 16 bytes for a class header). It used to be 168 bytes  (4x24 bytes for boxed Longs + 16 bytes for array header + 32 bytes for array contents +  8 bytes for constructor ptr  + 16 bytes for class header), so we're saving 104 bytes a piece. In the least impressive scenarios (all-boxed fields) we're saving 8 bytes per object (saving 16 bytes for array header, using 8 bytes for the new layout field). In the most-benchmarked case (list of longs), we save 32 bytes per cons-cell.
Time wise:
All list-summing benchmarks observe a ~2x speedup. List generation benchmarks get ~25x speedups, probably both due to less GC activity and better allocation characteristics (only allocating one object per Cons, rather than Cons + Object[] for fields). The "map-reverse" family gets a neat 10x speedup (part of the work is reading, which is 2x faster, the other is allocating, which is now 25x faster, we end up with 10x when combined).
2023-01-24 13:03:06 +00:00
Radosław Waśko
d2e57edc8b
Add Table.cross_join and Table.zip to In-Memory Table (#4063)
Implements https://www.pivotaltracker.com/story/show/184239059
2023-01-23 13:19:52 +00:00
Galin Bajlekov
aa995110e9
Separate component browser sections for every namespace libraries are imported from (#4044)
This PR adds new sections to the component browser section navigator bar. The sections are based on the namespaces from which libraries are imported. Selecting a namespace section from the navigator bar highlights the modules from that namespace. Selecting a module from a different namespace switches the navigator bar indicator to the correct namespace category. The currently selected namespace is also shown as the root of the breadcrumbs.

https://user-images.githubusercontent.com/117099775/212144719-2470a99d-8d8c-47ca-ab50-5bac65468090.mp4

For a new project where only the `Standard` namespace exists the only visible change is the breadcrumbs. Adding for example additional modules in the project `src` folder will create them in the `local` namespace, this namespace will show up as a separate navigator section.
2023-01-23 11:57:17 +00:00
Hubert Plociniczak
86eee6199d
Fix TextEdit range (#4069)
Typo: TextEdit's range should refer to the old buffer's range rather than the new one.
2023-01-20 11:31:16 +00:00
Paweł Grabarz
a5df4d4716
handle compiler job cancelation in shader cache (#4061)
This is a followup to https://github.com/enso-org/enso/pull/4046#pullrequestreview-1248164069.

- Compiler job cancelation is now handled - the cache entry will be cleared or the job will be resumed if there is still demand.
- The compilation awaiting process has been rewritten to not use polling. The "read cache" job is now only used to dispatch known valid reads. It is always completed within a single run cycle.
- Changed shader struct to use `ImString` for storing code, so it can be cheaply cloned. This is now common, as we are cloning it from cache.
2023-01-20 10:27:18 +00:00
Kaz Wesley
591cacb79a
Reject @ as binary operator (#4021)
`@` should not be legal to use as a binary operator. I accepted it in the parser because it occurred in the .enso sources, but it was actually used to create a syntax error to test error recovery.

See: https://www.pivotaltracker.com/story/show/184054024
2023-01-19 20:31:14 +00:00
Kaz Wesley
f39070abef
Rename option to --wasm-log-level; small refactoring (#4060)
Rename the CLI option to set the WASM log level; applied some suggested simplifications, to `LogLevel` and to the type it was based on.

# Important Notes
This addresses review of #4017.
2023-01-19 17:27:21 +00:00