简体   繁体   中英

Visual Studio Code - Code Snippet cw Unexpected Behavior

When using code snippets in Visual Studio Code, the behavior of cw which turns into Console.WriteLine() always includes the fully qualified name when it is auto completed, as follows.

System.Console.WriteLine()

However, I already have using System; declared at the top of my file. Why does VSCODE insist on including the namespace in the code snippet? I am expecting it to auto complete into this,

Console.WriteLine()

Is this normal behavior to be expected from VSCODE ?

maybe you can create a snippet in VSC :

  1. ctrl+shift+p
  2. Configure user snippets
  3. Csharp
{   "Print ConsoleWriteLine()": {
        "prefix": "cw",
        "body": [
            "Console.WriteLine($0);"
        ],
        "description": "Print line of code"
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM