Skip to content

Commit

Permalink
Needed changes due to lack of support for strings over the wire. (#2150)
Browse files Browse the repository at this point in the history
* everything needed so far

* needed changes due to lack of support for strings over the wire
  • Loading branch information
TylerLeonhardt committed Oct 1, 2019
1 parent 1ece440 commit 3720570
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
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

0 comments on commit 3720570

Please sign in to comment.