Commit graph

436 commits

Author SHA1 Message Date
Richard Feldman
78d77e2f59
Revise wildcard and type var error message 2024-05-13 09:55:35 -04:00
Richard Feldman
8357bd8c91
Revise errors for undeclared type vars in aliases 2024-05-12 21:20:11 -04:00
Ayaz
e5ea6dc461
Merge pull request #6708 from roc-lang/module-params-syntax
Parse and format module params
2024-05-12 13:51:13 -05:00
Agus Zubiaga
2e4306279c
Handle record update found in module params 2024-05-09 08:01:46 -03:00
Agus Zubiaga
f3b71c46e7
Handle record apply found in module params 2024-05-09 07:55:39 -03:00
Agus Zubiaga
b8280bf69a
Handle import params indent error in reporting 2024-05-09 07:49:21 -03:00
Agus Zubiaga
e5a09b5de6
Parse module params in import 2024-05-09 07:42:07 -03:00
Agus Zubiaga
760ffaf68f
Report module params parse error 2024-05-09 07:27:58 -03:00
Agus Zubiaga
5b1a3c8f03
Parse params in module header
module {echo, read} -> [menu]

Formatter isn't implemented yet.
2024-05-09 07:27:43 -03:00
Agus Zubiaga
bb0ada0956
Add description to render_language_server doc 2024-05-08 09:32:06 -03:00
Agus Zubiaga
fb24111190
Narrow language server reports for load 2024-05-08 09:28:44 -03:00
Agus Zubiaga
accba0b75a
Narrow headers for language server reports 2024-05-08 09:24:56 -03:00
Agus Zubiaga
9a66abf95f
Report ingested file colon syntax error 2024-05-06 23:46:38 -03:00
Agus Zubiaga
27a9f6051e
Report ingested file name syntax error 2024-05-06 23:46:06 -03:00
Agus Zubiaga
755e16cb10
Report exposing list end error in imports 2024-05-06 23:38:12 -03:00
Agus Zubiaga
dc18597a0e
Report unfinished exposing in imports 2024-05-06 23:24:56 -03:00
Agus Zubiaga
f81985533c
Report import lowercase alias 2024-05-06 23:16:18 -03:00
Agus Zubiaga
97ed8fdbbd
Report unfinished import as 2024-05-06 23:03:40 -03:00
Agus Zubiaga
bfb77b78cb
Report import ending syntax error 2024-05-06 22:22:00 -03:00
Agus Zubiaga
007e03891e
Report module name / path syntax error in imports 2024-05-06 21:00:17 -03:00
Agus Zubiaga
233310cabf
Report space problem in import 2024-05-06 20:26:07 -03:00
Agus Zubiaga
520dc389f3
Report ingested file annotation syntax error 2024-05-05 17:45:37 -03:00
Anton-4
f7011c8e33
Merge pull request #6644 from roc-lang/rust-1-76-0-upgrade
Rust 1.76.0 upgrade
2024-05-03 07:25:19 +02:00
Agus Zubiaga
057a18573a
New module header
Implements the new `module` header syntax as described in "module and package changes" [1]:

```
module [Request, Response, req]
```

The old syntax should still work fine, and is automatically upgraded to the new one
when running `roc format`.

[1] https://docs.google.com/document/d/1E_77fO-44BtoBtXoVeWyGh1xN2KRTWTu8q6i25RNNx0/edit
2024-05-01 10:39:12 -03:00
Agus Zubiaga
7efc7a4a3e
Canonicalize ingested files directly instead of creating AST nodes 2024-04-23 18:55:41 -03:00
Agus Zubiaga
7a53484479
Report an error when import shadows a symbol in scope 2024-04-20 12:38:17 -03:00
Agus Zubiaga
979aff8bf7
Explicit builtin import warning
We will now show a warning if a builtin is imported explicitly,
since this is unncessary.

We will not show the warning if they expose functions from the builtin:

	import Dict exposing [isEmpty]

