Skip to content

Commit 534bdf2

Browse files
Needed changes due to lack of support for strings over the wire. (#2150)
* everything needed so far * needed changes due to lack of support for strings over the wire
1 parent b2bb5e9 commit 534bdf2

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/features/ExpandAlias.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { LanguageClient, NotificationType, RequestType } from "vscode-languagecl
88
import { IFeature } from "../feature";
99
import { Logger } from "../logging";
1010

11-
export const ExpandAliasRequestType = new RequestType<string, any, void, void>("powerShell/expandAlias");
11+
export const ExpandAliasRequestType = new RequestType<any, any, void, void>("powerShell/expandAlias");
1212

1313
export class ExpandAliasFeature implements IFeature {
1414
private command: vscode.Disposable;
@@ -39,9 +39,9 @@ export class ExpandAliasFeature implements IFeature {
3939
range = new vscode.Range(sls.line, sls.character, sle.line, sle.character);
4040
}
4141

42-
this.languageClient.sendRequest(ExpandAliasRequestType, text).then((result) => {
42+
this.languageClient.sendRequest(ExpandAliasRequestType, { text }).then((result) => {
4343
editor.edit((editBuilder) => {
44-
editBuilder.replace(range, result);
44+
editBuilder.replace(range, result.text);
4545
});
4646
});
4747
});

src/features/GetCommands.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (C) Microsoft Corporation. All rights reserved.
33
*--------------------------------------------------------*/
44
import * as vscode from "vscode";
5-
import { LanguageClient, RequestType } from "vscode-languageclient";
5+
import { LanguageClient, RequestType0 } from "vscode-languageclient";
66
import { IFeature } from "../feature";
77
import { Logger } from "../logging";
88

@@ -18,7 +18,7 @@ interface ICommand {
1818
* RequestType sent over to PSES.
1919
* Expects: ICommand to be returned
2020
*/
21-
export const GetCommandRequestType = new RequestType<string, ICommand[], void, void>("powerShell/getCommand");
21+
export const GetCommandRequestType = new RequestType0<ICommand[], void, void>("powerShell/getCommand");
2222

2323
/**
2424
* A PowerShell Command listing feature. Implements a treeview control.
@@ -63,7 +63,7 @@ export class GetCommandsFeature implements IFeature {
6363
this.log.writeVerbose(`<${GetCommandsFeature.name}>: Unable to send getCommand request`);
6464
return;
6565
}
66-
this.languageClient.sendRequest(GetCommandRequestType, "").then((result) => {
66+
this.languageClient.sendRequest(GetCommandRequestType).then((result) => {
6767
const SidebarConfig = vscode.workspace.getConfiguration("powershell.sideBar");
6868
const excludeFilter = (SidebarConfig.CommandExplorerExcludeFilter).map((filter) => filter.toLowerCase());
6969
result = result.filter((command) => (excludeFilter.indexOf(command.moduleName.toLowerCase()) === -1));

src/features/ShowHelp.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
*--------------------------------------------------------*/
44

55
import vscode = require("vscode");
6-
import { LanguageClient, NotificationType, RequestType } from "vscode-languageclient";
6+
import { LanguageClient, NotificationType } from "vscode-languageclient";
77
import { IFeature } from "../feature";
88
import { Logger } from "../logging";
99

10-
export const ShowHelpRequestType =
11-
new RequestType<string, void, void, void>("powerShell/showHelp");
10+
export const ShowHelpNotificationType =
11+
new NotificationType<any, void>("powerShell/showHelp");
1212

1313
export class ShowHelpFeature implements IFeature {
1414
private command: vscode.Disposable;
@@ -31,9 +31,9 @@ export class ShowHelpFeature implements IFeature {
3131
const cwr = doc.getWordRangeAtPosition(selection.active);
3232
const text = doc.getText(cwr);
3333

34-
this.languageClient.sendRequest(ShowHelpRequestType, text);
34+
this.languageClient.sendNotification(ShowHelpNotificationType, { text });
3535
} else {
36-
this.languageClient.sendRequest(ShowHelpRequestType, item.Name);
36+
this.languageClient.sendNotification(ShowHelpNotificationType, { text: item.Name } );
3737
}
3838
});
3939
}

0 commit comments

Comments
 (0)