Commit Graph

21 Commits

Author SHA1 Message Date
Alexander Gonzalez
e57ad5456c fix: Typos 2021-07-27 18:31:21 -04:00
Aleksey Kladov
4af7a35197 internal: remove def-level diagnostics tests 2021-06-13 18:45:38 +03:00
Maan2003
6cc6dee9e9
clippy::useless_conversion 2021-06-13 09:25:55 +05:30
Jonas Schievink
9fdb8f9037 Make it opt-in 2021-06-03 18:09:21 +02:00
Jonas Schievink
cb5454db86 Diagnose unimplemented built-in macros 2021-05-30 04:19:47 +02:00
Jonas Schievink
b52df91877 Stop expanding UseTrees during ItemTree lowering 2021-05-26 01:01:58 +02:00
Aleksey Kladov
5c9f31d4c2 internal: move diagnostics to hir
The idea here is to eventually get rid of `dyn Diagnostic` and
`DiagnosticSink` infrastructure altogether, and just have a `enum
hir::Diagnostic` instead.

The problem with `dyn Diagnostic` is that it is defined in the lowest
level of the stack (hir_expand), but is used by the highest level (ide).

As a first step, we free hir_expand and hir_def from `dyn Diagnostic`
and kick the can up to `hir_ty`, as an intermediate state. The plan is
then to move DiagnosticSink similarly to the hir crate, and, as final
third step, remove its usage from the ide.

One currently unsolved problem is testing. You can notice that the test
which checks precise diagnostic ranges, unresolved_import_in_use_tree,
was moved to the ide layer. Logically, only IDE should have the infra to
render a specific range.

At the same time, the range is determined with the data produced in
hir_def and hir crates, so this layering is rather unfortunate. Working
on hir_def shouldn't require compiling `ide` for testing.
2021-05-25 17:49:59 +03:00
Jonas Schievink
9e8feeb94a Fix TestDB::module_at_position with submodules 2021-04-17 03:34:05 +02:00
Edwin Cheng
20d55ce44d Allow include! an empty content file 2021-04-03 12:50:55 +08:00
Jonas Schievink
2b5ea5c730 Simplify hir_def TestDB 2021-03-13 02:24:53 +01:00
Jonas Schievink
27f77060e2 Add TestDB::module_at_position 2021-02-09 17:22:57 +01:00
Yoshua Wuyts
79d103d5b4 Remove redundant clones 2021-02-05 16:57:26 +01:00
Jonas Schievink
5c241b0766 Create all ModuleIds through a DefMap method
`ModuleId` needs to be able to represent blocks, and only the
associated `DefMap` will know how to construct that `ModuleId`
2021-01-25 15:21:33 +01:00
Jonas Schievink
0587b99fde Make public DefMap fields private 2021-01-20 15:41:18 +01:00
Aleksey Kladov
6e24321e45 Introduce anchored_path
They allow to represent paths like `#[path = "C:\path.rs"] mod foo;`
in a lossless cross-platform & network-transparent way.
2020-12-09 19:07:05 +03:00
Jonas Schievink
306c6cbaac Use original_file_range in TestDB 2020-12-08 19:03:24 +01:00
Jonas Schievink
678c74430b Handle macros in TestDB::check_diagnostics 2020-12-08 17:16:18 +01:00
Aleksey Kladov
b610118453 Deny unreachable-pub
It's very useful when `pub` is equivalent to "this is crate's public
API", let's enforce this!

Ideally, we should enforce it for local `cargo test`, and only during
CI, but that needs https://github.com/rust-lang/cargo/issues/5034.
2020-11-02 14:07:08 +01:00
Jonas Schievink
93dc6f511b Diagnose #[cfg]s in bodies 2020-10-23 19:27:04 +02:00
Jonas Schievink
f792bc7ddd Add annotation-based nameres diagnostic tests 2020-09-16 17:26:51 +02:00
Aleksey Kladov
b28c54a2c2 Rename ra_hir_def -> hir_def 2020-08-13 16:29:33 +02:00