Commit Graph
179 Commits
Author SHA1 Message Date
José Valim e8ea6a5259 Print type violation slogan 2024-06-18 12:46:53 +02:00
José Valim 7a4060cbf3 Add detail and span to typing diagnostics
Closes #13646.
2024-06-10 16:13:39 +02:00
José Valim 21840ed563 Do not assume all parser errors can be parsed into erlang terms 2024-06-05 12:21:23 +02:00
José Valim b3710dea97 Always start IEx shell via -user
There is some uncertainty as to wether it will be possible
to start an IEx shell dynamically from a -noshell environment.

Therefore, this PR simplifies the shell booting to still
rely on -user, as it did earlier than Erlang/OTP 26.
2024-02-29 14:48:54 +01:00
José Valim e4a71032d5 Always log errors at the end 2024-01-17 23:14:20 +01:00
José Valim 926560350b Extract snippet in elixir_errors to simplify exception handling 2023-12-21 21:14:44 +01:00
José Valim 7f3d62108b Consider column in snippets, closes #13199 2023-12-21 19:26:06 +01:00
José Valim 3a52c2d729 Add source field to diagnostics 2023-12-21 17:05:47 +01:00
Vinícius Müller 1d978bf73c Improve unclosed delimiter messages (#13123) 2023-12-04 12:46:15 +01:00
José Valim dfba5db6c0 Consider start line in MismatchedDelimiterError 2023-11-13 12:28:39 +01:00
José Valim 665a459a59 Handle nil values in IO.warn 2023-11-10 12:53:34 +01:00
George Guimarães eb20bdd716 Fix some typos (#13043) 2023-10-30 17:48:47 +01:00
Vinícius Müller 9a74a73a00 Normalize hint labels (#12958) 2023-09-23 18:59:08 +02:00
José Valim 32690dd7d1 Read snippets as binaries 2023-09-16 20:30:04 +02:00
Vinícius Müller 10077bdb5e Add span to unused/undefined variable diagnostics (#12940) 2023-09-16 20:11:26 +02:00
Vinícius Müller f1594048a5 Unicode support for mismatched delimiter errors (#12935) 2023-09-16 10:59:59 +02:00
Vinícius Müller 3111a5b78a Improve mismatched delimiter message (#12928) 2023-09-15 18:31:48 +02:00
Vinícius Müller 0349240827 Add MistmatchedDelimiterError (#12918) 2023-09-12 12:18:51 +02:00
Vinícius Müller 7e9006988d Add span field to diagnostics (#12843) 2023-09-03 21:14:51 +02:00
José Valim d3a6395edf Only add spacing to error message if snippet is present 2023-07-31 13:11:33 +02:00
Vinícius Müller 48b471d055 Update diagnostics reporting format (#12813) 2023-07-20 18:49:55 +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
Vinícius Müller 384ca45a16 Fix infinite recursion in get_file_line (#12714) 2023-06-26 11:38:11 +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
Jean Klingler 88d6436a39 Refactoring: use recursion instead of building list (#12711) 2023-06-25 16:54:56 +09: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
José Valim fcc743c47f Simplify whitespace prunning 2023-06-19 13:29:54 +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 34f54c0cea Pass column info through meta_location and env_format (#12639) 2023-06-09 19:24:34 +02:00
sabiwara 4fc5b77c40 Code.with_diagnostics/2 formats paths as relative (#12590)
* Code.with_diagnostics/2 formats paths as relative

* Fix in :elixir_errors instead

* Fix it in parallel checker too
2023-05-25 20:07:09 +09:00
José Valim 5480491dc5 Include column information in unused variable warning, closes #12591 2023-05-23 20:31:49 +02:00
José Valim a0f0f75ee8 Add Code.with_diagnostics/2, closes #12276 2023-05-16 11:52:59 +02:00
José Valim 6476355246 Keep stacktrace in diagnostics 2023-05-15 23:35:07 +02:00
José Valim 48e2efd2d9 Return diagnostics from Kernel.ParallelCompiler 2023-05-10 12:32:25 +02:00
José Valim b04bbed1e3 Check for prim_tty on Erlang/OTP 26+ 2023-03-23 15:52:27 +01:00
Andrea Leopardi c402e8336c Add support for multi-letter uppercase sigils (#12448) 2023-03-05 13:10:28 -06:00
José Valim a3a7b15768 Fix accidental variable match in errors from macro, closes #12340 2023-01-15 11:19:02 +01:00
José Valim d634355ace Fix code comment 2022-11-29 08:18:13 +01:00
José Valim b24869687b Introduce mechanism to collect several errors in a module (#12275) 2022-11-28 15:40:30 +01:00
José Valim 386113af86 Include snippets in more syntax errors 2022-10-25 12:52:20 +02:00
felipe stival 85d86fd120 Change approach: never show error if line is empty (#11466) 2021-12-10 09:27:25 +01:00
Michał Łępicki 1eccae1232 Settle elixir_errors:parse_error/6 InputString as charlist (#11345) 2021-10-25 23:09:32 +02:00
José Valim 3b2f5057df Only consider StartColumn on first line 2021-10-25 16:33:16 +02:00
felipe stival ac80ddc123 Show code snippet on syntax and token missing errors (#11332)
Closes #11280.
2021-10-25 16:18:29 +02:00
José Valim 65ab34224f 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 a355450af8 Ensure waiting is tracked across typespecs
The Elixir compiler spawns a separate process per file.
When a file has to wait on another module, Elixir tracks
in the compiler that the file is waiting.

However, every time a module is defined, the Elixir compiler
spawns a separate process to compile to .beam, and this
process may expand structs in the typespec. Since this
new process is no longer the original file process, Elixir
was not able to track its waiting time.

This PR address this issue by passing the original file_pid
to the .beam compiler process. Note though that, if we
change typespecs to be compiled in the original file process,
this change is no longer required, but at the moment there are
no plans to make such change.

Closes #11036.
2021-06-05 19:21:12 +02:00
José Valim 3c45984d2c Assume Elixir is not started when accessing configs 2021-05-21 12:02:15 +02:00