jansorg / swift-plugin

Space of the Swift language support plugin for JetBrains IDEs
41 stars 0 forks source link

String interpolation syntax for Text SwiftUI widget throws an error #26

Closed kvenn closed 5 months ago

kvenn commented 11 months ago

The following code shows an error

        Text("Updated \(startDate, style: .relative) ago")
            .font(.system(size: 10))
            .foregroundColor(Color.white.opacity(0.5))

Error:

'!', '#', '#if', '#keypath', '&', '(', '.', ':', ';', <, , , , , , , , , , , , , '?', Any, Self, '\', _, await, defer, do, self, super, try, '{' or '}' expected, got '('

image

This error causes the rest of the file to not work too great.

jansorg commented 5 months ago

Thanks! I've fixed this for the next update. The official grammar seems to be lacking a few enhancements, reported at https://github.com/apple/swift-book/issues/295

kvenn commented 4 months ago

Great! Looking forward to it 🥳

jansorg commented 4 months ago

The latest version should have the fix already. Or doesn't it work for you?

kvenn commented 4 months ago

I think I'm on the latest and I'm still seeing it.

image image
jansorg commented 4 months ago

@kvenn That's weird, the latest version is 1.0.0, https://plugins.jetbrains.com/plugin/22150-swift-support/edit/versions/stable/527403 Try Help > Check for updates or verify the update at Settings > Plugins. Please let me know if it's still not working for you.

kvenn commented 4 months ago

Very weird! I'm fully unable to update to that version. I've restarted the IDE, uninstalled and reinstalled the plugin, and tried downloading from web but it just deeplinks to 0.21.*.

jansorg commented 4 months ago

Are you saying that 0.21.* is installed when you download 1.0 at https://plugins.jetbrains.com/plugin/22150-swift-support/versions/stable/527403 and install manually via Settings > Plugins > (Gear wheel) > Install from disk?

kvenn commented 4 months ago

Thanks for trying to help me through this lol. No idea why I'm struggling so hard.

image

Plugin 'Swift Support' (version '1.0.0.345-241') is not compatible with the current version of the IDE, because it requires build 241.15989.0 or newer but the current build is IU-241.14494.240

So I guess IntelliJ ultimate is lagging behind Intellij? And that's why the latest plugin isn't available to me.

jansorg commented 4 months ago

241.15989.0 is 2024.1.1, https://www.jetbrains.com/idea/download/other.html IntelliJ Ultimate and Community have the same build number, 2024.1.1 should be available to you.

kvenn commented 4 months ago

As we all had feared, it was indeed user error.

I had to use the JetBrains Toolbox App to update IntelliJ.

The bug is fixed and I see you've been hard at work making this plugin awesome! Just did the yearly subscription.