Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When pasting json into a comment in C# code, an error is shown #39429

Closed
vsfeedback opened this issue Oct 21, 2019 · 3 comments · Fixed by #45891
Closed

When pasting json into a comment in C# code, an error is shown #39429

vsfeedback opened this issue Oct 21, 2019 · 3 comments · Fixed by #45891
Assignees
Labels
Area-IDE Bug Developer Community The issue was originally reported on https://developercommunity.visualstudio.com Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Milestone

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


This just happened to me, here is what I did:

1: Create a comment section in some C# code, using /* and */
2: Within the comment section, paste some json
3: Watch it show an yellow error bar at the top with the following exception:

StreamJsonRpc.RemoteMethodNotFoundException : Unable to find method 'SynchronizeTextAsync/3' on {no object} for the following reasons: An argument was not supplied for a required parameter.
at async StreamJsonRpc.JsonRpc.InvokeCoreAsync[TResult](<Unknown Parameters>)
at async Microsoft.VisualStudio.LanguageServices.Remote.JsonRpcEx.InvokeAsync(<Unknown Parameters>)
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)


Original Comments

Visual Studio Feedback System on 10/12/2019, 00:03 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.


Original Solutions

(no solutions)

@vatsalyaagrawal vatsalyaagrawal added Area-IDE Bug Developer Community The issue was originally reported on https://developercommunity.visualstudio.com labels Oct 21, 2019
@vatsalyaagrawal vatsalyaagrawal added this to the Backlog milestone Oct 21, 2019
@vatsalyaagrawal vatsalyaagrawal added the help wanted The issue is "up for grabs" - add a comment if you are interested in working on it label Oct 21, 2019
@vatsalyaagrawal vatsalyaagrawal modified the milestones: Backlog, 16.5 Oct 21, 2019
@jinujoseph jinujoseph modified the milestones: 16.5, Backlog Dec 13, 2019
@sharwell
Copy link
Member

@ValorMorgan
Copy link

ValorMorgan commented Jul 10, 2020

I was able to produce this error by modifying a verbatim string. I copied a line to the final line accidentally removing the ending " thus opening the string to the end of the file.

Bad code that produced the error:

// ... inside class inside method

  mTrace.Verbose(@"
Parsed filter:
---------------------------------------
Start Time: {0}
End Time: {1}
Incident Status: {2}
Notification Status: {3}
Launched from Alert Only: {4}
---------------------------------------
  result.StartTime,
  result.EndTime,
  result.IncidentStatus,
  result.NotificationStatus,
  result.LaunchedFromAlertOnly);

  return result;
}

private (DateTime? StartTime, DateTime? EndTime) GetStartEndTimes(
    BsonDocument filter) {

  // {
  //   "ProviderStartTime": { "$lte": ISODate("2020-02-01T00:00:00.000Z") },
  //   "ProviderEndTime": { "$gte": ISODate("2020-01-15T00:00:00.000Z") }
  // }
  // NOTE: We need the two fields flipped so "start" is earlier than "end"
  //		 This differs from other feeds where they keep the $gte / $lte to create a proper intersection

  var now = DateTime.UtcNow;

// rest of method and class

The error:

StreamJsonRpc.RemoteMethodNotFoundException : Unable to find method 'SynchronizeTextAsync/3' on {no object} for the following reasons: Deserializing JSON-RPC argument with name "textChanges" and position 2 to type "System.Collections.Generic.IEnumerable`1[Microsoft.CodeAnalysis.Text.TextChange]" failed: Unable to cast object of type 'System.DateTime' to type 'System.String'.
   at async StreamJsonRpc.JsonRpc.InvokeCoreAsync[TResult](<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.Remote.RemoteEndPoint.InvokeAsync(<Unknown Parameters>)
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)

IDE information:

Microsoft Visual Studio Professional 2019
Version 16.6.3
VisualStudio.16.Release/16.6.3+30225.117
Microsoft .NET Framework
Version 4.8.03752

Installed Version: Professional

ASP.NET and Web Tools 2019   16.6.954.58314
ASP.NET and Web Tools 2019

ASP.NET Core Razor Language Services   16.1.0.2020603+b3ac44798c16fff5b95dbcfe62dea84aa9a1bd72
Provides languages services for ASP.NET Core Razor.

ASP.NET Web Frameworks and Tools 2019   16.6.954.58314
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   16.6.954.58314
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools   16.6.954.58314
Azure Functions and Web Jobs Tools

C# Tools   3.6.0-4.20251.5+910223b64f108fcf039012e0849befb46ace6e66
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GitHub.VisualStudio   2.11.104.25275
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

IndentRainbowPackage Extension   1.0
IndentRainbowPackage Visual Studio Extension Detailed Info

IntelliCode Extension   1.0
IntelliCode Visual Studio Extension Detailed Info

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.30212.1

Microsoft Continuous Delivery Tools for Visual Studio   0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager   2.1.50+g25aae5a24a.R
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio Tools for Containers   1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

NuGet Package Manager   5.6.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

SQL Server Data Tools   16.0.62006.03190
Microsoft SQL Server Data Tools

TypeScript Tools   16.0.20417.2002
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   3.6.0-4.20251.5+910223b64f108fcf039012e0849befb46ace6e66
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.9.1.0 for F# 4.7   16.6.0-beta.20217.4+1c969cac25e2d38d71872efe6c8226029e42bb59
Microsoft Visual F# Tools 10.9.1.0 for F# 4.7

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions (Preview)   1.0
View, manage, and diagnose containers within Visual Studio.

Visual Studio Spell Check Everywhere   VSSpellCheckEverywhere
An extension that enables spell checking within any Visual Studio file editor or tool window that uses WPF text boxes.
https://GitHub.com/EWSoftware/VSSpellChecker

Visual Studio Spell Checker   VSSpellChecker
An editor extension that checks the spelling of comments, strings, and plain text as you type or interactively with tool windows.
https://GitHub.com/EWSoftware/VSSpellChecker

Visual Studio Tools for Containers   1.0
Visual Studio Tools for Containers

Traced from here to this GitHub issue.

@CyrusNajmabadi
Copy link
Member

@tmat more OOP sync issues :(

@tmat tmat modified the milestones: Backlog, 16.7 Jul 10, 2020
@tmat tmat removed the help wanted The issue is "up for grabs" - add a comment if you are interested in working on it label Jul 10, 2020
@tmat tmat self-assigned this Jul 10, 2020
@sharwell sharwell added the Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented label Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug Developer Community The issue was originally reported on https://developercommunity.visualstudio.com Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants