Commit Graph
4140 Commits
Author SHA1 Message Date
Wei Huang d52f533761 Make Registry.send work when value part is present (#11742)
Fix #11740.
2022-04-06 11:01:14 +02:00
José Valim e0c8b8af87 Manual stacktrace munging on eval is no longer necessary on Erlang/OTP 25 2022-03-25 12:02:35 +01:00
Michał Łępicki 89e57882e1 Tweak type unification to fix infinite loop with recursive vars (#11664) 2022-02-28 14:47:31 +01:00
José Valim 67cf14c857 Add opening delimiter to sigil metadata/opts 2022-02-17 20:43:21 +01:00
José Valim 4b480cb7e0 Allow iodata in sigil formatting functions 2022-02-17 14:57:20 +01:00
Kevin bb17204741 Only check for unwanted functions (#11632) 2022-02-17 09:05:59 +01:00
José Valim bac5b1d800 Add compile-time dependencies on require
Projects like Plug use require to establish compile
time dependencies inside a Plug. The fact require
only added a compile-time dependency in v1.13.0 was
therefore a regression, addressed by this commit.
2022-02-14 12:41:00 +01:00
José Valim babbae7e47 Handle more unicode sequences in split_at, closes #11617 2022-02-09 15:53:39 +01:00
José Valim 25e480f3d0 Do not break signatures over multiple lines 2022-02-01 10:04:30 +01:00
José Valim 2dc6773d6c Fix recursion on guards with map fields, closes #11602 2022-01-31 14:58:39 +01:00
Matt McCoy d99a16256b Supply file and line to formatter plugins (#11591)
Allow formatter plugins to print errors with accurate file and
line information. The line is only provided when a sigil is being
formatted.
2022-01-24 08:37:17 +01:00
felipe stival cc9e9b29a7 Fix duplicate bindings causing weird behaviour (#11584)
Before this fix, evaluating `b = a` with assignments of: `a: 1, a: 2, c:
3` would eval AST equivalent to `^c = a`. This happened due to binding
normalization generating version numbers larger than the total number of
bindings. Later in the pipeline, the number of bindings is used to
compute the next version number, which would then conflict with an
existing binding.

This commit fixes that by not increasing the version number when
a repeated binding is normalized.
2022-01-19 19:38:23 +01:00
Eksperimental 67f7c6ba5b Fix bug with edge-case when converting to algebra quoted Elixir alias (#11572)
The following code would crash:

    iex> Code.quoted_to_algebra(Elixir)
    ** (MatchError) no match of right hand side value: "Elixir"
        (elixir 1.13.1) lib/code/normalizer.ex:254: Code.Normalizer.normalize_literal/3
        (elixir 1.13.1) lib/code.ex:1107: Code.quoted_to_algebra/2

Therefore, this as well:

    iex> Macro.to_string(Elixir)
    ** (MatchError) no match of right hand side value: "Elixir"
        (elixir 1.13.1) lib/code/normalizer.ex:254: Code.Normalizer.normalize_literal/3
        (elixir 1.13.1) lib/code.ex:1107: Code.quoted_to_algebra/2
        (elixir 1.13.1) lib/macro.ex:948: Macro.to_string/1
2022-01-16 09:28:25 +01:00
Aleksei Matiushkin 01a4889e39 Fix the nested uniq: acc name clash by preserving a scope (#11532) 2022-01-01 09:56:42 +01:00
Thiago Santos ab1da111bf Warn on zero arity callbacks inside protocols (#11519) 2021-12-22 22:01:33 +01:00
José Valim 6549b00eba Ensure context modules are handled in optimized defmodule 2021-12-22 12:22:22 +01:00
José Valim 3d3453c1e2 Do not emit warnings on Cursor.Fragment.container_cursor_to_quoted/2 2021-12-16 16:44:10 +01:00
José Valim 8afac93a05 Ensure async streams can be consumed from a separate process 2021-12-13 15:49:44 +01:00
Dorgan b725b8c055 Set a max line_length for Macro.to_string (#11471) 2021-12-11 10:45:32 +01:00
felipe stival 47171d934d Change approach: never show error if line is empty (#11466) 2021-12-10 09:28:47 +01:00
José Valim edafcc4e9a Handle improper lists on apply, closes #11465 2021-12-09 21:22:59 +01:00
Dorgan 233fc09e67 Fix formatting of lists in module attribues (#11462) 2021-12-08 23:51:40 +01:00
José Valim 31e24b3a12 Fix codepoint byte counting in slice, closes #11461 2021-12-08 23:50:48 +01:00
José Valim 2efc1e5cac Make sure --version flag halts elixir and iex, closes #11453 2021-12-07 08:24:01 +01:00
José Valim a0b77bd884 Do not deprecate URI.parse/1
Closes #11450.
2021-12-06 14:59:48 +01:00
Parker Selbert cbba61a386 Specific base typespecs (#11449)
* Use specific options for base option typespecs

Each function had `keyword` as the option type, which didn't help guard
against typos or mismatched options.

* Fix padding use in encode/decode identity test
2021-12-05 19:50:33 +01:00
Dorgan 1dc6e7144f Fix normalization of kw list in blocks (#11431) 2021-12-02 08:22:43 +01:00
Eksperimental 1f9bc5dc95 Improve Version.compile_requirement/1 (#11427) 2021-11-30 11:25:36 +01:00
José Valim 0974e9075a Skip errors on head of generated clauses, closes #11407 2021-11-23 14:30:44 +01:00
José Valim 709383f142 Warn on trailing commas on calls, closes #11399 2021-11-19 11:46:37 +01:00
Dorgan e9be638d92 Fix normalizer not preserving user choice on module attribute lists (#11397) 2021-11-17 15:06:02 +01:00
José Valim 6d408bb0c0 Reject bidirectional formatting characters (#11391) 2021-11-15 21:10:51 +01:00
José Valim ffd891a349 Support escaping of terminators in uppercase sigils heredocs for consistency, closes #11390 2021-11-15 14:21:28 +01:00
José Valim d7b1591e83 Do not raise on variable looking like an empty tuple 2021-11-13 12:37:59 +01:00
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