'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?



Solution 1:[1]

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"
    }
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gusjafo