dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.85k stars 670 forks source link

C# Hover Method with // (slash-slash) in constant shows incorrect IntelliSense / Help #6654

Open dibarbet opened 11 months ago

dibarbet commented 11 months ago

Copied from https://github.com/microsoft/vscode-dotnettools/issues/668#, filed by @iJungleboy

Describe the Issue

When code has // characters in the help text then IntelliSense looks broken.

image

Steps To Reproduce

Create a .cs file like this:

public class VsCodeBug
{
  public void Test(string before, string problem = "see https://xyz.com", string after = null)
  {
    Test("before");
  }
}

Then over the call on Test("before") and you'll see the what's in the screenshot.

Expected Behavior

string literals should be self-closing and not bleed out into anything else.

Environment Information

VS Code 1.83.1

dibarbet commented 11 months ago

The raw json is

"value": "```csharp\r\nvoid C.D([string t = \"see https://hello\"], [string after = null])\r\n```\r\n  \r\n"

Guessing it might be the quote escapes that are interfering with the textmate classification that vscode does.

dibarbet commented 10 months ago

Related to https://github.com/dotnet/vscode-csharp/issues/6678