Skip to content

Conversation

@hamishknight
Copy link
Contributor

@hamishknight hamishknight commented Nov 23, 2025

Avoid matching expected completions for underscored attributes and skip matching file and line as argument labels since we skip #file and #line default args for completion. This is necessary to fix the stress tester for the recently updated revision of swift-power-assert.

@hamishknight hamishknight marked this pull request as ready for review November 24, 2025 12:10
@hamishknight
Copy link
Contributor Author

Stress tester ran on swiftlang/swift#58827

Comment on lines +729 to +731
// FIXME: We ought to have this be configurable and enable it for the stress
// tester.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you remember how the compiler skips these. IIRC it’s looking for #file or #line default argument values. Which unfortunately we can’t do here, so maybe this is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's done here, IMO it would be nice to have a mode where it still includes them just for the stress tester since we otherwise can't handle them properly in the general case. #file and #line were the only ones that the new revision of swift-power-assert ran into though

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add a sourcekitd option for it, I wouldn’t have any objections to it.

We don't provide default argument completions for `#file` and `#line`,
for now let's skip matching `file` and `line` as argument labels.
Don't check completions for e.g `@_spi` or its arguments.
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@shahmishal shahmishal merged commit 312b6d1 into swiftlang:main Nov 25, 2025
1 check passed
@hamishknight hamishknight deleted the exclude-completions branch November 25, 2025 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants