José Valim
bd454e286d
Ensure dbg module is a compile-time dependency
...
Related to #12892 .
2023-08-28 13:30:46 +02:00
Zach Allaun
b50c5eb031
Fix Code.Fragment.surround_context/2 for submodules of non-aliases ( #12890 )
2023-08-24 20:55:42 +02:00
sabiwara
03ef7a1059
Always pass stracktrace when necessary
2023-08-23 12:05:52 +02:00
Dave Lucia
44cce79e00
Improve UndefinedFunctionError for unqualified module ( #12859 )
...
This PR builds off of #12839 , handling the case where a developer
forgets to alias a module, resulting in UndefinedFunctionError.
Imagine we have the following modules in our Elixir program.
```elixir
def MyAppWeb.Context.Event do
def foo, do: :bar
end
```
If the developer attempts to reference this module, but forgets to type
the alias, they will now get module suggestions like.
```elixir
** (UndefinedFunctionError) function Event.foo/0 is undefined (module Event is not available). Did you mean:
* MyAppWeb.Context.Event.foo/0
Event.foo()
iex:2: (file)
```
2023-08-15 11:12:34 +02:00
José Valim
e0d04e1ffe
Warn on nullary remote calls, related to #9510
2023-08-15 10:30:57 +02:00
José Valim
17b8b364c0
More tests for invalid sequences
2023-08-12 22:37:50 +02:00
José Valim
d5931e4e27
Optimize and auto-synchronize String.capitalize/2
2023-08-12 22:20:38 +02:00
José Valim
415bc8714b
Bring String.capitalize/2 back
2023-08-12 22:08:46 +02:00
José Valim
fb69ea792e
Bring turkic cases back to capitalize
2023-08-12 21:58:24 +02:00
Dave Lucia
458fcaf50f
Improve UndefinedFunctionError for mis-cased module ( #12839 )
2023-08-09 17:06:35 +02:00
José Valim
76a92b5a80
Deprecate String.capitalize/2 in favor of :string.titlecase/1
...
When capitalize/2 was written, Erlang did not provide titlecase
functions. capitalize/2 also downcases the rest of the string
while Erlang doesn't, which is a common contention point.
Given our titlecase implementation requires 40kb of additional
code in .beam files, it makes sense to unify it with Erlang's
(which we have already done for most non-critical functionality
in unicode).
2023-08-09 16:15:41 +02:00
Jean Klingler
6a395a7da1
Fragment handle anonymous calls with extra spaces ( #12847 )
2023-08-08 20:01:54 +09:00
Jean Klingler
11b2e3e333
Code.Fragment handles anonymous function ( #12846 )
2023-08-08 19:21:40 +09:00
Panagiotis Nezis
717efbeaa9
Consistently raise on invalid ANSI sequences in IO.ANSI.format ( #12842 )
...
If `enabled` is set to `true` an invalid ANSI sequence will raise
an `ArgumentError`. On the other hand if `enabled` is set to `false`
no error is raised and the sequence is silently ignored.
This can lead to inconsistent behaviours for CLI tools based on a
configuration setting. Additionally since in tests a common pattern
is to disable ANSI sequences you may have successful tests but
exceptions when executing the code in production with enabled ANSI
sequences.
2023-08-06 18:41:04 +02:00
Jean Klingler
146fb4e3ff
Make has_unquote/1 quote-aware ( #12836 )
2023-08-05 20:39:05 +09:00
Jean Klingler
c4b5974d23
Capture negative step slice warnings in tests ( #12838 )
2023-08-05 20:15:12 +09:00
Jean Klingler
cb8abb5ba4
Avoid error message in test ( #12837 )
2023-08-05 20:14:48 +09:00
Jean Klingler
ba4c160080
Warn on unused defp/defmacrop using unquote/1 ( #12832 )
...
* Remove unused macro
* Remove unused default arg in test
* Warn on unused defp/defmacrop using unquote/1
* Add tests for metaprogrammed clauses without warnings
2023-08-05 19:07:50 +09:00
Jean Klingler
450aacb88f
Fix bug in surround_context alias handling ( #12830 )
2023-08-03 23:14:08 +09:00
José Valim
d3a6395edf
Only add spacing to error message if snippet is present
2023-07-31 13:11:33 +02:00
José Valim
bc45fabd9c
Do not expand aliases recursively, closes #12822
2023-07-26 12:46:35 +02:00
Artem Solomatin
feb7dc5b0c
Fix supported time units ( #12819 )
2023-07-24 17:26:13 +02:00
Jean Klingler
998504005b
Add test for :zip_input_on_exit in Task.Supervisor ( #12816 )
2023-07-24 19:35:29 +09:00
Vinícius Müller
48b471d055
Update diagnostics reporting format ( #12813 )
2023-07-20 18:49:55 +02:00
Jean Klingler
41a21175d2
IEx uses erlang shell rendering for erlang docs ( #12803 )
...
* IEx uses erlang shell render for erlang function docs
* Add tests for erlang module docs and types
* Handle erlang module docs with :shell_docs
* Handle erlang module types with :shell_docs
* Avoid fetching docs twice
* Cleanup unused erlang doc handling
* Use example that exists in OTP24
2023-07-19 23:56:14 +09:00
José Valim
4614de646a
Optional arguments must be counted from the end, closes #10095
2023-07-19 14:31:53 +02:00
Jean Klingler
4411dbe3f2
Expand captured args with regular context ( #12763 )
...
* Expand captured args with regular context
* Rewrite test depending on current line
* Display a different warning for captured arguments
* Mention the reason in a comment
2023-07-07 22:22:01 +09:00
José Valim
93ff4a22de
Disable tail call optimization on file root entries
2023-07-07 13:37:44 +02:00
José Valim
58bb5194d3
Propagate diagnostics from inner compiler process
2023-07-06 09:41:57 +02:00
José Valim
56098b98db
Only include location in diagnostic when precise
2023-07-03 17:55:27 +02:00
Vinícius Müller
f60d54bbc1
Show snippets on additional diagnostics printing ( #12725 )
2023-07-02 14:29:41 +02:00
José Valim
cd5f45b1c6
Add smoke tests for -e/--eval ( #12743 )
2023-07-02 11:04:11 +02:00
José Valim
a65dae971f
Consider surround context until end whenever possible
2023-06-30 15:16:04 +02:00
Vinícius Müller
79c90bf8eb
Report correct position for duplicate struct fields diagnostic ( #12718 )
2023-06-26 21:56:30 +03:00
José Valim
7b67dd4553
Remove trailing space and trailing newlines in snippets
2023-06-25 20:04:11 +02:00
Vinícius Müller
2e87bc8385
Align error snippet with stacktrace on single digit lines ( #12709 )
2023-06-25 19:46:24 +02:00
Vinícius Müller
86813b4ba6
Reword grouped warnings message ( #12708 )
2023-06-24 23:59:42 +02:00
Vinícius Müller
774d10b83e
Improve compiler warnings visuals ( #12683 )
2023-06-24 22:18:37 +02:00
Jean Klingler
a7edd6ea47
Parser honors :static_atoms_encoder for multi-letter sigils ( #12706 )
...
* Unify sigil token generation
* Parser honors :static_atoms_encoder for multi-letter sigils
* Remove chars from token, reverse engineer from atom
2023-06-24 18:29:24 +09:00
Vinícius Müller
07ff933f78
Assert on compiler warnings content rather than format ( #12679 )
2023-06-20 12:17:51 +02:00
José Valim
47a5e30155
Make IO.binwrite consistent with IO.write
2023-06-19 15:27:12 +02:00
Vinícius Müller
0da6662b5e
Improvide diagnostics on lexer exceptions ( #12670 )
2023-06-19 11:07:59 +02:00
Vinícius Müller
b7d3a29db8
Assert on error message rather than format ( #12675 )
2023-06-15 20:06:10 +02:00
sabiwara
2f4a3138cd
Fix slicing MapSet with stepped range ( #12667 )
2023-06-14 12:03:45 +02:00
Vinícius Müller
24883a476c
Use british spelling when referring to elixir behaviour ( #12663 )
2023-06-14 10:25:43 +02:00
José Valim
04b6cd342c
Improve error message for invalid module attribute usage, closes #12656
2023-06-13 16:54:01 +02:00
Vinícius Müller
e2d09bcb6d
Enable column on unused variable test ( #12660 )
2023-06-13 16:37:30 +02:00
José Valim
9041fca941
Fix Path suite on Windows
2023-06-13 15:29:04 +02:00
José Valim
8f43be2ca6
Do not deprecate relative paths, instead make sure the paths are proper
2023-06-13 15:08:03 +02:00
José Valim
bacea2cef6
Keep capture operator on container cursor to quoted
2023-06-12 10:43:51 +02:00