Skip to content

Commit 66f14f3

Browse files
author
Kapil Borle
committed
Add a request type for formatting region request
1 parent 6f3fedd commit 66f14f3

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
//
5+
6+
using System.Collections;
7+
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
8+
using System.Collections.Generic;
9+
10+
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
11+
{
12+
/// <summary>
13+
/// Class to encapsulate the request type.
14+
/// </summary>
15+
class FormattingScriptRegionRequest
16+
{
17+
public static readonly
18+
RequestType<FormattingScriptRegionRequestParams, FormattingScriptRegionRequestResult> Type =
19+
RequestType<FormattingScriptRegionRequestParams, FormattingScriptRegionRequestResult>.Create("powerShell/getFormattingScriptRegion");
20+
}
21+
22+
/// <summary>
23+
/// Class to encapsulate the request parameters.
24+
/// </summary>
25+
class FormattingScriptRegionRequestParams
26+
{
27+
/// <summary>
28+
/// Path of the file for which the markers are requested.
29+
/// </summary>
30+
public string fileUri;
31+
32+
/// <summary>
33+
/// Hint character
34+
/// </summary>
35+
public string character;
36+
37+
/// <summary>
38+
/// Character position
39+
/// </summary>
40+
public FilePosition filePosition;
41+
}
42+
43+
/// <summary>
44+
/// Class to encapsulate the result of marker request.
45+
/// </summary>
46+
class FormattingScriptRegionRequestResult
47+
{
48+
/// <summary>
49+
/// A region in the script that encapsulates the given character/position which is suitable for
50+
/// for formatting
51+
/// </summary>
52+
public ScriptRegion scriptRegion;
53+
}
54+
}

0 commit comments

Comments
 (0)