However, we will show a special warning if they expose types from it:

	import Dict exposing [Dict, isEmpty]
2024-04-20 12:35:46 -03:00
Agus Zubiaga
1f347f6ca1
Fix package module resolution in inline imports
We were still passing `ModuleIds` from `load` to `can`, but now
that imports can appear in any scope, we don't know which package
an unqualified module name belongs to from the top level.

We now pass `PackageModuleIds` instead  and keep a Map of `ModuleName` to
`ModuleId` in `Scope`.

This also allow us to import multiple modules with the same name from different
packages as long as a unique alias is provided.
2024-04-20 12:16:37 -03:00
Agus Zubiaga
842a256907
Implement import aliases
Allows a module to be imported with an alias:

    import JsonDecode as JD

Import aliases must be unique and they cannot have the same name
as an imported module.
2024-04-20 12:07:01 -03:00
Agus Zubiaga
d5a38a26db
Merge branch 'main' into inline-imports 2024-04-20 12:01:11 -03:00
Anton-4
1a5e065055
Merge branch 'main' into rust-1-76-0-upgrade 2024-04-16 13:33:27 +02:00
Anton-4
e4b814ce1c
clippy 2024-04-15 16:50:44 +02:00
Luke Boswell
8b9e08bd76
WIP try simplification 2024-04-14 13:45:05 +10:00
Richard Feldman
ec64da3416
Merge pull request #6627 from roc-lang/default-value-record
Change docs/errors from "optional" to "default value" record fields
2024-04-04 22:25:45 -04:00
Brendan Hansknecht
482c084096
Change docs/errors from "optional" to "default value" record fields
I strongly believe that seeing the word "optional" is priming people wrong when it comes to this feature.
Especially given roc dose not have an `Optional/Option/Maybe` type, so users look for an alternative and find this.

This PR changes the name to "default value record fields".
It updates all docs and errors.
It does not update compiler internal naming.
That can be updated in a follow up PR if we want to, but I am also fine leaving it cause it is not exposed to users.
2024-04-03 08:55:35 -07:00
Luke Boswell
ca01913ab3
add EExpr error for unexpected comma 2024-04-02 20:48:13 +11:00
Norman Jäckel
cfb068ec94
Use constant ANSI code to reset boldfaced colors in reporting for CHECK and TEST command. Remove unused color_reset constant. 2024-03-06 00:47:34 +01:00
Anton-4
f620508a37
misc improvements 2024-03-04 17:10:59 +01:00
Hristo Georgiev
c47fff04d2 Add a newline when reporting test failures 2024-03-03 19:44:04 +00:00
Richard Feldman
878042bc3d
Revise error for single-quote interpolation 2024-02-27 12:11:54 -05:00
Richard Feldman
ffd72b184b
Fix tests 2024-02-27 11:35:06 -05:00
Richard Feldman
6f84e24fa5
Merge remote-tracking branch 'origin/main' into more-dollars 2024-02-26 23:06:23 -05:00
Anton-4
b5f68bc020
Merge pull request #6525 from roc-lang/fix_text_contrast
less colors and more contrast in terminal
2024-02-20 15:46:13 +01:00
Anton-4
f66711d53e
re-use strip_colors 2024-02-16 16:32:46 +01:00
Anton-4
00d1ac0aef
removed duplicate code 2024-02-16 15:13:40 +01:00
Anton-4
c6b5e2f8c3
less colors more contrast 2024-02-14 17:20:44 +01:00
Richard Feldman
24a38c4a26
Merge remote-tracking branch 'origin/main' into remove-nat 2024-02-11 12:26:36 -05:00
Anton-4
3eec1f4bb0
Merge branch 'main' into ensure-roc-files 2024-02-09 19:15:13 +01:00
Anton-4
fa48f9713e
repl now uses replfile.roc
Previously this was using an empty filename but that seems potentially confusing during debugging.
2024-02-09 15:18:51 +01:00
Trevor Settles
cd4adeb9c1
added nicer indentation 2024-02-08 16:37:46 -07:00