Skip to content

fix: file_structure exclude comment and attr prefix#22401

Open
A4-Tacks wants to merge 1 commit into
rust-lang:masterfrom
A4-Tacks:file-struct-no-comment
Open

fix: file_structure exclude comment and attr prefix#22401
A4-Tacks wants to merge 1 commit into
rust-lang:masterfrom
A4-Tacks:file-struct-no-comment

Conversation

@A4-Tacks
Copy link
Copy Markdown
Member

Avoid document comments taking up a large number of lines and not being able to see item definitions during preview and node selection

Other LSP implement: tsserver and clangd are also not included comments

Example

// comment
/// doc
struct Foo;

// comment
/// doc
fn foo() {}

Before this PR

>// comment
>/// doc
>struct Foo;

>// comment
>/// doc
>fn foo() {}

After this PR

 // comment
 /// doc
>struct Foo;

 // comment
 /// doc
>fn foo() {}

Avoid document comments taking up a large number of lines and not being able to see item definitions during preview and node selection

Other LSP implement: tsserver and clangd are also not included comments

Example
---
```rust
// comment
/// doc
struct Foo;

// comment
/// doc
fn foo() {}
```

**Before this PR**

```rust
>// comment
>/// doc
>struct Foo;

>// comment
>/// doc
>fn foo() {}
```

**After this PR**

```rust
 // comment
 /// doc
>struct Foo;

 // comment
 /// doc
>fn foo() {}
```
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants