-
Notifications
You must be signed in to change notification settings - Fork 419
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
Conversation
@@ -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 |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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'
There was a problem hiding this comment.
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.
Also, please squash unnecessary commits like these:
|
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.