Commit graph

104 commits

Author SHA1 Message Date
Sam Mohr
670d255060
Merge pull request #7130 from snobee/annotate-type-signatures
Automatic annotation of type signatures
2025-01-31 11:46:12 -05:00
snobee
4f7729c044
Merge remote-tracking branch 'upstream' into annotate-type-signatures 2025-01-27 14:21:24 -08:00
snobee
46736ccaea
Handle errors in generated type annotations 2025-01-27 13:50:53 -08:00
snobee
0ddf12e323
Remove handling of suffix closures 2025-01-27 13:50:46 -08:00
Sam Mohr
631e59ce06
Upgrade hosted header in the style module header 2025-01-26 15:07:57 -08:00
snobee
84f9f35835
Move imports to top of file 2025-01-21 17:11:52 -08:00
Mattias Wallin
ccca5681e5
Fix: AppHeader::iter_tokens iterates provides twice
Fixes panic:
```
thread 'main' panicked at crates/language_server/src/analysis/semantic_tokens.rs:31:13:
attempt to subtract with overflow
[Error - 11:21:33 AM] Request textDocument/semanticTokens/full failed.
  Message: Any { .. }
  Code: -32603
```
2025-01-16 14:18:01 +01:00
snobee
bbe2d7c46f
Remove references to Task and CalledVia::BangSuffix 2025-01-15 21:58:48 -08:00
snobee
406cc6c5e9
Merge remote-tracking branch 'upstream' into annotate-type-signatures 2025-01-15 21:15:32 -08:00
Joshua Warner
d43ad92789
Introduce proper type for TypeVar's, mark anything not a lowercase ident as malformed 2025-01-14 19:30:33 -08:00
Joshua Warner
13a70c060d
Preserve info about whether a given dbg stmt was pnc or not, at least for now 2025-01-10 21:10:55 -08:00
Sam Mohr
2150ee2219
Remove Task from Roc 2025-01-08 17:00:40 -08:00
Anthony Bullard
898b3f55e5
Move PNC apply to separate Expr/Pattern variant 2025-01-08 14:47:49 -06:00
Joshua Warner
6edfc0aa90
Fix double-wrapping of spaces before implements opaque keyword by making them distinct 2025-01-05 15:10:13 -08:00
Anthony Bullard
3b0db07fa1
PNC for Patterns, stabilize formatting 2025-01-02 17:57:15 -06:00
Anthony Bullard
389cc940e0
Git rid of MigrationFlags constructor 2025-01-02 16:49:08 -06:00
Anthony Bullard
af39ce57fb
Parens and Commas application syntax 2025-01-02 16:49:08 -06:00
Sam Mohr
cbcbfd3265
Remove backpassing 2025-01-01 17:44:56 -08:00
JRI98
44aec504c0
Fix language server crash on UTF-8 completion 2024-12-15 00:55:15 +00:00
snobee
6313461217
Add tests for automatic annotation 2024-12-13 20:46:38 -08:00
snobee
6e39425938
Fix bug converting ranges to the wrong region 2024-12-13 20:46:38 -08:00
snobee
40a008657a
Add code action to annotate declarations 2024-12-13 20:46:38 -08:00
faldor20
c731c5daae
resolve comments 2024-12-12 20:54:25 +10:00
faldor20
a7308130cf
clippy on everything 2024-12-12 20:54:25 +10:00
faldor20
7eb81fbcf3
drilling into every error type when getting region 2024-12-12 20:54:25 +10:00
faldor20
81f2095e61
basic working
compiling, but still missing positions from expression errors
2024-12-12 20:54:25 +10:00
Sam Mohr
01f4d4f3da
Merge branch 'main' into cleanup_unused 2024-12-08 10:14:47 -08:00
Sam Mohr
de626102c8
Use new try impl for ? operator 2024-12-05 02:13:13 -08:00
Sam Mohr
193c23bac8
Merge pull request #7296 from smores56/proper-try-keyword
Proper `try` keyword
2024-12-05 01:38:22 -08:00
JRI98
90f517712a
Remove unused code 2024-12-05 09:18:52 +00:00
Joshua Warner
120e9be550
Move MigrationFlags from an argument on format* to a field on Buf
That has a few advantages:

