You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
internal class Program
{
private static void Main(string[] args)
{
List Files = ["12"];
var i = Files.Count;
Console.WriteLine(i);
}
}
["DEBUG" - 10:34:18] Ensure there is a csharpier process for d:\TEST
["WARN" - 10:34:18] Received data on stderr from the running charpier process
"Error d:\TEST\Program.cs - Failed to compile so was not formatted.\r\n (6,30): error CS1525: 表达式项“[”无效\r\n"
["INFO" - 10:34:18] File is ignored by .csharpierignore or there was an error
The text was updated successfully, but these errors were encountered:
The above code was escaped incorrectly, the following is the correct code internal class Program { private static void Main(string[] args) { List<string> Files = ["12"]; var i = Files.Count; Console.WriteLine(i); } }
You are more than likely not on the latest csharpier. Collection expressions have been supported for a while now. 0.30.5 is the latest. You can test your code on playground.csharpier.com to see that it works.
The VSCode extension is the latest, but I don't know why it doesn't work. I searched for the answer to the previous question and deleted the C: \Users\xzf\AppData\Local\CSharpier folder. After reinstalling the extension, it worked fine
The VSCode extension is versioned separately. It works with any version of csharpier. Csharpier is a dotnet tool that can be installed globally or locally to a project. The extension will prompt you to install csharpier if it doesn't find the tool and installs the latest at that time.
When it appears in the code Unable to format
internal class Program
{
private static void Main(string[] args)
{
List Files = ["12"];
var i = Files.Count;
Console.WriteLine(i);
}
}
["DEBUG" - 10:34:18] Ensure there is a csharpier process for d:\TEST
["WARN" - 10:34:18] Received data on stderr from the running charpier process
"Error d:\TEST\Program.cs - Failed to compile so was not formatted.\r\n (6,30): error CS1525: 表达式项“[”无效\r\n"
["INFO" - 10:34:18] File is ignored by .csharpierignore or there was an error
The text was updated successfully, but these errors were encountered: