Commit Graph

997 Commits

Author SHA1 Message Date
Dmitry Bushev
c88765d259
Send conversion method suggestions (#7857)
close #7320

Changelog:
- update: enable conversion suggestions
- fix: conversion suggestion building
- fix: conversion suggestion types
- fix: conversion JSON-RPC representation

# Important Notes
For example, the [`Day_Of_Week_From`](5150c14afd/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Day_Of_Week_From.enso) conversion is sent as


```json
{
"type":"Add",
"id":32,
"suggestion":{
"type":"method",
"module":"Standard.Base.Data.Time.Day_Of_Week_From",
"name":"from",
"arguments":[
{
"name":"that",
"reprType":"Standard.Base.Data.Numbers.Integer",
"isSuspended":false,
"hasDefault":false,
"defaultValue":null,
"tagValues":null
},
{
"name":"first_day",
"reprType":"Standard.Base.Data.Time.Day_Of_Week.Day_Of_Week",
"isSuspended":false,
"hasDefault":true,
"defaultValue":"Day_Of_Week.Sunday",
"tagValues":[
"Standard.Base.Data.Time.Day_Of_Week.Day_Of_Week.Sunday",
"Standard.Base.Data.Time.Day_Of_Week.Day_Of_Week.Monday",
"Standard.Base.Data.Time.Day_Of_Week.Day_Of_Week.Tuesday",
"Standard.Base.Data.Time.Day_Of_Week.Day_Of_Week.Wednesday",
"Standard.Base.Data.Time.Day_Of_Week.Day_Of_Week.Thursday",
"Standard.Base.Data.Time.Day_Of_Week.Day_Of_Week.Friday",
"Standard.Base.Data.Time.Day_Of_Week.Day_Of_Week.Saturday"
]
},
{
"name":"start_at_zero",
"reprType":"Standard.Base.Data.Boolean.Boolean",
"isSuspended":false,
"hasDefault":true,
"defaultValue":"False",
"tagValues":[
"Standard.Base.Data.Boolean.Boolean.True",
"Standard.Base.Data.Boolean.Boolean.False"
]
}
],
"selfType":"Standard.Base.Data.Time.Day_Of_Week.Day_Of_Week",
"returnType":"Standard.Base.Data.Time.Day_Of_Week.Day_Of_Week",
"isStatic":false,
"documentation":" Convert from an integer to a Day_Of_Week\n\nArguments:\n- `that`: The first day of the week.\n- `first_day`: The first day of the week.\n- `start_at_zero`: If True, first day of the week is 0 otherwise is 1.",
"annotations":[

]
}
}
```
2023-09-21 09:00:31 +00:00
Jaroslav Tulach
5150c14afd
Avoid duplicated conversion & search target type scope (#7849) 2023-09-20 17:23:09 +02:00
James Dunkerley
74d1d0861c
S3 Read Access, Input Stream based reading (#7776)
- Added a `FileSystemSPI` allowing protocol resolution to a target type.
- Separated `Input_Stream` and `Output_Stream` from `File` to allow use in other spaces.
- `File_Format` types `read_web` changed to be `read_stream` working with `InputStream`.
- Added directory listing to `Auto_Detect` allowing for `Data.read` to list a folder.
- Adjusted HTTP to return an `InputStream` not a `byte[]`:
- `Response_Body` adjusted to wrap an `InputStream`.
- Added ability to materialize to either and in-memory vector (<4KB) or a temporary file.
- `Data.fetch` will materialize if not a recognized mime-type.
- Added `HTTP_Error` to handle IO exceptions from the stream.
- `Excel_Format` now supports mime-type and reading a stream.
- `Excel_Workbook` can now get a `Excel_Section` using `read_section`.
- Added S3 APIs:
- `parse_uri`: splits an S3 URI into bucket and key.
- `list_objects`: list the items in a S3 bucket with specified prefix.
- `read_bucket`: list prefixes and keys with a delimiter in a S3 bucket with specified prefix.
- `head`: either head_bucket (tests existance) or head_object API (reads object meta data).
- `get_object`: gets an object from S3 returning as a `Response_Body`.
- Added `S3_File` type acting like a `File`:
- No support for writing in this PR.
- **ToDo:** recursive listing, glob filtering, exists, size.
- Fixed a few invalid type signature line.
- Moved `create` methods for `Postgres_Connection` and `SQLite_Connection` into type instead of module.
- Renamed `Column_Fetcher.Builder` to `Column_Fetcher_Builder`.
- Fixed bug with `select_into` in Dry Run mode creating permanent tables.

**ToDo:** Unit tests.
2023-09-20 15:09:11 +00:00
Jaroslav Tulach
2e1791b63e
Accept type argument in instance method signatures (#7848) 2023-09-20 12:58:20 +02:00
Jaroslav Tulach
0efa1afc61
Encapsulate TruffleLanguage.Env in EnsoContext (#7842) 2023-09-20 11:30:44 +02:00
Jaroslav Tulach
3b790606e1
Avoid StackOverflow when comparing unknown foreign objects (#7780)
Closes #7677 by eliminating the _stackoverflow execption_. In general it seems _too adventurous_ to walk members of random foreign objects. There can be anything including cycles. Rather than trying to be too smart in these cases, let's just rely on `InteropLibrary.isIdentical` message.

# Important Notes
Calling `sort` on the `numpy` array no longer yields an error, but the array isn't sorted - that needs a fix on the Python side: https://github.com/oracle/graalpython/issues/354 - once it is in, the elements will be treated as numbers and the sorting happens automatically (without any changes in Enso code).
2023-09-19 15:39:04 +00:00
Dmitry Bushev
5c198145a1
Static parameter in search/completion request affects only methods (#7831)
close #7805

Changelog:
update: `isStatic` parameter in the `search/completion` request only affects method suggestions
2023-09-19 15:12:23 +00:00
Jaroslav Tulach
6cbd111bad
Optional Espresso support with ENSO_JAVA=espresso env variable 2023-09-19 15:10:12 +02:00
Pavel Marek
a6335ac4b4
Do not suppress panic exception in runtime type check (#7793) 2023-09-18 11:48:59 +02:00
Jaroslav Tulach
af8a2c39d8
Throw UnsupportedMessageException when loosing BigInteger precision (#7817) 2023-09-15 17:00:09 +02:00
Jaroslav Tulach
4caee1b00f
Cleanup code in IdExecutionInstrument (#7811)
As part of investigation of #7683, let's make `IdExecutionEventNode` smaller by having a reference to factory and its fields.
2023-09-15 10:09:42 +00:00
Dmitry Bushev
bbf96f0d16
expressionUpdates do not contain Method Pointer of operators (#7659)
close #7520

Changelog:
- update: SectionsToBinOp compiler pass produces function application for left sections
- refactor: simplify the registration of builtin methods
2023-09-15 08:01:21 +00:00
Dmitry Bushev
5eb4944ccf
Send suggestions database on request (#7812)
close #7765

Changelog:
- update: instead of relying on the connection closed events, the `sendSuggestionsDatabase` request initiates the suggestions database re-indexing
2023-09-14 17:31:37 +00:00
Hubert Plociniczak
1ee3d8f4f0
Rename Decimal to Float (#7807)
Implements #6889.
2023-09-14 15:01:30 +00:00
Jaroslav Tulach
30a62b97bb
Runtime checking of ascribed expression types (#7796) 2023-09-14 14:09:41 +02:00
Hubert Plociniczak
9fdcfc0105
Fix log output for suggestions' tests (#7803)
Very verbose log output discovered by @4e6.
Needed an explicit log setup call, similar to other language server's tests.


Before (tons of):
```
...
23:04:42.319 [TestSystem-akka.actor.default-dispatcher-6] DEBUG slick.compiler.CodeGen -- Compiled server-side to:
| CompiledStatement "select "id" from "suggestions_version"" : Vector[t10<(Long')>]
23:04:42.320 [TestSystem-akka.actor.default-dispatcher-6] DEBUG slick.compiler.QueryCompiler -- After phase codeGen:
| ResultSetMapping : Vector[Mapped[Option[Long']]]
|   from s8: CompiledStatement "select "id" from "suggestions_version"" : Vector[t10<(Long')>]
|   map: CompiledMapping : Mapped[Option[Long']]
|     converter: TypeMappingResultConverter
|       child: OptionResultConverter$mcJ$sp idx=1 : Long'

23:04:42.320 [TestSystem-akka.actor.default-dispatcher-6] DEBUG slick.compiler.QueryCompilerBenchmark -- ------------------- Phase: Time ---------
23:04:42.320 [TestSystem-akka.actor.default-dispatcher-6] DEBUG slick.compiler.QueryCompilerBenchmark --       assignUniqueSymbols:    0.101991 ms
23:04:42.320 [TestSystem-akka.actor.default-dispatcher-6] DEBUG slick.compiler.QueryCompilerBenchmark --           unrollTailBinds:    0.015431 ms
...
```
Now: Gone.
2023-09-13 16:34:04 +00:00
Dmitry Bushev
e5425d35a0
Log visualization expressions generated by IDE (#7756)
close #7608

Changelog:
- update: log separately the evaluation of visualization expression and its arguments
- update: add visualization expression, its arguments, and the value type to the log

# Important Notes
Example

```
[TRACE] [2023-09-06T20:41:45+03:00] [enso] Executing visualization [VisualizationConfiguration(d195fdd8-d4e8-400f-a0d4-e50417eddd0a,ModuleMethod(MethodPointer(Standard.Visualization.Table.Visualization,Standard.Visualization.Table.Visualization,prepare_visualization),Vector(1000)),local.New_Project_1.Main)] on expression [ddc060df-9b59-48e5-bc61-aca849347343] of [class org.enso.interpreter.runtime.data.vector.Vector$Generic]...
```
2023-09-12 17:27:37 +00:00
Dmitry Bushev
a7fc333ff0
Fix flaky project rename test (#7794)
Fixes the _RefactoringTests - rename project_ part of the #7775


Changelog:
- update: send the ok response before the notification to fix the order of events in tests
2023-09-12 12:24:12 +00:00
Hubert Plociniczak
3445327581
Cleanup serialization config (#7748)
Makes it clear that those IR entries are not needed for executing native runner.

# Important Notes
Follow up on #7017
2023-09-12 08:28:06 +00:00
Hubert Plociniczak
ea5096a288
Workaround crashes during regular execution (#7778)
This PR addresses two problems mentioned in #7766:
1. A random integer overflow, likely caused by a bug in Rust parser
2. A concurrent access to a methods' map

Re 1: Unable to reproduce but it doesn't mean it won't happen again. Added a try/catch to get in the logs source code that caused it **and** not crash hard when it occurs.

Re 2: Changing methods map from `HashMap` to `ConcurrentHashMap`. Due to a poor design we leaked the underlying structure in a number of places, unnecessairly. `ConcurrentHashMap` does not accept `null` keys therefore due to leaking implementation had to ensure that `methods` of `ModuleScope` never escapes as-is.

Both workarounds should ensure that we don't crash hard when they appear.

Closes #7766
2023-09-11 13:45:31 +00:00
Jaroslav Tulach
50124704c8
Support runtime checks of intersection types (#7769) 2023-09-11 14:05:20 +02:00
Jaroslav Tulach
a42850f980
Benchmark shall loop correctly (#7781) 2023-09-11 14:04:10 +02:00
Pavel Marek
1be9ba615a
Fix implicit conversion of foreign JS object to Text (#7774)
Fixes implicit conversion of foreign JS object to Text.
2023-09-11 10:21:33 +02:00
Pavel Marek
e0ee8fdda7
Merge Small_Integer and Big_Integer types (#7636)
Merge Small_Integer and Big_Integer types into a single Integer type
2023-09-08 16:04:39 +02:00
James Dunkerley
f0ae9bf9c5
Fixes issue writing to a dry run Excel File (#7763)
- Adds `size` to `File`.
- If file is empty, then create a new Excel file.
- Fixes dry run Excel write issue.
2023-09-08 08:52:00 +00:00
Pavel Marek
687686773e
Fix on argument for Vector.sort (#7751)
Fix treatment of the `on` argument of `Vector.sort`.
2023-09-07 17:32:08 +00:00
Jaroslav Tulach
4213bf9983
Display overriden non-default values (#7762) 2023-09-07 13:31:51 +02:00
Radosław Waśko
7d424bf8a2
Implement Table.delete_rows. (#7709)
- Closes #7238
- Aligns `update_database_table` to a more consistent and clearer API - `update_rows`.
- Adds a `truncate_table` helper function, to pair up with `drop_table`. Both are `PRIVATE` for now.
- Adds tests for NULLs in keys in `update_rows` and `delete_rows`.
- The behaviour is sometimes unexpected, so instead these fail with `Null_Values_In_Key_Columns`.
- Adds a workaround for https://github.com/oracle/graal/issues/7359
- Adds a workaround for a related bug where a stack frame has no name (its `rootNode.getName() == null`).
- I could not track down this bug to provide a neat repro.
2023-09-07 11:07:53 +00:00
Dmitry Bushev
a1f2560491
Fix re-exports of type constructors (#7724)
close #7674

Changelog:
- fix: setting reexport field when serializing the library
2023-09-06 11:02:21 +00:00
Hubert Plociniczak
ddbccd8764
Fix console output for native image (#7744)
* Add serialization config to fix native image

Discovered when switching to console output.

* Add more documentation
2023-09-06 12:12:52 +02:00
Jaroslav Tulach
ab1c1a4c12
Delay check of suspended arguments until they are about to be computed (#7727) 2023-09-06 09:34:12 +02:00
Hubert Plociniczak
8a60bc6dcd
Replace a custom logger with off the shelf implementation (#7559)
This change replaces Enso's custom logger with an existing, mostly off the shelf logging implementation. The change attempts to provide a 1:1 replacement for the existing solution while requiring only a minimal logic for the initialization.

Loggers are configured completely via `logging-server` section in `application.conf` HOCON file, all initial logback configuration has been removed. This opens up a lot of interesting opportunities because we can benefit from all the well maintained slf4j implementations without being to them in terms of functionality.

Most important differences have been outlined in `docs/infrastructure/logging.md`.

# Important Notes
Addresses:
- #7253
- #6739
2023-09-04 09:40:16 +00:00
Radosław Waśko
87ce78615a
Change layout of local library search path in order to be able to move Round_Spec.enso back to Tests (#7634)
- Closes #7633
- Moves `Round_Spec.enso` from published `Standard.Test` into our `test/Tests` project; the `Table_Tests` that depend on it, simply `import enso_dev.Tests`.
- Changes the layout of the local libraries directory:
- It used to be `root/<namespace>/<name>`.
- Now it is `root/<dir>` - the namespace and name are now read from `package.yaml` instead.
- Adds the parent directory of the current project to the default `ENSO_LIBRARY_PATH`.
- It is treated as a secondary path, so the default `ENSO_HOME/lib` still takes precedence.
- This allows projects to reference and load 'sibling' projects easily - the only requirement is for the project to enable `prefer-local-libraries: true` or add the other local project to its edition. The edition resolution logic is **not changed**.
2023-09-01 20:20:04 +00:00
Jaroslav Tulach
6deaf80a87
Standardization of Vector.sort array access (#7697)
Inspired by #6361 - let's use `ArrayLikeXyzNode` instead of `InteropLibrary`.
2023-09-01 08:07:41 +00:00
Jaroslav Tulach
1437a671e1
Introducing generic Any.to type conversion method (#7704) 2023-09-01 08:05:48 +02:00
Hubert Plociniczak
24f263b20b
Towards shallow nesting in IR (#7681)
Refactoring deeply nested IR classes to shallow nesting.
Fixes #7017

# Important Notes
It's a big PR but fairly consistent. Split multiple hierarchy levels into subpackages.
2023-08-31 15:42:53 +00:00
Dmitry Bushev
eefe74ed93
When opening the project for a second time suggestion database is not sent (#7699)
close #7413

Changelog:
- update: the language server listens for the client disconnection event and invalidates the suggestions index

# Important Notes
The component browser contains suggestion entries after the refresh


https://github.com/enso-org/enso/assets/357683/bcebb8bf-e09f-4fb0-86cf-95ced58413f3
2023-08-31 14:06:58 +00:00
Jaroslav Tulach
198ab7f487
Support for Python libraries like numpy (#7678) 2023-08-30 06:10:18 +02:00
Jaroslav Tulach
b8edf6a358
Removing references to Builtins from Compiler (#7666) 2023-08-27 17:24:51 +02:00
Jaroslav Tulach
dd7ab1da38
Avoid _ after . (#7657) 2023-08-26 08:02:20 +02:00
Jaroslav Tulach
6461e20870
Special support for Python Date/Time/Zone interop (#7617) 2023-08-25 10:27:16 +02:00
Jaroslav Tulach
59a83030ed
Turn abnormal CompilerError into regular Panic (#7651) 2023-08-25 08:29:18 +02:00
Jaroslav Tulach
20e18d22df
More descriptive function information (#7629)
Fixes #7359 by printing more information about the function including partially applied arguments and over-saturated arguments.
2023-08-24 18:04:08 +00:00
James Dunkerley
7d83b3d7b4
Add GROUP to functions (#7622)
- Update list of groups to agreed list.
- Lower case `ALIAS` names to be consistent with function names.
- Add `GROUP` to methods.
- All constructors and functions have doc comments.
- Correct a few typos (e.g. `PRVIATE`).
- Mark some more things as `PRIVATE`.
- Use `ToDo:` and `Note:` consistently.
- Order tags in doc comment.

# Important Notes
We don't have all the doc comments on types and will want to add them in future,
2023-08-23 13:20:38 +00:00
Dmitry Bushev
5dc2c4c5fd
Notification about the project rename action (#7613)
close #7604

After moving the rename action to the dashboard, IDE is unaware of the new project name. PR implements a new `refactoring/projectRenamed` notification that is sent from the server to clients and informs them about the changed project name.

# Important Notes
https://github.com/enso-org/enso/assets/357683/7c62726d-217e-4e69-8e48-568e0b7b8c34
2023-08-22 11:32:46 +00:00
Jaroslav Tulach
a2946d2d27
Allow Java Enums in "case of" branches (#7607)
Fixes #7551 by looking up static symbols of a `JavaClass` polyglot object.
2023-08-21 15:12:57 +00:00
Jaroslav Tulach
e224eb350a
Eliminate compile time dependency on runtime-language-epb (#7611) 2023-08-21 05:31:39 +02:00
Dmitry Bushev
1d67667792
Editing the node is not changing the placeholders and widgets (#7595)
close #7462

# Important Notes
https://github.com/enso-org/enso/assets/357683/c2e68042-f64c-419e-b36e-7e99f0b43cd8
2023-08-18 14:22:26 +00:00
Jaroslav Tulach
aa0413e5a2
Use only Type instances as keys for State (#7585) 2023-08-16 15:54:17 +02:00
Jaroslav Tulach
7a272ec152
Encapsulating array-like data and operations into a single package (#7544) 2023-08-15 13:00:47 +02:00