Skip to content

Needed changes due to lack of support for strings over the wire. #2150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 27, 2019
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
6 changes: 3 additions & 3 deletions src/features/ExpandAlias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { LanguageClient, NotificationType, RequestType } from "vscode-languagecl
import { IFeature } from "../feature";
import { Logger } from "../logging";

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

export class ExpandAliasFeature implements IFeature {
private command: vscode.Disposable;
Expand Down Expand Up @@ -39,9 +39,9 @@ export class ExpandAliasFeature implements IFeature {
range = new vscode.Range(sls.line, sls.character, sle.line, sle.character);
}

this.languageClient.sendRequest(ExpandAliasRequestType, text).then((result) => {
this.languageClient.sendRequest(ExpandAliasRequestType, { text }).then((result) => {
editor.edit((editBuilder) => {
editBuilder.replace(range, result);
editBuilder.replace(range, result.text);
});
});
});
Expand Down
6 changes: 3 additions & 3 deletions src/features/GetCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
import * as vscode from "vscode";
import { LanguageClient, RequestType } from "vscode-languageclient";
import { LanguageClient, RequestType0 } from "vscode-languageclient";
import { IFeature } from "../feature";
import { Logger } from "../logging";

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

/**
* A PowerShell Command listing feature. Implements a treeview control.
Expand Down Expand Up @@ -63,7 +63,7 @@ export class GetCommandsFeature implements IFeature {
this.log.writeVerbose(`<${GetCommandsFeature.name}>: Unable to send getCommand request`);
return;
}
this.languageClient.sendRequest(GetCommandRequestType, "").then((result) => {
this.languageClient.sendRequest(GetCommandRequestType).then((result) => {
const SidebarConfig = vscode.workspace.getConfiguration("powershell.sideBar");
const excludeFilter = (SidebarConfig.CommandExplorerExcludeFilter).map((filter) => filter.toLowerCase());
result = result.filter((command) => (excludeFilter.indexOf(command.moduleName.toLowerCase()) === -1));
Expand Down
10 changes: 5 additions & 5 deletions src/features/ShowHelp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
*--------------------------------------------------------*/

import vscode = require("vscode");
import { LanguageClient, NotificationType, RequestType } from "vscode-languageclient";
import { LanguageClient, NotificationType } from "vscode-languageclient";
import { IFeature } from "../feature";
import { Logger } from "../logging";

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

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

this.languageClient.sendRequest(ShowHelpRequestType, text);
this.languageClient.sendNotification(ShowHelpNotificationType, { text });
} else {
this.languageClient.sendRequest(ShowHelpRequestType, item.Name);
this.languageClient.sendNotification(ShowHelpNotificationType, { text: item.Name } );
}
});
}
Expand Down