Commit Graph

487 Commits

Author SHA1 Message Date
Dmitry Bushev
be5e3d2b97
Text editing ranges specified in UTF16 code units (#10764)
related #10678

Changelog:
- update: text editing expects Unicode code units when specifying text ranges
- test: text editing with emojis
2024-08-12 15:33:20 +00:00
Hubert Plociniczak
0f5a3a78b1
Revert "Import all available libraries in --repl mode (#10746)" (#10778)
* Revert "Import all available libraries in --repl mode (#10746)"

This reverts commit 71285e6ff8.

* trigger build
2024-08-09 14:38:05 +02:00
Pavel Marek
c2c6712b77
WithWarnings uses EnsoHashMap to speed things up (#10555)
Majority of warnings handling is now done via newly introduced nodes. Moreover, the underlying representation of warnings storage in `WithWarnings` was changed from `Warning[]` to `EnsoHashMap`.

# Important Notes
- Remove `ArrayRope`.
2024-08-07 15:29:57 +00:00
Jaroslav Tulach
71285e6ff8
Import all available libraries in --repl mode (#10746)
Continuation of REPL work (#10709): Import all available libraries when running `--repl`.
2024-08-07 07:36:39 +00:00
Dmitry Bushev
f97dd0506a
Disable console logging for project-manager cli commands (#10690)
related: #10633

Changelog:
- fix: disable console logging for project manager CLI commands
2024-08-06 09:25:04 +00:00
Radosław Waśko
4b35e0a99e
Propagate FS errors when creating a new project (#10708)
- Part of #10662
2024-08-05 10:58:03 +00:00
Radosław Waśko
9b2f611402
Relative paths are relative to current project locally and in Cloud (#10660)
- Close #10622
- Changes `project-manager` and `ensoup` launcher to run the engine/language-server with working directory set to the directory containing currently running project.
- If the working directory is _not_ "the directory containing currently running project", a warning is written to logs. This can happen if the raw `/bin/enso` engine runner is used in a different directory.
- In the Cloud, the `File.new` interprets relative paths as cloud paths relative to the Cloud directory containing the current project. Absolute paths are unaffected.
2024-07-31 09:43:17 +00:00
Jaroslav Tulach
cb72487cc9
ContextFactory reused to initialize language-server context (#10670) 2024-07-29 09:49:14 +02:00
Dmitry Bushev
446834b4f9
Soft delete projects by moving them to trash (#10440)
close #10357

Changelog:
- add: `LinuxTrashBin` implementing Freedesktop.org trash specification
- add: `WindowsTrashBin` calling native platform APIs for Windows
- add: `MacTrashBin` calling native platform APIs for MacOS
- update: `project/delete` method moves projects to trash and falls back to directory deletion
2024-07-27 13:37:43 +00:00
Hubert Plociniczak
0f055c7fb3
Additional info to debug AccessDenied problems (#10663)
Plain `Storage failure [AccessDenied].` was rather uninformative when it comes to debugging the underlying problem.
Added more detailed error messages and runners' failures should now sometimes print a detailed message.
References #10662.
2024-07-26 16:01:44 +00:00
Radosław Waśko
ba56f8e89b
Snowflake Dialect - pt. 7 (#10612)
- Closes #9486
- All tests are succeeding or marked pending
- Created follow up tickets for things that still need to be addressed, including:
- Fixing upload / table update #10609
- Fixing `Count_Distinct` on Boolean columns #10611
- Running the tests on CI is not part of this PR - to be addressed separately
2024-07-23 06:58:11 +00:00
Jaroslav Tulach
c20eab2af9
Detect compilation while benchmarking (#10574)
Enables `engine.TruffleCompilation` in `std-benchmarks`, collects the logs and dumps compilation into to `System.err` when a benchmark is influenced by dynamic compilation.
2024-07-18 15:49:16 +00:00
Hubert Plociniczak
473a51cee7
Always write Config's namespace and dashboard accepts a default one (#10572)
Closes #10564. Dashboard accepts only projects with non-empty namespace.
The change in project-manager ensures that we serialize `namespace` even if it is a default one.
The change in dashboard ensures that namespace can be empty.
2024-07-18 10:29:37 +00:00
Hubert Plociniczak
700a638f1e
Ignore ProcessBuilder logs (#10578) 2024-07-17 21:38:16 +00:00
Hubert Plociniczak
39898da664
Reduce the number of log INFO events (#10500)
Reducing the number of log events that we spam regular users. Not the last PR in that area, but already a progress.
Also replaced `fileWalk` with a stream approach hoping that maybe it is a bit more stable on Windows.
2024-07-17 14:29:48 +00:00
Jaroslav Tulach
c367e76e44
Renaming launcher executable to ensoup (#10535)
Closes #10476.

# Important Notes
Let's see what exactly fails on the CI and fix that then...
2024-07-16 14:30:23 +00:00
Hubert Plociniczak
9e553397b6
Log FS service failures (#10562)
Without the original falure somehow logged, it is impossible to figure
out the crashes.
2024-07-16 16:28:27 +02:00
Hubert Plociniczak
0ab9fe7875
Add projectsDirectory parameter to project endpoint (#10481)
This change adds a possibility to pass an optional parameter describing full path to projects' directory, in addition to the required project id.

Enables GUI to fix #10453.
2024-07-11 10:18:43 +00:00
Hubert Plociniczak
53eec66eda
Low-hanging perf improvements (#10462)
- avoid loading shapeless for the sole purpose of having a compile-time
type inequality
- don't use `sys.env` to avoid some Scala conversions
- lazy initialization of fields

# Important Notes
On a slow machine, so easier to spot.

![Screenshot from 2024-07-05 16-15-06](https://github.com/enso-org/enso/assets/292128/a07f42c5-9bee-492b-aad1-46fab7b6476f)
![Screenshot from 2024-07-05 18-14-53](https://github.com/enso-org/enso/assets/292128/694c4fb1-dfda-4629-8bd3-21c765612ec3)
2024-07-08 09:05:11 +00:00
Jaroslav Tulach
515d8238bb
Support for --jvm option in Enso runner (#10374)
Addresses one of two concerns of #5298 - adds support for `--jvm` argument to allow us to switch from _native image_ built Enso binary (as developed by #10126) to regular JVM based Enso execution. This change _doesn't affect production builds_. The _native executable_ continues to be only built by `engine-runner/buildNativeImage` which is tested on CI, but not in the production jobs.
2024-07-06 07:02:20 +00:00
Hubert Plociniczak
c54c3b7e9d
Eliminate circe-yaml dependency (#10326)
* Eliminating circe-yaml

This change adds our very-own YAML parser on top of SnakeYAML. Compared
to Circe parser on top of SnakeYAML. The advantage? In some not-so-distant
future we might actually get rid of circe and the related performance
issues.

The logic is similar to what circe does i.e. analyzing SnakeYAML to
build our own structure.
This change is not complete, as there are still some tests failing, but
most common Configs are already parseable.
We _could_ auto-generate some of the code but still some of the logic
would have to be tweaked by hand; the current logic has a number of
special cases, as I found out the hard way.

* wip: more tests passing

* Fix remaining tests in ConfigSpec

* Fixing YAML decoder for editions

Dropping circe as a decoder for Editions revealed some problems. Turns
out the current implementation had even more special cases to deal with.

* nit

* Allow for empty exports

* Mostly complete encodin part

Replaced almost all `toYAML` locations with SnakeYAML equivalent.
The encoding has to use Java collections for which there exists a
built-in support. If we were to use Scala collections we would have to
deal with tagging, at the very least.

* Remove the last remaining Circe's YAML parser

* Bug fix + further loop optimization

* removal of some dependencies

* Remove circe-yaml

Added a custom SnakeYAML Node updater to mimick the JSON -> YAML -> JSON
conversion needed for updating fields. The algorithm recursively follows
the key-path and inserts the desired Node. This is not a performance
oriented code on purpose.

* Fix compilation issues

`circe-core` was marked as `provided` but no one eventually included it
in the final jar, hence `NoClassFoundException`.

* fix licensing

* Removing obsolete circe definitions

* fmt

* nits

* s/SnakeYamlDecoder/YamlDecoder

* fmt

* Partial revert, PM needs JSON decoders/encoders

* style

* incremental compilation gone wrong
2024-07-05 09:32:45 +02:00
James Dunkerley
891f176e9c
Auto create the root folder if not present. (#10444)
Adds `filesystem-exists` to Project Manager CLI.
If the root folder isn't present will add it at start up.
2024-07-04 14:58:47 +00:00
Jaroslav Tulach
5e3a5b7751
Disable UpdatingEditionProvider when running Enso CLI (#10408) 2024-07-03 07:33:01 +02:00
Dmitry Bushev
764259f36d
Add project/duplicate endpoint (#10407)
close #10367

Changelog:
- add: `project/duplicate` project manager command to duplicate existing projects
2024-07-02 11:39:43 +00:00
Dmitry Bushev
dc7aa94348
Hide dotfiles on Windows (#10376)
related #10071

Request from @jdunkerley to hide all dotfiles on Windows.
2024-06-27 17:27:08 +00:00
Dmitry Bushev
ad5f2c9121
Change the default location for Enso projects (#10318)
close #10240

Changelog:
- add: `desktop-environment` Java module to detect user environment configuration
- add: `ProjectsMigration` module containing the migration logic of the enso projects directory
- update: updated and cleaned up unused settings from the storage config
- add: `desktopEnvironment` TS module to detect user environment configuration in the `project-manager-shim`
- update: `project-manager-shim` with the new user projects directory
2024-06-22 12:40:51 +00:00
Jaroslav Tulach
fe2cf49568
Run whole test/Base_Tests in native image runner (#10296) 2024-06-21 06:03:53 +02:00
Hubert Plociniczak
114b3a5c5e
Cleaning up YAML parsing in preparation for circe-yaml removal (#10309)
The current implementation contains logic that should enable us to make some backward compatibility config changes.
At the same time, the logic is tightly integrated with circe's JSON library, which we want to eventually to get rid off.
Rather than trying to keep it somehow around and maintain via some hacks this PR proposes to ditch that logic completely as we currently have no use-case for such scenarios.

As a result, classes modelling YAML configs now don't have the extra fields and there is 1:1 correspondence.

Performance has also improved although that wasn't the main objective, yet. Follow up PR will attempt to replace `circe-yaml` with `snakeyaml` directly.

In preparation for #9113. Note that the dependency upgrade is necessary because it brings latest available `snakeyaml` (as part of `circe-yaml`).
2024-06-20 13:07:54 +00:00
Dmitry Bushev
04a92ef765
TextEdit with custom IdMap (#10283)
close #10182

Changelog:
- add: IdMap parameter to the `text/applyEdit` request
- add: IdMap to the runtime module
- update: set IdMap during the interactive compilation
- update: set the IR identifiers in the `TreeToIR` parsing step
2024-06-15 18:03:18 +00:00
Radosław Waśko
3b566709f3
Type Inference PoC - iteration 1 - most basic type inference (#8652)
- Closes #8590
2024-06-13 16:23:56 +00:00
Hubert Plociniczak
d6d370925a
Removing dependencies to speed up startup (#10249)
Reducing the number of dependencies. Explicit `cats` are almost gone (present in `cli`). `enumeration` is completely gone.  `cats` is also still included implicitly via `io.circe` but that's a different kind of beast.
Also, really removed `jackson` from dependencies by fixing the dependency on `http-test-helper`.

# Important Notes
In a number of places importing all cats implicits could be simply replaced with a single or two method calls. Not to mention that this will reduce compilation times due to reduced implicit search space.

One example of how the changes affect performance (not only startup):

Before:
![Screenshot from 2024-06-11 12-05-24](https://github.com/enso-org/enso/assets/292128/a1a772a9-635d-4a16-a543-e2fd2124a22c)
Now:
![Screenshot from 2024-06-11 14-27-47](https://github.com/enso-org/enso/assets/292128/b17c7fcc-9a6d-48b9-8200-60708354ee03)
(frequently executed)

![Screenshot from 2024-06-12 12-46-34](https://github.com/enso-org/enso/assets/292128/31bc4dfd-4edc-45c9-9c5d-13e3472089b9)
Also appears to be gone.

This PR is by no means finished. The purge will continue in follow up PRs.
2024-06-12 18:15:36 +00:00
Pavel Marek
2ea2a57651
ydoc-server is a separate module (#10156)
- Remove remnants of deprecated Scala parser
- The following projects are now JPMS modules provided on system module-path (in components directory):
  - `ydoc-server`
  - `profiling-utils`
  - `syntax-rust-definition`
- The contents of the aforementioned modules are excluded from both `runner.jar` and `runtime.jar` fat jars.
- Suggestions are serialized and deserialized with our Persistance framework, rather than via the default Java OutputObjectWriter.
2024-06-07 12:56:42 +02:00
Dmitry Bushev
d08cb704b0
Record interaction between GUI and LS (#10107)
close #8328

Changelog:
- add: message callbacks to JsonRpc and Binary servers
- update: use events log to collect the RPC messages
2024-06-03 06:50:59 +00:00
Dmitry Bushev
79e20adcc0
Local dashboard shouldn't be showing system files (#10072)
close #10071

Changelog:
- update: `--filesystem-list` command to filter the hidden files
- update: project manager shim middleware to filter the hidden fiels
2024-05-29 09:26:35 +00:00
Hubert Plociniczak
094076a9e8
Remove invalid JVM parameters (#10053) 2024-05-23 14:48:08 +00:00
Jaroslav Tulach
0a010b3f71
Include milliseconds in the log output (#10016) 2024-05-23 16:44:32 +02:00
Hubert Plociniczak
a5ca9f9ac2
Reduce ops when setting exisitng execution env (#9967)
Setting execution environment to the existing one should have no effect.
Should (positively) affect startup in #9789.

# Important Notes
Cancelling jobs and triggering a fresh execute job is expensive and unnecessary, especially on startup, when the result should be the same as before.
2024-05-16 20:59:13 +00:00
Hubert Plociniczak
43c80da8a3
Follow up to #9927 (#9930)
`System.getProperty` does not return `null`, it returns `"null"`
🤦.
I broke the internet, sorry.
2024-05-13 16:43:24 +02:00
Hubert Plociniczak
ff28737252
Improve SuggestionsRepo initialization (#9808)
Added synchronization block to avoid race conditions.
2024-05-13 13:40:52 +00:00
Hubert Plociniczak
c67218c1ed
Abort jobs as early as possible (#9927)
We don't seem to run `abortJobs` under a lock, and especially not under the write compilation lock, in other scenarios. This is causing some major slowdown when there is a long running execution or compilation, as currently experienced in the cloud.

This should reduce chances of a timeout.

Also added an option to override the global executor. Currently it would always default to the runtime number of available process which may be suboptimal.

# Important Notes
Pending testing on the impact it will have.
2024-05-13 07:39:29 +00:00
Hubert Plociniczak
f2779cfea4
Allow for profiling startup in dockerized setting (#9865)
When `PROFILING_FILENAME` and `PROFILING_TIME` are set, language server will collect profiling data on startup and place it under `/opt/enso/profiling/$PROFILING_NAME` where it can be fetched from.

Needed to better analyze #9789.
2024-05-06 15:04:54 +00:00
Dmitry Bushev
5995a00958
Run ydoc-server with GraalVM (#9528)
part of #7954

# Important Notes
The workflow is:
- `$ npm install` -- just in case
- `$ npm --workspace=enso-gui2 run build-ydoc-server-polyglot` -- build the `ydocServer.js` bundle
- `$ sbt ydoc-server/assembly` -- build the ydoc server jar
- `env POLYGLOT_YDOC_SERVER=true npm --workspace=enso-gui2 run dev` -- run the dev server with the polyglot ydoc server. Providing `POLYGLOT_YDOC_SERVER_DEBUG=true` env variable enables the chrome debugger
2024-05-02 06:28:57 +00:00
Jaroslav Tulach
931baa4276
Towards simplifying runtime-compiler dependencies (#8894) 2024-04-25 10:03:42 +02: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
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
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
GregoryTravis
271a744b67
On MacOS, do not assume existence of Contents/Home in the JDK binary path (#9684) 2024-04-15 20:07:25 +00:00
Hubert Plociniczak
ab5fe1757e
Fix expectations in lock manager test (#9592)
The test optimistically assumed that threads will mostly execute in order, while ignoring all other possibilities.
Changes the order of the report so that we remove the potential non-determinism.

As discovered in https://github.com/enso-org/enso/actions/runs/8516468592/job/23325541262?pr=9584#step:8:1530
2024-04-02 11:46:44 +00:00
Jaroslav Tulach
11e1e9efa0
Don't let the non-Enso types float around the Enso interpreter! (#9584) 2024-04-02 06:22:19 +02:00
Pavel Marek
0b94493258
Equality does not swallow errors (#9560)
`42 == (Error.throw "foo")` now correctly returns an `Error` rather than False

# Important Notes
The error was in the wrong usage of the `org.enso.interpreter.dsl.AcceptsError` DSL annotation.
2024-03-29 04:11:16 +00:00