* We avoid a bunch of extra parameter-passing "noise", since the vast majority of formatting code doesn't need to care about this setting beyond just passing it to nested format calls.
* It aligns really well with the "global" nature of this setting, and makes it impossible to have bugs where e.g. one callsite forgets to pass the correct value to it's children - which would lead to parts of the tree not being migrated. If this is truly a global setting on Buf, that simply can't happen.
2024-12-04 17:57:31 -08:00
Sam Mohr
eedade8e81
Initial working version of proper try keyword 2024-12-04 02:31:59 -08:00
Anthony Bullard
a2083cec30
Parsing support for snake_case identifiers
In this initial commit, I have done the following:

- Added unit tests to roc_parse's ident.rs file to cover at least the
  simplest Ident enum cases (Tag, OpaqueRef, and simple Access)
- Added '_' as a valid "rest" character in both uppercase and lowercase
  identifier parts
- Updated the test_syntax snapshots appropriately

There is still a lot left to do here. Such as:

- Do we want to allow multiple '_'s to parse successfully?
- Handle qualified access
- Handle accessor functions
- Handle record update functions
- Remove the UnderscoreInMiddle case from BadIdent
- Write unit tests for Malformed Idents

I am not a "Rustacean" by any means, but have been through the Book in
years past.  Any feedback on the way I wrote the tests or any other part
of the implementation would be very appreciated.
2024-12-03 20:50:47 -06:00
Luke Boswell
63932350d0
Merge pull request #7288 from faldor20/prevent-language-server-crashes
Prevent compiler errors from terminating the language server process
2024-12-02 14:22:00 +11:00
Eli Dowling
e483f36a59
Merge pull request #7290 from faldor20/basic-tag-completion
Basic tag completion
2024-12-02 13:19:14 +10:00
Joshua Warner
912db1b76b
Fix round-trip parse->fmt->parse for dbg stmts with more than one arg 2024-12-01 12:40:13 -08:00
faldor20
b01c516d59
Prevent compiler errors from terminating the language server process 2024-12-02 05:46:41 +10:00
faldor20
4b999050f6
Basic tag completion 2024-12-02 05:38:56 +10:00
Anton-4
74d137cad4
Revert "Merge pull request #7267 from joshuawarner32/fuzzing-bugs-2"
This reverts commit 364249a29d, reversing
changes made to 0e550a7f68.
2024-11-30 18:43:16 +01:00
Joshua Warner
364249a29d
Merge pull request #7267 from joshuawarner32/fuzzing-bugs-2
Fix a bunch of parser/formatter bugs found in fuzzing
2024-11-29 17:33:57 -08:00
Joshua Warner
ed62bcc15a
Fix a bunch of parser/formatter bugs found in fuzzing
Notably:
* Unified how parens are formatted between (1) when we have a ParensAround, and (2) when we've decided an Apply needs to have parens
* Made unary minus require the be indented to the same level as any other expression continuation. (it used to accidentally have rules meant for binary operators applied)
* Don't apply extra indent to the backpassing continuation in the case that the call does itself require indentation
* Make `try@foo` correctly parse as `try @foo`, so that formatting doesn't change the tree when it adds that space
* Detect more cases where we need to outdent trailing e.g. {} blocks in applies
* Approximately a bagillion other things, 90% of which I added tests for, and none of which affected the formatting of examples or builtins
2024-11-29 16:25:59 -08:00
Luke Boswell
30d8f7ee59
replace cargo deps with workspace in highlight, language server 2024-11-29 10:49:54 +11:00
JRI98
de4179d5e1
Remove unused ast::Expr::Expect 2024-11-18 14:13:46 +00:00
Joshua Warner
9ead801536
Remove expect-fx syntax and handling
This was never fully hooked up in platforms, and the plan is to replace the need for this with doing purity-inference on normal `expect` statements.

On the other hand, fuzzing is finding some bugs caused by having a hyphenated keyword, so this is a great time to go ahead and remove it!
2024-11-17 20:25:37 -08:00
JRI98
a332acd7bf
Remove unused malformed related variants 2024-11-14 10:23:06 +00:00
Agus Zubiaga
9a5a5c3462
Remove irrelevant todos 2024-11-07 18:54:18 -03:00
Agus Zubiaga
2cce5ad023
Allow unsuffixed statements in parser
Moves the "STATEMENT AFTER EXPRESSION" error from the parser to canonicalization.
We'll later use this to allow this case in effectful functions.
2024-11-07 18:54:14 -03:00
Agus Zubiaga
7776883262
Unify functions fx vars 2024-11-07 18:54:13 -03:00
Agus Zubiaga
ef4eeb5c1a
Parse effectful arrow in function annotations 2024-11-07 18:54:11 -03:00
Sam Mohr
308defac46
Implement the try keyword with desugaring 2024-11-01 17:34:11 -07:00