-
Notifications
You must be signed in to change notification settings - Fork 234
/
Copy pathOpenFileRequest.cs
33 lines (30 loc) · 1006 Bytes
/
OpenFileRequest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Session;
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
namespace Microsoft.PowerShell.EditorServices.Transport.Stdio.Request
{
[MessageTypeName("open")]
public class OpenFileRequest : RequestBase<FileRequestArguments>
{
public static OpenFileRequest Create(string filePath)
{
return new OpenFileRequest
{
Arguments = new FileRequestArguments
{
File = filePath
}
};
}
public override void ProcessMessage(
EditorSession editorSession,
MessageWriter messageWriter)
{
// Open the file in the current session
editorSession.Workspace.GetFile(this.Arguments.File);
}
}
}