Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
dba1675
feat: add hover display for trait assoc items
Young-Flash Nov 16, 2023
00358b1
rebase on lastest master
Young-Flash Feb 18, 2024
35ec595
add config item for hover display
Young-Flash Feb 18, 2024
2e87f31
add HoverDisplayConfig
Young-Flash Feb 22, 2024
527be25
unix_sigpipe: Add test for SIGPIPE disposition in child processes
Enselic Feb 24, 2024
ce4ae41
internal: simplify the process of inserting spaces after mut
roife Feb 27, 2024
4896626
fix: use 4 spaces for indentation in macro expansion
roife Feb 27, 2024
ec5236f
test: use 4 spaces for indetation in macro expansion
roife Feb 27, 2024
76b86b2
fix: clippy and format
roife Feb 27, 2024
6112ddf
Add prefix `file_` to `Semantics`'s `to_module_defs()`/`to_module_def…
regexident Feb 28, 2024
fac8a14
Add a more methods for resolving definitions from AST to their corres…
regexident Feb 28, 2024
03b02e6
internal: Move ide-assists codegen tests into an xtask codegen command
Veykril Feb 28, 2024
a01e4f8
Add basic support for Native Debug
lnicola Feb 29, 2024
06a883e
Take a reference instead of cloning
mo8it Feb 29, 2024
748f57c
Only clone when required
mo8it Feb 29, 2024
4aab2d5
Remove unneeded to_owned
mo8it Feb 29, 2024
9df73c6
Convert directly into an Arc<str>
mo8it Feb 29, 2024
00a049b
Avoid cloning deps
mo8it Feb 29, 2024
1d28aec
fix: autocomplete constants inside format strings
norskeld Feb 29, 2024
dba67b4
update for review
Young-Flash Mar 2, 2024
7c6f7b2
Update rustc_pattern_analysis
Nadrieril Mar 2, 2024
67f7557
Auto merge of #16738 - Nadrieril:update-pat-ana, r=lnicola
bors Mar 3, 2024
9fafbfa
Merge branch 'master' into sync-from-rust
lnicola Mar 3, 2024
037924c
Auto merge of #16740 - lnicola:sync-from-rust, r=lnicola
bors Mar 3, 2024
d444acd
Auto merge of #16719 - lnicola:native-debug, r=lnicola
bors Mar 4, 2024
518cfe8
Auto merge of #16723 - norskeld:constants-autocomplete, r=Veykril
bors Mar 4, 2024
0b7d4cc
Auto merge of #16690 - roife:fix-issue-16471, r=Veykril
bors Mar 4, 2024
d8feb90
Auto merge of #16703 - regexident:sema-ast-to-hir, r=Veykril
bors Mar 4, 2024
2074cc2
Auto merge of #16722 - mo8it:allocations, r=Veykril
bors Mar 4, 2024
4303e74
Cleanup
Veykril Mar 4, 2024
99a1b8f
Auto merge of #16747 - Veykril:cleanup, r=Veykril
bors Mar 4, 2024
c3c9f5f
internal: Compute syntax validation errors on demand
Veykril Mar 4, 2024
a7e9f12
Auto merge of #16748 - Veykril:on-demand-validation-err, r=Veykril
bors Mar 4, 2024
6e802a0
minor: Mark remove_unnecessary_else as experimental
Veykril Mar 4, 2024
00879b1
Auto merge of #16750 - Veykril:unnecessary-else, r=Veykril
bors Mar 4, 2024
4e8cbf3
Auto merge of #16708 - Veykril:codegen, r=Veykril
bors Mar 4, 2024
0964374
Move diagnostics docs generation into xtask/codegen
Veykril Mar 4, 2024
76463ee
Move lint definition generation into xtask/codegen
Veykril Mar 4, 2024
b9dbb8a
Regenerate lints table
Veykril Mar 4, 2024
9f14343
Auto merge of #16751 - Veykril:codegen, r=Veykril
bors Mar 4, 2024
ac641a1
Bump mio from 0.8.5 to 0.8.11
dependabot[bot] Mar 4, 2024
2a4ba42
fix: hide destructure_struct_binding assist if no public fields
Lindronics Mar 4, 2024
58e10c7
Auto merge of #16753 - rust-lang:dependabot/cargo/mio-0.8.11, r=lnicola
bors Mar 5, 2024
0c2e9fe
Auto merge of #16752 - Lindronics:destructure-struct-binding, r=Veykril
bors Mar 5, 2024
ce3216e
Auto merge of #15938 - Young-Flash:display_trait_item_when_hover, r=V…
bors Mar 5, 2024
fe0daa7
Revert "prioritise rustup sysroots over system ones"
Veykril Mar 5, 2024
c310aee
For toolchain binaries ue the full path found in $PATH
Veykril Mar 5, 2024
6b48133
Prefer cargo proxies when setting RUSTUP_TOOLCHAIN
Veykril Mar 5, 2024
b20e467
internal: Adjust a few things for trait assoc item hovers
Veykril Mar 5, 2024
124d5ff
Auto merge of #16756 - Veykril:hover-trait, r=Veykril
bors Mar 5, 2024
8844640
fix: Put style lints behind disabled-by-default config
Veykril Mar 5, 2024
676455f
Auto merge of #16757 - Veykril:style-lints, r=Veykril
bors Mar 5, 2024
00a6cc0
Update Cargo.lock
Veykril Mar 5, 2024
2898c42
Auto merge of #16758 - Veykril:cargo-lock, r=Veykril
bors Mar 5, 2024
ece18fe
fix: resolve sub-patterns inside range pattern
roife Mar 5, 2024
96a7c6a
fix: mir for range pattern
roife Mar 5, 2024
16995ce
test: add tests for constants inside range pattern
roife Mar 5, 2024
9cc3a9c
fix: formatting
roife Mar 5, 2024
b06726b
remove `ignore-hidden = false`
Young-Flash Mar 5, 2024
7c786ed
Auto merge of #16761 - Young-Flash:ignore_hidden, r=Veykril
bors Mar 5, 2024
223238d
Auto merge of #16759 - roife:fix-goto-def-for-constants-in-range-patt…
bors Mar 5, 2024
1afeea8
Add `fn parent_fn()` accessors for `hir::Param` & `hir::SelfParam`
regexident Mar 5, 2024
bf14131
Add `fn index()` accessor for `hir::Param`
regexident Mar 5, 2024
9169144
Auto merge of #16763 - regexident:param-accessors, r=Veykril
bors Mar 5, 2024
44be243
Add test explorer
HKalbasi Mar 1, 2024
767d5d3
Auto merge of #16662 - HKalbasi:test-explorer, r=HKalbasi
bors Mar 5, 2024
faea7fc
fix: keep attrs for assist 'generate_delegate_trait'
roife Mar 6, 2024
5c9ce7b
test: add tests for keeping attrs in assist 'generate_delegate_trait'
roife Mar 6, 2024
52d8ae7
Auto merge of #16766 - roife:fix-issue-15198, r=Veykril
bors Mar 6, 2024
a8f5611
fix: Function argument type inference with associated type impl trait
ShoyuVanilla Mar 6, 2024
1a55ab3
Auto merge of #16769 - ShoyuVanilla:issue-15412, r=Veykril
bors Mar 6, 2024
b85d38f
Auto merge of #16755 - Veykril:rustup-bins, r=Veykril
bors Mar 6, 2024
03420c3
fix: panic when split float numbers in scientific notation
roife Mar 6, 2024
e2daee6
test: add test for float_split_scientific_notation
roife Mar 6, 2024
91d181f
minor: fmt and clippy
roife Mar 6, 2024
e5889c9
Auto merge of #16770 - roife:fix-issue-16278, r=Veykril
bors Mar 6, 2024
1c6d1b4
fix: Add config and capability for test explorer
Veykril Mar 6, 2024
ce15e73
Auto merge of #16773 - Veykril:text-explorer, r=Veykril
bors Mar 6, 2024
a15cc86
Implement parent-child relation for `SourceRoot`s
alibektas Feb 26, 2024
9c50d12
Opt for FxHashMap<Id,Id> instead of <Id,Option<Id>> and apply request…
alibektas Mar 4, 2024
a3b6e89
Add tracing spans to macro generated database
Veykril Mar 6, 2024
09d33f3
Add diagnostics integrated benchmark
Veykril Mar 7, 2024
9c2fa76
Dedup hprof stuff
Veykril Mar 7, 2024
bd0ffb0
Remove accidental dependency between `parse_macro_expansion` and `parse`
Veykril Mar 7, 2024
00f6a7a
Auto merge of #16772 - Veykril:salsa-tracing, r=Veykril
bors Mar 7, 2024
a1fda64
Auto merge of #16742 - alibektas:13529/source_root_tree, r=Veykril
bors Mar 7, 2024
0ffc1ef
Auto merge of #16775 - Veykril:parse-macro-parse, r=Veykril
bors Mar 7, 2024
c04c0dd
fix: Don't force draw a dependency edge to the real_span_map query
Veykril Mar 7, 2024
e101f24
Auto merge of #16776 - Veykril:parse-macro-parse, r=Veykril
bors Mar 7, 2024
09b9a92
fix: Don't invalid body query results when generating desugared names
Veykril Mar 7, 2024
b1f6d56
Auto merge of #16777 - Veykril:body-invalid, r=Veykril
bors Mar 7, 2024
1b0b422
Update `rustc_pattern_analysis` to 0.42.0
Nadrieril Mar 7, 2024
e31484c
Update the other crates too
Nadrieril Mar 7, 2024
bbb441e
Auto merge of #16778 - Nadrieril:update-pat-ana, r=lnicola
bors Mar 7, 2024
cd2347e
Skip match diagnostics for partially unknown types
lnicola Mar 7, 2024
7f19beb
Auto merge of #16779 - lnicola:skip-unknown-types-match-diagnostics, …
bors Mar 7, 2024
1f37e5a
fix: Don't escape `\` and `$` in "Extract format expressions" assist
DropDemBits Mar 5, 2024
48cb059
Auto merge of #16781 - DropDemBits:extract-format-args-escaping, r=Ve…
bors Mar 7, 2024
7dadc64
minor: Update comments in `format_string_exprs`
DropDemBits Mar 7, 2024
bc38183
fix: Preserve `$` and `\` in postfix format completions
DropDemBits Mar 7, 2024
00a0125
Auto merge of #16782 - DropDemBits:format-string-exprs-comments, r=Ve…
bors Mar 8, 2024
b37ccfc
Remove unused keyword from visibility recovery
pksunkara Mar 7, 2024
2a41b2c
Improve readability of the parser code
pksunkara Mar 6, 2024
a838e44
Remove unncessary check for macro call
pksunkara Mar 6, 2024
1487bc2
Auto merge of #16785 - pksunkara:remove-crate-visibility-recovery, r=…
bors Mar 8, 2024
2b7b44b
Auto merge of #16786 - pksunkara:improve-readability, r=lnicola
bors Mar 8, 2024
2397e7a
Auto merge of #16787 - pksunkara:remove-macro-call-check, r=lnicola
bors Mar 8, 2024
0b55b01
ensure that sysroot is properly set for cross-targets
onur-ozkan Mar 8, 2024
dc99ad9
Some minor changes in the test explorer lsp extension
HKalbasi Mar 8, 2024
79508d9
remove unused struct Snap in lsif
mu001999 Mar 9, 2024
8f08bbe
Auto merge of #16795 - mu001999:master, r=Veykril
bors Mar 9, 2024
574e23e
Auto merge of #16794 - HKalbasi:test-explorer, r=lnicola
bors Mar 9, 2024
93a807f
[bootstrap] Move the split-debuginfo setting to the per-target section
TimNN Feb 28, 2024
047e17d
mir-opt tests: don't run a different set on --bless; enable --keep-st…
Nadrieril Mar 9, 2024
56493e4
Merge commit '574e23ec508064613783cba3d1833a95fd9a5080' into sync-fro…
lnicola Mar 10, 2024
b4e3b2e
Bring back in-rust-tree feature to ide
lnicola Mar 10, 2024
620607d
Rollup merge of #121573 - Enselic:sigpipe-child-process, r=Mark-Simul…
matthiaskrgr Mar 10, 2024
fa14b60
Rollup merge of #121754 - TimNN:split-target, r=Mark-Simulacrum
matthiaskrgr Mar 10, 2024
513ec6c
Rollup merge of #122205 - onur-ozkan:incorrect-sysroot-for-target, r=…
matthiaskrgr Mar 10, 2024
82779e2
Rollup merge of #122257 - Nadrieril:tweak-mir-opt-tests, r=clubby789
matthiaskrgr Mar 10, 2024
3aa6594
Rollup merge of #122272 - lnicola:sync-from-ra, r=lnicola
matthiaskrgr Mar 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/flycheck/src/test_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use crate::command::{CommandHandle, ParseFromLine};
pub enum TestState {
Started,
Ok,
Ignored,
Failed { stdout: String },
}

Expand Down
4 changes: 2 additions & 2 deletions crates/rust-analyzer/src/lsp/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ pub struct DiscoverTestParams {

#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub enum TestItemIcon {
pub enum TestItemKind {
Package,
Module,
Test,
Expand All @@ -182,7 +182,7 @@ pub enum TestItemIcon {
pub struct TestItem {
pub id: String,
pub label: String,
pub icon: TestItemIcon,
pub kind: TestItemKind,
pub can_resolve_children: bool,
pub parent: Option<String>,
pub text_document: Option<TextDocumentIdentifier>,
Expand Down
8 changes: 4 additions & 4 deletions crates/rust-analyzer/src/lsp/to_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1506,10 +1506,10 @@ pub(crate) fn test_item(
lsp_ext::TestItem {
id: test_item.id,
label: test_item.label,
icon: match test_item.kind {
ide::TestItemKind::Crate => lsp_ext::TestItemIcon::Package,
ide::TestItemKind::Module => lsp_ext::TestItemIcon::Module,
ide::TestItemKind::Function => lsp_ext::TestItemIcon::Test,
kind: match test_item.kind {
ide::TestItemKind::Crate => lsp_ext::TestItemKind::Package,
ide::TestItemKind::Module => lsp_ext::TestItemKind::Module,
ide::TestItemKind::Function => lsp_ext::TestItemKind::Test,
},
can_resolve_children: matches!(
test_item.kind,
Expand Down
1 change: 1 addition & 0 deletions crates/rust-analyzer/src/main_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ impl GlobalState {
flycheck::CargoTestMessage::Test { name, state } => {
let state = match state {
flycheck::TestState::Started => lsp_ext::TestState::Started,
flycheck::TestState::Ignored => lsp_ext::TestState::Skipped,
flycheck::TestState::Ok => lsp_ext::TestState::Passed,
flycheck::TestState::Failed { stdout } => {
lsp_ext::TestState::Failed { message: stdout }
Expand Down
31 changes: 25 additions & 6 deletions docs/dev/lsp-extensions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
lsp/ext.rs hash: 4b06686d086b7d9b
lsp/ext.rs hash: 6bc140531b403717

If you need to change the above hash to make the test pass, please check if you
need to adjust this doc as well and ping this issue:
Expand Down Expand Up @@ -416,7 +416,9 @@ interface TestItem {
range?: lc.Range | undefined;
// A human readable name for this test
label: string;
icon: "package" | "module" | "test";
// The kind of this test item. Based on the kind,
// an icon is chosen by the editor.
kind: "package" | "module" | "test";
// True if this test may have children not available eagerly
canResolveChildren: boolean;
// The id of the parent test in the test tree. If not present, this test
Expand All @@ -425,6 +427,10 @@ interface TestItem {
// The information useful for running the test. The client can use `runTest`
// request for simple execution, but for more complex execution forms
// like debugging, this field is useful.
// Note that this field includes some information about label and location as well, but
// those exist just for keeping things in sync with other methods of running runnables
// (for example using one consistent name in the vscode's launch.json) so for any propose
// other than running tests this field should not be used.
runnable?: Runnable | undefined;
};

Expand All @@ -451,8 +457,14 @@ the same as the one in `experimental/discoverTest` response.
**Request:** `RunTestParams`

```typescript
interface DiscoverTestParams {
interface RunTestParams {
// Id of the tests to be run. If a test is included, all of its children are included implicitly. If
// this property is undefined, then the server should simply run all tests.
include?: string[] | undefined;
// An array of test ids the user has marked as excluded from the test included in this run; exclusions
// should apply after inclusions.
// May be omitted if no exclusions were requested. Server should not run excluded tests or
// any children of excluded tests.
exclude?: string[] | undefined;
}
```
Expand Down Expand Up @@ -480,9 +492,16 @@ a `experimental/endRunTest` when is done.
**Notification:** `ChangeTestStateParams`

```typescript
type TestState = { tag: "failed"; message: string }
| { tag: "passed" }
| { tag: "started" };
type TestState = { tag: "passed" }
| {
tag: "failed";
// The standard error of the test, containing the panic message. Clients should
// render it similar to a terminal, and e.g. handle ansi colors.
message: string;
}
| { tag: "started" }
| { tag: "enqueued" }
| { tag: "skipped" };

interface ChangeTestStateParams {
testId: string;
Expand Down
9 changes: 7 additions & 2 deletions editors/code/src/lsp_ext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,20 @@ export type RunTestParams = {
export type TestItem = {
id: string;
label: string;
icon: "package" | "module" | "test";
kind: "package" | "module" | "test";
canResolveChildren: boolean;
parent?: string | undefined;
textDocument?: lc.TextDocumentIdentifier | undefined;
range?: lc.Range | undefined;
runnable?: Runnable | undefined;
};
export type DiscoverTestResults = { tests: TestItem[]; scope: string[] };
export type TestState = { tag: "failed"; message: string } | { tag: "passed" } | { tag: "started" };
export type TestState =
| { tag: "failed"; message: string }
| { tag: "passed" }
| { tag: "started" }
| { tag: "enqueued" }
| { tag: "skipped" };
export type ChangeTestStateParams = { testId: string; state: TestState };
export const discoverTest = new lc.RequestType<DiscoverTestParams, DiscoverTestResults, void>(
"experimental/discoverTest",
Expand Down
6 changes: 5 additions & 1 deletion editors/code/src/test_explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const prepareTestExplorer = (
};
const test = testController.createTestItem(
item.id,
`$(${iconToVscodeMap[item.icon]}) ${item.label}`,
`$(${iconToVscodeMap[item.kind]}) ${item.label}`,
uri,
);
test.range = range;
Expand Down Expand Up @@ -150,6 +150,10 @@ export const prepareTestExplorer = (
currentTestRun!.passed(test);
} else if (results.state.tag === "started") {
currentTestRun!.started(test);
} else if (results.state.tag === "skipped") {
currentTestRun!.skipped(test);
} else if (results.state.tag === "enqueued") {
currentTestRun!.enqueued(test);
}
}),
);
Expand Down