Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Commit e043b13

Browse files
author
MikhailArkhipov
committed
Add Uri to the extension call
1 parent 5dfb67d commit e043b13

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/Analysis/Engine/Test/LanguageServerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ public Task<IReadOnlyDictionary<string, object>> ExecuteCommand(string command,
644644
#endregion
645645

646646
#region ICompletionExtension
647-
public Task HandleCompletionAsync(IModuleAnalysis analysis, PythonAst tree, SourceLocation location, CompletionList completions, CancellationToken token) {
647+
public Task HandleCompletionAsync(Uri documentUri, IModuleAnalysis analysis, PythonAst tree, SourceLocation location, CompletionList completions, CancellationToken token) {
648648
Assert.IsNotNull(tree);
649649
Assert.IsNotNull(analysis);
650650
for (int i = 0; i < completions.items.Length; ++i) {

src/LanguageServer/Impl/Extensions/ICompletionExtension.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
// See the Apache Version 2.0 License for specific language governing
1515
// permissions and limitations under the License.
1616

17+
using System;
1718
using System.Threading;
1819
using System.Threading.Tasks;
1920
using Microsoft.PythonTools;
@@ -22,6 +23,6 @@
2223

2324
namespace Microsoft.Python.LanguageServer.Extensions {
2425
public interface ICompletionExtension {
25-
Task HandleCompletionAsync(IModuleAnalysis analysis, PythonAst tree, SourceLocation location, CompletionList completions, CancellationToken token);
26+
Task HandleCompletionAsync(Uri documentUri, IModuleAnalysis analysis, PythonAst tree, SourceLocation location, CompletionList completions, CancellationToken token);
2627
}
2728
}

src/LanguageServer/Impl/Implementation/Server.Completion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public override async Task<CompletionList> Completion(CompletionParams @params,
9898
}
9999

100100
await InvokeExtensionsAsync((ext, token)
101-
=> (ext as ICompletionExtension)?.HandleCompletionAsync(analysis, tree, @params.position, res, cancellationToken), cancellationToken);
101+
=> (ext as ICompletionExtension)?.HandleCompletionAsync(uri, analysis, tree, @params.position, res, cancellationToken), cancellationToken);
102102

103103
return res;
104104
}

0 commit comments

Comments
 (0)