Commit Graph
4106 Commits
Author SHA1 Message Date
Eksperimental 00a0f07824 Allow Application.compile_env* to accept attributes (#11383) 2021-11-11 22:05:28 +01:00
José Valim 0e59c68428 Do not crash on duplicate bindings, closes #11378 2021-11-10 19:27:59 +01:00
José Valim fbfb1b4a12 Do not extract comments without a newline 2021-11-08 18:05:59 +01:00
José Valim cf5762ad24 Use keyword syntax by default in tuple formatting 2021-11-08 17:25:36 +01:00
José Valim ece0530870 Fix regression on URI.parse/1, closes #11363 2021-11-07 10:48:26 +01:00
Guillaume Duboc 48b838a840 Fix formatting of map-like types in warnings (#11351)
This came up in issue #11204:

When emitting a warning for a type unification error,
the compiler overly simplifies the formatting of types
when these are maps or unions of maps.

To address this, we recursively check for maps inside
of a union type when comparing it to another map-like type.
2021-11-07 09:31:00 +01:00
Tyler A. Young 1766731dd4 Improvements to Enum.slide/3 (#11361)
- Support negative insertion indices
- Give a clear RuntimeError, rather than a baffling CondClauseError, when you ask for an insertion point that matches the last element of your range
2021-11-03 23:41:25 +01:00
Dorgan 34f32ef8a0 Keep keyword format of tuple last element (#11354) 2021-10-31 22:26:59 +01:00
Tyler A. Young c1d2bc7cc4 Add Enum.slide/3 (#11349) 2021-10-31 12:24:35 +01:00
felipe stival c5269a5230 Typespecs: show expanded module name on inexistent struct field error (#11353)
Closes #11352.
2021-10-30 09:39:44 +02:00
Maarten van Vliet b166e8e184 Pass sigil/modifiers through to formatter (#11348)
This allows the formatter plugins to format content
based on whether it's a file or a sigil being formatted.
The modifiers could be used for additional options.
2021-10-26 14:06:06 +02:00
José Valim e5e5170426 Use algebra concat instead of binary concat 2021-10-25 23:22:00 +02:00
Michał Łępicki dec273346a Ensure Code.string_to_quoted input only needs the List.Chars protocol (#11344) 2021-10-25 22:07:55 +02:00
José Valim f2ad9823d8 Only consider StartColumn on first line 2021-10-25 16:33:16 +02:00
felipe stival edcb9096d5 Show code snippet on syntax and token missing errors (#11332)
Closes #11280.
2021-10-25 16:18:29 +02:00
José Valim e414cc0e83 Add URI.new/1 and URI.new!/1 (#11341)
Closes #10865.
2021-10-25 13:10:14 +02:00
Udo Kramer 95357ff453 Fix a few typos (#11342) 2021-10-25 12:32:42 +02:00
José Valim 5a4c03c02e Handle more incomplete expressions in cursor_context_to_quoted 2021-10-24 17:22:01 +02:00
José Valim 9154c8b240 Include column in warnings emitted by compiler (#11339)
We also extend Mix.Tasks.Compiler.Diagnostic
to include {line, column} as possible position.
We also explicitly document the behaviour of
line=0, which is equivalent to unknown line.
Elixir was already setting the line to zero in
multiple occasions prior to this patch, so this
patch makes it official and we stop returning `nil`
for said cases.
2021-10-24 16:28:36 +02:00
José Valim f3155007dd Include column in more errors whenever possible 2021-10-24 15:58:19 +02:00
José Valim 7693b05016 Revert "Default to including columns by default"
This reverts commit 213cba2baa.

Including columns by default make Ecto test suite
consistently 10% slower and that's likely to replicate
across the board.
2021-10-23 10:28:02 +02:00
José Valim 213cba2baa Default to including columns by default
This changes the default for Code.string_to_quoted/2
and friends, so it may break tests matching explicitly
on the output, but the functionality wise the AST should
still be the same. The reason why it is important to make
this change is to provide better error messages throughout
Elixir.
2021-10-22 21:21:19 +02:00
Eksperimental fe372a8e5a Add specs and improve guards to Calendar.ISO.parse_*/2 functions (#11329) 2021-10-22 21:19:15 +02:00
José Valim 727cd8a318 Refactor and format code 2021-10-16 21:14:17 +02:00
José Valim b2b0d895e3 Support token_metadata in container_cursor_to_quoted 2021-10-16 20:56:08 +02:00
José Valim 78bbaf8c6e Add Macro.postwalker/1 2021-10-16 18:22:18 +02:00
José Valim 4fc23d0300 Add Macro.prewalker/1 2021-10-16 16:09:21 +02:00
José Valim 23bb08885f Add Code.Fragment.container_cursor_to_quoted/2 (#11315) 2021-10-16 15:12:09 +02:00
sabiwara 8203cf171a Tokenizer uses static_atoms_encoder on quoted keyword keys (#11313)
Closes #11312
2021-10-15 08:10:18 +02:00
José Valim fdd6ef8570 Also mention pattern matching on hint 2021-10-10 19:21:06 +02:00
Seth Archer Brown cd1ea8038d Fix infinite loop in String.slice/2 (#11302) 2021-10-07 08:12:17 +02:00
José Valim f2c4f9f9f9 Do not escape metadata in unquote with dynamic expression 2021-10-05 12:21:50 +02:00
felipe stival c6c473de2e Always show step when range is descending (#11290) 2021-10-04 13:20:36 +02:00
Kip Cole 067909fb79 Change Calendar.year_of_era/1 callback to /3 (#11285)
In order to support calendars which can change
era any time during the calendar year, the callback
Calendar.year_of_era/1 is changed to Calendar.year_of_era/3.

Since Calendar.ISO.year_of_era/1 is a public function,
default arguments for month and day are set if
year_of_era/1 is called to allow compatibility with
any existing code that relies upon this function.
2021-10-04 09:09:13 +02:00
Luiz Rodrigo de Souza 480d64042b Add import Mod, only: :sigils (#11284) 2021-10-03 18:31:10 +02:00
Danila Poyarkov c4b4bc3371 Allow sigil modifiers to contain digits (#11283) 2021-10-02 22:10:05 +02:00
José Valim a8d628af44 Reduce copy of MFAs and values on Task.async* functions
Task.Supervisor.async/* would copy the MFA to the supervisor
process. async_stream/* would additionally copy the value to
the stream coordinator. This commit makes it so those copies
are no longer necessary. The only unnecessary copy is in
Task.Supervisor.start_child/2 which we can't address due to
backwards compatibility.
2021-10-01 23:36:58 +02:00
José Valim adbd1f3121 Add task ignore 2021-10-01 23:36:58 +02:00
José Valim 763072b2c4 Run the formatter 2021-09-21 15:43:09 +02:00
José Valim 98a8497fc0 No longer encode missing docs as empty maps in chunk 2021-09-21 15:22:55 +02:00
José Valim 7d6e8897ef Ensure protocol consolidation metadata is deterministic, closes #11249 2021-09-19 19:56:42 +02:00
José Valim c361cdda05 Ensure proper precedence of and/or in version requirements (#11238) 2021-09-16 10:40:31 +02:00
Quinn Wilton 1764d4ed02 Set inspect_fun to the default when building the error message
This improves unclear errors that result in the case where a
custom protocol is passed as the inspect_fun option, and that
protocol is not implemented for some of the types being inspected.

Missing struct implementations are a pathological case here, because
when trying to inspect them as maps, a seemingly unrelated error
message about a missing atom implementation will be reported, while
trying to inspect the value of the :__struct__ field
2021-09-15 12:36:58 +02:00
José Valim bc456d8711 Support plugins in the formatter 2021-09-15 09:45:45 +02:00
José Valim 96dd68cb60 Allow custom sigil formatting on Code.format_string! 2021-09-15 09:45:45 +02:00
José Valim d6d8ad419f Pass annotation forward when building Erlang AST 2021-09-11 10:21:31 +02:00
José Valim 8f96b9a114 Also handle nfd at the beginning of strings 2021-09-06 23:00:06 +02:00
Willian Frantz f429a27e21 Fix nfd cluster columns (#11231) 2021-09-06 22:50:32 +02:00
Aleksei Magusev 4f49d147df Standardize on do-end notation for the block syntax (#11228) 2021-09-06 10:59:57 +02:00
José Valim 25e9e1aba6 Remove cyclic boot check as it fails when restarting daemon 2021-09-06 10:26:20 +02:00