Skip to content

Commit d5a8c26

Browse files
Kapil Borledaviwil
authored andcommitted
Add registration options for didOpen notification
1 parent 79f6520 commit d5a8c26

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

src/PowerShellEditorServices.Protocol/LanguageServer/TextDocument.cs

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ public class TextDocumentPositionParams
9898
public class DidOpenTextDocumentNotification
9999
{
100100
public static readonly
101-
NotificationType<DidOpenTextDocumentParams, object> Type =
102-
NotificationType<DidOpenTextDocumentParams, object>.Create("textDocument/didOpen");
101+
NotificationType<DidOpenTextDocumentParams, TextDocumentRegistrationOptions> Type =
102+
NotificationType<DidOpenTextDocumentParams, TextDocumentRegistrationOptions>.Create("textDocument/didOpen");
103103
}
104104

105105
/// <summary>
@@ -113,6 +113,39 @@ public class DidOpenTextDocumentParams
113113
public TextDocumentItem TextDocument { get; set; }
114114
}
115115

116+
/// <summary>
117+
/// General text document registration options.
118+
/// </summary>
119+
public class TextDocumentRegistrationOptions {
120+
/// <summary>
121+
/// A document selector to identify the scope of the registration. If set to null the document
122+
/// selector provided on the client side will be used.
123+
/// </summary>
124+
public DocumentFilter[] DocumentSelector { get; set; }
125+
}
126+
127+
/// <summary>
128+
/// A document filter denotes a document by different properties like the language, the scheme
129+
/// of its resource, or a glob-pattern that is applied to the path.
130+
/// </summary>
131+
public class DocumentFilter
132+
{
133+
/// <summary>
134+
/// A language id, like `powershell`
135+
/// </summary>
136+
public string Language { get; set; }
137+
138+
/// <summary>
139+
/// A Uri, like `file` or `untitled`
140+
/// </summary>
141+
public string Scheme { get; set; }
142+
143+
/// <summary>
144+
/// A glob pattern, like `*.{ps1,psd1}`
145+
/// </summary>
146+
public string Pattern { get; set; }
147+
}
148+
116149
public class DidCloseTextDocumentNotification
117150
{
118151
public static readonly

0 commit comments

Comments
 (0)