FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Make sure tuple protocol name does not ignore unknown parameter types by MikhailArkhipov · Pull Request #206 · microsoft/python-language-server · GitHub

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
Mikhail Arkhipov (MikhailArkhipov) merged 5 commits into
microsoft:masterfrom
MikhailArkhipov:master
Oct 5, 2018
Merged

Make sure tuple protocol name does not ignore unknown parameter types#206
Mikhail Arkhipov (MikhailArkhipov) merged 5 commits into
microsoft:masterfrom
MikhailArkhipov:master

Conversation

Copy link
Copy Markdown

Additional fix for #173 since 'SelectMany' drops empty sequences and tuples lose arguments of unknown type making them look like they have fewer arguments.

return sb.ToString();
}

private string GetParameterString(AnalysisValue[] sets) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

you can reuse the same StringBuilder here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Good point

return "?";
}
var sb = new StringBuilder();
if (sets.Length > 1) {

Alexander Sher (AlexanderSher) Oct 5, 2018
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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(", ");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

", " or ","?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

", " more readable

// Enumerate manually since SelectMany drops empty/unknown values
var sb = new StringBuilder("tuple[");
for (var i = 0; i < _values.Length; i++) {
if (i > 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Mikhail Arkhipov (MikhailArkhipov) merged commit 306f568 into microsoft:master Oct 5, 2018
Jake Bailey (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.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL