diff --git a/src/features/ExtensionCommands.ts b/src/features/ExtensionCommands.ts index 23c3159b68..82b58cb60b 100644 --- a/src/features/ExtensionCommands.ts +++ b/src/features/ExtensionCommands.ts @@ -6,9 +6,11 @@ import * as fs from "fs"; import * as os from "os"; import * as path from "path"; import * as vscode from "vscode"; -import { LanguageClient, NotificationType, Position, Range, RequestType } from "vscode-languageclient"; +import { LanguageClient, NotificationType, NotificationType0, + Position, Range, RequestType } from "vscode-languageclient"; import { IFeature } from "../feature"; import { Logger } from "../logging"; +import Settings = require("../settings"); export interface IExtensionCommand { name: string; @@ -155,6 +157,9 @@ export const SetStatusBarMessageRequestType = new RequestType( "editor/setStatusBarMessage"); +export const ClearTerminalNotificationType = + new NotificationType0("editor/clearTerminal"); + export interface ISaveFileDetails { filePath: string; newPath?: string; @@ -265,6 +270,10 @@ export class ExtensionCommandsFeature implements IFeature { this.languageClient.onRequest( SetStatusBarMessageRequestType, (messageDetails) => this.setStatusBarMessage(messageDetails)); + + this.languageClient.onNotification( + ClearTerminalNotificationType, + () => vscode.commands.executeCommand("workbench.action.terminal.clear")); } }