bmalehorn / vscode-fish

Fish syntax highlighting and formatting
MIT License
62 stars 6 forks source link

Error reported for switch statements #2

Closed rgwood closed 4 years ago

rgwood commented 4 years ago

Using the switch example from the official Fish tutorial, vscode-fish reports an error on the very first line: "switch: Expected exactly one argument, got 0".

I'm using version 1.0.10 of the extension on macOS. Thanks for making the extension!

switch (uname)
case Linux
    echo Hi Tux!
case Darwin
    echo Hi Hexley!
case FreeBSD NetBSD DragonFly
    echo Hi Beastie!
case '*'
    echo Hi, stranger!
end
johnaoss commented 4 years ago

@rgwood Sadly this looks like its actually a bug in fish proper rather than the extension.

You get the same output if you put into a script, then execute it with the fish syntax checker by running:

fish -n script.fish

Although it looks like the issue was fixed in https://github.com/fish-shell/fish-shell/issues/5750, there hasn't been a stable release since. If you want, the beta release came out recently which you can try https://github.com/fish-shell/fish-shell/releases/tag/3.1b1

rgwood commented 4 years ago

Thank you for investigating this!