This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Make sure tuple protocol name does not ignore unknown parameter types#206
Merged
MikhailArkhipov merged 5 commits intomicrosoft:masterfrom Oct 5, 2018
MikhailArkhipov:master
Merged
Make sure tuple protocol name does not ignore unknown parameter types#206MikhailArkhipov merged 5 commits intomicrosoft:masterfrom MikhailArkhipov:master
MikhailArkhipov merged 5 commits intomicrosoft:masterfrom
MikhailArkhipov:master
Conversation
| return sb.ToString(); | ||
| } | ||
|
|
||
| private string GetParameterString(AnalysisValue[] sets) { |
Contributor
There was a problem hiding this comment.
you can reuse the same StringBuilder here.
| return "?"; | ||
| } | ||
| var sb = new StringBuilder(); | ||
| if (sets.Length > 1) { |
Contributor
There was a problem hiding this comment.
This can be simplified:
If (sets.Length == 1) {
sb.Append(sets[0] is IHasQualifiedName qn ? qn.FullyQualifiedName : sets[0].ShortDescription)
} else {
// remaining code
}| } | ||
| for (var i = 0; i < sets.Length; i++) { | ||
| if (i > 0) { | ||
| sb.Append(", "); |
| // Enumerate manually since SelectMany drops empty/unknown values | ||
| var sb = new StringBuilder("tuple["); | ||
| for (var i = 0; i < _values.Length; i++) { | ||
| if (i > 0) { |
Contributor
There was a problem hiding this comment.
We can have an extension method for this:
https://github.com/Microsoft/RTVS/blob/master/src/Common/Core/Impl/Extensions/StringBuilderExtensions.cs
AlexanderSher
approved these changes
Oct 5, 2018
jakebailey
pushed a commit
to jakebailey/python-language-server
that referenced
this pull request
Nov 1, 2019
Make sure tuple protocol name does not ignore unknown parameter types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Additional fix for #173 since 'SelectMany' drops empty sequences and tuples lose arguments of unknown type making them look like they have fewer arguments.