diff --git a/src/features/ExpandAlias.ts b/src/features/ExpandAlias.ts index dd1872ff90..ec1568e098 100644 --- a/src/features/ExpandAlias.ts +++ b/src/features/ExpandAlias.ts @@ -8,7 +8,7 @@ import { LanguageClient, NotificationType, RequestType } from "vscode-languagecl import { IFeature } from "../feature"; import { Logger } from "../logging"; -export const ExpandAliasRequestType = new RequestType("powerShell/expandAlias"); +export const ExpandAliasRequestType = new RequestType("powerShell/expandAlias"); export class ExpandAliasFeature implements IFeature { private command: vscode.Disposable; @@ -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); }); }); }); diff --git a/src/features/GetCommands.ts b/src/features/GetCommands.ts index b109c74e73..12fff1d453 100644 --- a/src/features/GetCommands.ts +++ b/src/features/GetCommands.ts @@ -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"; @@ -18,7 +18,7 @@ interface ICommand { * RequestType sent over to PSES. * Expects: ICommand to be returned */ -export const GetCommandRequestType = new RequestType("powerShell/getCommand"); +export const GetCommandRequestType = new RequestType0("powerShell/getCommand"); /** * A PowerShell Command listing feature. Implements a treeview control. @@ -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)); diff --git a/src/features/ShowHelp.ts b/src/features/ShowHelp.ts index 3322a43f66..fd185eb05a 100644 --- a/src/features/ShowHelp.ts +++ b/src/features/ShowHelp.ts @@ -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("powerShell/showHelp"); +export const ShowHelpNotificationType = + new NotificationType("powerShell/showHelp"); export class ShowHelpFeature implements IFeature { private command: vscode.Disposable; @@ -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 } ); } }); }