Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/Analysis/Engine/Test/LanguageServerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,16 @@ public async Task CompletionForOverride() {
await AssertCompletion(s, u, new[] { "__init__" }, new[] { "def" }, new SourceLocation(3, 9), cmpKey: ci => ci.label);
}

[TestMethod, Priority(0)]
public async Task CompletionForOverrideArgs() {
using (var s = await CreateServer()) {
var u = await AddModule(s, "class A:\n def bar(arg=None): pass\n\nclass B(A):\n def b");

await AssertNoCompletion(s, u, new SourceLocation(2, 9));
await AssertCompletion(s, u, new[] { "bar(arg=None):\r\n return super().bar()" }, new[] { "bar(arg = None):\r\n return super().bar()" }, new SourceLocation(5, 10));
}
}

[TestMethod, Priority(0)]
public async Task CompletionInDecorator() {
var s = await CreateServer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ private static CompletionItemKind ToCompletionItemKind(PythonMemberType memberTy

private static string GetSafeParameterName(ParameterResult result, int index) {
if (!string.IsNullOrEmpty(result.DefaultValue)) {
return GetSafeArgumentName(result, index) + " = " + result.DefaultValue;
return GetSafeArgumentName(result, index) + "=" + result.DefaultValue;
}
return GetSafeArgumentName(result, index);
}
Expand Down