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

VS Code Issue 1057 - Problem with Newlines in displaying XML Documentation #1019

Closed
wants to merge 3 commits into from

Conversation

akshita31
Copy link
Contributor

Issue : dotnet/vscode-csharp#1057

The issue was of absence of New Lines in Parsed XML Documentation. The problem was that VS Code is displaying a newline character( like "\n" or "\r\n" ) as a space and not a newline. It is rather accepting two newline characters as a newline ("\n\n" or "\r\n\r\n" ). So the TypeLookUp handler has been modified to pass the appropriate lineEnding parameter. Accordingly a test has also been added.

@@ -45,7 +46,9 @@ public TypeLookupService(OmniSharpWorkspace workspace, FormattingOptions formatt

if (request.IncludeDocumentation)
{
response.Documentation = DocumentationConverter.ConvertDocumentation(symbol.GetDocumentationCommentXml(), _formattingOptions.NewLine);
string newLine = Environment.NewLine + Environment.NewLine;
//VS Code renders a single new line for two newline sequences in the response, hence two new lines are passed in the lineEnding parameter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a VS Code-specific tweak, why does it belong in omnisharp-roslyn? Shouldn't the fix be in omnisharp-vscode? After all, other editors use omnisharp-roslyn (e.g. Emacs, Vim, Atom, Sublime, etc.). Wouldn't this be a breaking change for them?

response.Documentation = DocumentationConverter.ConvertDocumentation(symbol.GetDocumentationCommentXml(), _formattingOptions.NewLine);
string newLine = Environment.NewLine + Environment.NewLine;
//VS Code renders a single new line for two newline sequences in the response, hence two new lines are passed in the lineEnding parameter
response.Documentation = DocumentationConverter.ConvertDocumentation(symbol.GetDocumentationCommentXml(),newLine);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add space before 'newLine'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, if this is a VS Code-specific bug then we should move the fix to omnisharp-vscode. We can capture the output coming from O# and map it to what VS Code expects.

@DustinCampbell
Copy link
Contributor

Also, please squash unnecessary commits like these:

  • VS Code Iss 1057 fix
  • VS Code Issue 1057 fix
  • Issue 1057 fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants