Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagnostics including : in message are not parsed correctly #1312

Closed
adam-fowler opened this issue Jan 14, 2025 · 2 comments
Closed

Diagnostics including : in message are not parsed correctly #1312

adam-fowler opened this issue Jan 14, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@adam-fowler
Copy link
Contributor

Describe the bug
Diagnostics including : in message are not parsed correctly. They assume the : indicate the end of the message

To Reproduce
Steps to reproduce the behavior:

  1. Add the line let dictionary: [String: String] = [] to a swift project
  2. Compile
  3. The error message in the problems view is just "Use"

Expected behavior
Should see error "use [:] to get an empty dictionary literal"

@adam-fowler adam-fowler added the bug Something isn't working label Jan 14, 2025
@award999 award999 self-assigned this Jan 16, 2025
@award999 award999 moved this from Unscreened to Todo in Swift Extension for Visual Studio Code Jan 16, 2025
@award999 award999 moved this from Todo to In Progress in Swift Extension for Visual Studio Code Jan 16, 2025
@award999 award999 removed their assignment Jan 22, 2025
@rbenegal
Copy link
Contributor

Thanks for reporting this! It seems like the diagnostics that we get from swiftc are not parsed correctly, which I can try to fix.

On Windows it seems like this issue is especially noticeable since the diagnostics from SourceKit-LSP are currently broken for 6.0.3 (this has been fixed, but a new version of the toolchain will be required, as mentioned in #1226). The diagnostics from SourceKit-LSP seem to be showing up correctly on Mac and Linux but looks like the incomplete diagnostics from swiftc are also shown at the same time if someone tries to compile.

rbenegal added a commit to rbenegal/vscode-swift that referenced this issue Jan 23, 2025
Display the full diagnostic message instead of stopping at backslashes
or square brackets and update the diagnostics test case to check for
this.

Issue: swiftlang#1312
award999 pushed a commit that referenced this issue Jan 29, 2025
* Show swiftc diagnostics with square brackets

Display the full diagnostic message instead of stopping at backslashes
or square brackets and update the diagnostics test case to check for
this.

Issue: #1312

* Remove [-Wcode] warnings from swiftc diagnostics

Remove any additional [-Wcode] warnings that swiftc adds to messages
to allow for merging diagnostics with SourceKit.
@award999 award999 moved this from In Progress to Needs Verification in Swift Extension for Visual Studio Code Jan 29, 2025
@award999 award999 added needs verification Issue has been fixed, but requires verification before closing and removed needs verification Issue has been fixed, but requires verification before closing labels Jan 29, 2025
@award999
Copy link
Contributor

Verified 109919e

@award999 award999 moved this from Needs Verification to Done in Swift Extension for Visual Studio Code Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants