Commit Graph

3793 Commits

Author SHA1 Message Date
Hubert Plociniczak
61a0c8ce3f
Error on invalid capability acquire/release request (#8133)
`capability/acquire` with an invalid method `executionContext/canModify` would previously timeout because the capability router simply didn't support that kind of capability request.
Now rather than timing out, indicating a failure on LS, we report an error.

Closes #8038.
2023-10-24 13:01:10 +00:00
Radosław Waśko
c1259cb4d2
Compare performance of Panic / Java Exception / Dataflow error (#8130)
After a discussion, I was really curious that our panics are supposed to be almost free - and while trusting that statement, it was really hard to believe - so I wanted to see for myself - knowing that an experiment is the most robust source of this kind of information - testing that in practice.

So I wrote a benchmark comparing various ways of reporting errors, also testing them both at 'shallow' and 'deep' stack traces (adding 200 additional frames) - to see how stack depth affects them, if at all.

The panics are indeed blazing fast! Kudos to the engine team. However, it seems that our dataflow errors are relatively slow (and we tend to use them _more_ than panics and want to be using them more and more). This uncovers a possible optimization opportunity. Can we make them as fast as panics??

Analysis of the benchmark results in comment below.
2023-10-24 12:03:44 +00:00
Jaroslav Tulach
e283c78977
Properly convert defaulted arguments before on_call back (#8143) 2023-10-24 13:39:54 +02:00
Jaroslav Tulach
08c9ecb540
Simplify code to run in the browser (#8092)
In order to execute `runtime-parser` in browser, we need to slightly simplify dependencies of our code.

# Important Notes
The actual PR explaining why these changes are desirable is #8094
2023-10-23 14:16:15 +00:00
somebody1234
03b7613e3c
Remove Playwright tests from Lint CI action (#8108)
Disables visual tests, because they are occasionally flaky (e.g. the recent issues with lint CI action).
This is very bad as it would cause every PR to (potentially) cause other PRs to fail, if the flaky test is not caught in the CI runs in the offending PR.

# Important Notes
None
2023-10-23 12:11:10 +00:00
Radosław Waśko
1114a9bcff
Fix incremental compilation of SPI in Java helper libraries (#8129)
- Fixes the issue that sometimes occurred on CI where old `services` configuration was not cleaned and SPI definitions were leaking between PRs, causing random failures:
```
 should allow selecting table rows based on a boolean column
An unexpected panic was thrown: java.util.ServiceConfigurationError: org.enso.base.file_format.FileFormatSPI: Provider org.enso.database.EnsoConnectionSPI not found
```
- The issue is fixed by detecting unknown SPI classes before the build, and if such classes are detected, cleaning the config and forcing a rebuild of the given library to ensure consistency of the service config.
2023-10-23 09:14:35 +00:00
Adam Obuchowicz
675fff07de
Local scope filtering (#8109)
The "Local scope filtering" button works now.

![image](https://github.com/enso-org/enso/assets/3919101/6cf6858f-0fdb-4f39-925d-9973e1ef9659)
2023-10-23 10:18:10 +02:00
somebody1234
2b671a16e1
Drag and drop for labels (#8097)
- Closes https://github.com/enso-org/cloud-v2/issues/721
  - Drag-n-drop for adding labels to an asset
    - Adds to a single asset when hovering over an asset that is not selected
    - Adds to all selected assets when hovering over an asset that is selected

### Important Notes
- The backend endpoint for associating labels with assets is currently broken - specifically, it errors when the new list of assets is empty.
2023-10-23 09:13:03 +02:00
Radosław Waśko
0c278391fe
Test and improve handling of Date_Time with_timezone=False in Postgres (#8114)
- Fixes #8049
- Adds tests for handling of Date_Time upload/download in Postgres.
- Adds tests for edge cases of handling of Decimal and Binary types in Postgres.
2023-10-21 21:35:13 +00:00
Dmitry Bushev
b1df8b1889
Initialize suggestions database only once (#8116)
close #8033

Changelog:
- update: run language server initialization once
- fix: issues with async `getSuggestionDatabase` message handling in new IDE
- update: implement unique background jobs
- refactor: initialization logic to Java
- refactor: `UniqueJob` to a marker interface
2023-10-21 20:32:13 +00:00
somebody1234
8fc720a1a2
Move Rect to util/ (#8121)
`rect.ts` is not a store, and hence does not belong in `stores/`

# Important Notes
None
2023-10-20 15:20:09 +00:00
Radosław Waśko
8172896065
Support Previous_Value in fill_nothing and fill_missing (#8105)
- Adds `Previous_Value` to `fill_nothing` and `fill_empty`, as requested by #7192.
2023-10-20 13:18:53 +00:00
Adam Obuchowicz
1391dd93f4
Applying suggestions in the Component Browser (#8036)
Fixes #7993 

Added code for applying selected suggestion.

https://github.com/enso-org/enso/assets/3919101/c5ff116c-3fa9-4a98-ba03-cba404e96c82

### Important Notes

Found one issue in reading AST children and fixed it.

---------

Co-authored-by: Paweł Grabarz <frizi09@gmail.com>
2023-10-20 13:08:35 +02:00
Hubert Plociniczak
cd94b388d1
Report human-readable names for shadowed parameters (#8115)
Improved warning reporting by not reporting IR in user-directed warning
messages. Made sure that fresh names retain some knowledge of the name
which they were created from.

Closes #7963.
2023-10-20 09:01:52 +00:00
somebody1234
a9387cd051
Remove flaky screenshot for labels VRT (#8106)
Removes a test that is causing issues in CI

# Important Notes
None
2023-10-20 05:33:26 +00:00
somebody1234
895326d4ed
Highlight matches in CB (#8098)
- Closes #8062

# Important Notes
- This PR uses a completely separate implementation from the regexes used for the existing filtering. AFAICT, this is unavoidable, since this needs to retrieve matched text.
- I've come across a couple minor bugs related to the Component Browser:
- When deleting text (backspacing), the full list of unfiltered entries momentarily reappear because the filtering is reset.
- Things like `h.m` match `HTTP_Method` - if this is not intentional, it seems like it might be more difficult to fix, unfortunately.
- Note that highlighting (I assume correctly?) *does not* highlight any part of `HTTP_Method`.
2023-10-19 15:08:56 +00:00
Hubert Plociniczak
aa88dfeb2f
More debug info for failed edits (#8107)
Unmasked position info for the failed edits so that it is possible to understand what edits are attempted at all. So far unable to locate the problem based solely on the logs and the stacktrace. Added a test confirming that making edits at the end of the file continues to be fine (that's where the problem usually manifests itself).

# Important Notes
References #7978
2023-10-19 13:46:42 +00:00
Kaz Wesley
2edd2bd7ff
Ensure all spans have document offsets (#8039)
- Validate spans during existing lexer and parser unit tests, and in `enso_parser_debug`.
- Fix lost span info causing failures of updated tests.

# Important Notes
- [x] Output of `parse_all_enso_files.sh` is unchanged since before #7881 (modulo libs changes since then).
- When the parser encounters an input with the first line indented, it now creates a sub-block for lines at than indent level, and emits a syntax error (every indented block must have a parent).
- When the parser encounters a number with a base but no digits (e.g. `0x`), it now emits a `Number` with `None` in the digits field rather than a 0-length digits token.
2023-10-19 12:36:42 +00:00
Adam Obuchowicz
24b9a1179e
Fix (#8099)
A bug was discovered during my development of a (later discarded) branch.
2023-10-19 12:28:36 +00:00
Kaz Wesley
1a5437d388
Tree traversal API (#8096)
Implements #8025: `LazyObject` now has a `visitChildren` method that observes each direct-child `LazyObject`. `childrenAstNodes` is now a simple function that flattens non-Tree nodes out of the hierarchy; `validateSpans` visits both `Tree`s and `Token`s the same way we would use the `ItemVisitor` Rust API.
2023-10-19 11:08:07 +00:00
James Dunkerley
ad95dc9815
Fixes for Table viz (#8102)
- Fixes issue with `to_display_text` on `Date_Time`. Now a reversible format.
- Adjusted the auto width code on table so it works.
- Manually sized columns should remain fixed size.
- Enable Excel range style selection in table.
- Removed page support as not implemented yet.

# Important Notes
Will need to apply to Vue based viz at some point as well.
2023-10-19 08:22:23 +00:00
GregoryTravis
c72f8ce06a
Pass problem aggregator in expand_to_rows (#8103)
Fixing a test failure caused by new requirement for inferred builders.
2023-10-19 08:21:44 +00:00
GregoryTravis
7383db0e04
Restructuring XML into Table form (#8083)
# Important Notes
Adds `.to Table` support, as well as XML support for `expand_column`.
2023-10-19 07:02:48 +00:00
Hubert Plociniczak
ab2da9e436
Ambiguous imports warnings/errors are serializable (#8093)
`AmbgiuousImport` error and `DuplicatedImport` warning must not have `Source` as one of its fields or compiler will crash during a serialization attempt.
Changed the implementation to provide it as a parameter to the `message` method instead.

Fixes #8089
2023-10-18 21:51:58 +00:00
Radosław Waśko
28fc183f92
Review places where we can use Column_Ref (#8101)
Closes #8046
2023-10-18 19:03:50 +00:00
Radosław Waśko
93a31fcc8b
Add benchmarks related to add_row_number performance investigation (#8091)
- Follow-up of #8055
- Adds a benchmark comparing performance of Enso Map and Java HashMap in two scenarios - _only incremental_ updates (like `Vector.distinct`) and _replacing_ updates (like keeping a counter for each key). These benchmarks can be used as a metric for #8090
2023-10-18 17:21:59 +00:00
Ilya Bogdanov
cec115d25b
Snap CB position to pixel boundary (#8095)
* Snap CB position to pixel boundary

* Apply review comments
2023-10-18 14:33:45 +02:00
somebody1234
9e9860d0e7
Disable remote logging (#8087)
- Closes https://github.com/enso-org/cloud-v2/issues/722
- Completely disables remote logging

# Important Notes
This is a temporary fix - GUI2 should have remote logging, but it may need a reimplemented entrypoint anyway.
2023-10-18 09:36:49 +00:00
Hubert Plociniczak
0b58a361ed
Eliminate VCS TimeoutExceptions on startup (#8080)
Having a modest-size files in a project would lead to a timeout when the project was first initialized. This became apparent when testing delivered `.enso-project` files with some data files. After some digging there was a bug in JGit
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=494323) which meant that adding such files was really slow. The implemented fix is not on by default but even with `--renormalization` turned off I did not see improvement.
In the end it didn't make sense to add `data` directory to our version control, or any other files than those in `src` or some meta files in `.enso`. Not including such files eliminates first-use initialization problems.

# Important Notes
To test, pick an existing Enso project with some data files in it (> 100MB) and remove `.enso/.vcs` directory. Previously it would timeout on first try (and work in successive runs). Now it works even on the first try.

The crash:
```
[org.enso.languageserver.requesthandler.vcs.InitVcsHandler] Initialize project request [Number(2)] for [f9a7cd0d-529c-4e1d-a4fa-9dfe2ed79008] failed with: null.
java.util.concurrent.TimeoutException: null
at org.enso.languageserver.effect.ZioExec$.<clinit>(Exec.scala:134)
at org.enso.languageserver.effect.ZioExec.$anonfun$exec$3(Exec.scala:60)
at org.enso.languageserver.effect.ZioExec.$anonfun$exec$3$adapted(Exec.scala:60)
at zio.ZIO.$anonfun$foldCause$4(ZIO.scala:683)
at zio.internal.FiberRuntime.runLoop(FiberRuntime.scala:904)
at zio.internal.FiberRuntime.evaluateEffect(FiberRuntime.scala:381)
at zio.internal.FiberRuntime.evaluateMessageWhileSuspended(FiberRuntime.scala:504)
at zio.internal.FiberRuntime.drainQueueOnCurrentThread(FiberRuntime.scala:220)
at zio.internal.FiberRuntime.run(FiberRuntime.scala:139)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:49)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
```
2023-10-18 09:34:08 +00:00
somebody1234
b039f92598
Fix issue with circular import (#8078)
A recent PR introduced issues with circular imports in `categorySwitcher.ts` - the reason why this wasn't found before merge is because bundlers work fine with circular imports - it's just GUI2's dev mode that doesn't do well with them

# Important Notes
None
2023-10-17 09:17:08 +00:00
somebody1234
c5825719e9
Labels (#8008)
- Closes https://github.com/enso-org/cloud-v2/issues/676
- Adds labels to the dashboard:
- Filtering assets by label
- Creating new labels
- Displaying labels in "Labels" column
- Adding a new label to an existing asset (multi-select)

# Important Notes
WIP: Use a color picker with pre-defined colors, instead of randomly generated colors
2023-10-17 06:53:47 +00:00
Radosław Waśko
e9fa12763e
Improve performance of add_row_number (#8076)
Fixes #8055
2023-10-17 00:42:35 +00:00
Michał Wawrzyniec Urbańczyk
b51b986935
Third-party action bumps. (#8060) 2023-10-17 00:59:52 +02:00
somebody1234
1fd3a037ad
Avoid relative imports whenever possible (#8074)
- Change imports from `'./'` relative imports to `@/` or `shared/` whenever possible
- Imports in `shared/` and `ydoc-server` have been avoided for now in case they don't work with `@/` imports.
- Deduplicate `events.ts`, remove `useDocumentEvent` in favor of `useEvent(document,` (and same for `useDocumentEventConditional`
- Replace incorrect doc comments (`//*` and `///`) with correct doc comments (`/**`)

# Important Notes
None
2023-10-16 15:56:24 +00:00
Jaroslav Tulach
a85a57681d
Avoid null values in constant node (#8061)
Prevents [this NullPointerException](https://github.com/enso-org/enso/pull/8044#issuecomment-1763736570) by making sure `ConstantNode` rejects `null` during construction.

# Important Notes
```ruby
from Standard.Base import all
polyglot java import java.util.Random

main =
operator1 = Random.new
```
2023-10-16 15:50:41 +00:00
Radosław Waśko
08b717eb54
Refactor Table problem handling to a more robust and hopefully cleaner approach (#7879)
Closes #7514
2023-10-16 15:09:08 +00:00
somebody1234
209f4deb3e
CodeMirror highlighting (#8075)
- Closes #8041
- Integrates parser with CodeMirror
- Adds extensions builtin to CodeMirror
- Highlight text matching the selection
- Adds PoC CodeMirror extensions
- Basic syntax highlighting
- Code folding
- Hover tooltips

# Important Notes
As there is currently no way to get the corresponding node based on a position, the hover tooltip currently iterates through every node in `graphSotre.nodes`. This is potentially VERY SLOW and should be changed eventually, or disabled completely until an efficient implementation is possible.
2023-10-16 14:04:43 +00:00
Ilya Bogdanov
67bcf6ae07
ReactiveDb and ReactiveIndex (#8052)
SuggestionDb refactoring to facilitate documentation panel development and other features.

Now SuggestionDb uses `ReactiveDb` + `ReactiveIndex`es under the hood. There are no visual changes to the IDE. Everything still works the same.

You can now use two reactive indexes built on top of the SuggestionDb:
1. `db.nameToId` is a `QualifiedName→SuggestionId` relation. Reverse lookup allows you to get the qualified name by ID.
2. `db.parent` is a `SuggestionId→SuggestionId` relation, representing parent-children relations between entries. The rules are the following:
- If the `memberOf` field is present, it is used as a parent.
- Otherwise, a parent’s qualified name is used (through the `qnParent` function)
You can use reverse lookup to get the children of the entry.

You can easily add your own indexes if needed.
2023-10-16 13:35:16 +00:00
Michał Wawrzyniec Urbańczyk
e693147c17
CI improvements / IDE2 releasing (#8059) 2023-10-16 14:18:17 +02:00
somebody1234
2df2b50f4d
Drag and drop (#7987)
- Closes https://github.com/enso-org/cloud-v2/issues/697
- Adds infrastructure to support drag-and-drop
- Implements drag-and-drop for deleting and undeleting assets
- Implements drag-and-drop for moving assets to a new directory (or the root directory)
- Also implements "cut" and "paste" context menu actions (and keyboard shortcuts) using the new endpoint for moving files
- "Copy" and "duplicate" actions are *not* implemented, as I don't think there are backend endpoints for those yet.
- Fades items out when cutting (Cmd+X), fades them back in when cancelling (Esc)
- Fixes bug where keyboard shortcut handlers were not registered for table-wide shortcuts (delete all, restore all, cut all)

# Important Notes
Drag-and-drop for more situations are planned but intentionally not yet implemented:
- Labels (backend is WIP, and blocked on the corresponding frontend PR)
- Moving assets between folders (backend functionality does not yet exist)
2023-10-16 12:07:30 +00:00
Hubert Plociniczak
352ad06d2f
Reduce extra output in compilation and tests (#7809)
* Reduce extra output in compilation and tests

I couldn't stand the amount of extra output that we got when compiling
a clean project and when executing regular tests. We should strive to
keep output clean and not print anything additional to stdout/stderr.

* Getting rid of explicit setup by service loading

In order for SL4J to use service loading correctly had to upgrade to
latest slf4j. Unfortunately `TestLogProvider` which essentially
delegates to `logback` provider will lead to spurious ambiguous warnings
on multiple providers. In order to dictate which one to use and
therefore eliminate the warnings we can use the `slf4j.provider` env
var, which is only available in slf4j 2.x.

Now, there is no need to explicitly call `LoggerSetup.get().setup()` as
that is being called during service setup.

* legal review

* linter

* Ensure ConsoleHandler uses the default level

ConsoleHandler's constructor uses `Level.INFO` which is unnecessary for
tests.

* report warnings
2023-10-16 10:57:44 +02:00
Dmitry Bushev
58eeba6a00
Suppress futile visualization warnings (#8056)
close #7819

Warnings
```
Execution of visualization [...] on value [...] of [Panic] failed.
```
are produced when you are typing an incomplete expression in the component browser and can be misleading.
2023-10-16 08:23:43 +00:00
Jaroslav Tulach
5f44e209b8
Icon and documentation for Enso VSCode extension (#8051)
Adds icon and rewords the main readme file for the Enso VSCode extension.

# Important Notes
![Enso Icon in VSCode](https://github.com/enso-org/enso/assets/26887752/ae1ad4cc-e2ec-4c5b-bca0-c7d7189c6885)
2023-10-15 04:43:26 +00:00
GregoryTravis
f18d1323e1
Add Table.expand_to_rows to allow flattening vector and array values in table (#8042)
# Important Notes
Also includes a fix for a reallocation bug in `InferredBuilder`.
2023-10-13 20:54:06 +00:00
James Dunkerley
b7d7910a88
Use US locale for Date/Time parsing by default. (#8053)
Fixes issue with parsing long format month names.
2023-10-13 17:47:14 +00:00
James Dunkerley
fac9e7a420
Expand capabilities of Table.set and better dropdown support, (#8005)
- Adds the ability to use numbers, date/time and Boolean values as constants in `set`.
- `Table.set` can take a `Column_Operation`, allowing for deriving of a new column based on other columns.
- Added `Column_Ref` type to refer to a column in `filter`.
2023-10-13 16:03:28 +00:00
Hubert Plociniczak
a96f2d7aba
Fix initialization race-condition in runtime connector (#7985)
It seems that Runtime Connector wasn't respecting the protocol it defined itself. The connector should be waiting on the `Api.InitializedNotification` message and only then start forwarding messages. So far it seems this hasn't been a problem, or at least wasn't reported as such, because initialization was fast enough.

Modified `Handler` so that we are certain that its fields hold initialized values when being accessed by different threads.

Should fix problems mentioned in #7898.
2023-10-13 10:03:27 +00:00
Jaroslav Tulach
b5d50e6d63
Avoid Null receiver values are not supported by libraries (#8044) 2023-10-13 11:41:43 +02:00
somebody1234
79d8354848
Fixed node icons and colors, derived from suggestions DB groups (#8031)
- Closes #8015
- Note that the (few) fallback icons are still present, as most CB entries are still missing icons. *However*, now the `iconName` from the libraries take priority over the fallback icon names.
- Also fixes a minor regression, where nodes pending execution were no longer faded out. This was introduced in #7988 because the wrong CSS variable was set.

# Important Notes
None
2023-10-13 00:54:06 +00:00
Jaroslav Tulach
31624b5314
Helper method to turn iterator to a Vector (#8035) 2023-10-12 17:50:51 +02:00