|
2 | 2 | // Licensed under the MIT License.
|
3 | 3 |
|
4 | 4 | using Microsoft.PowerShell.EditorServices.Services.TextDocument;
|
| 5 | +using OmniSharp.Extensions.LanguageServer.Protocol.Models; |
5 | 6 |
|
6 | 7 | namespace Microsoft.PowerShell.EditorServices.Test.Shared.Completion
|
7 | 8 | {
|
8 |
| - internal class CompleteAttributeValue |
| 9 | + internal static class CompleteAttributeValue |
9 | 10 | {
|
10 |
| - public static readonly ScriptRegion SourceDetails = |
11 |
| - new ScriptRegion( |
12 |
| - file: TestUtilities.NormalizePath("Completion/CompletionExamples.psm1"), |
13 |
| - text: string.Empty, |
14 |
| - startLineNumber: 16, |
15 |
| - startColumnNumber: 38, |
16 |
| - startOffset: 0, |
17 |
| - endLineNumber: 0, |
18 |
| - endColumnNumber: 0, |
19 |
| - endOffset: 0); |
| 11 | + public static readonly ScriptRegion SourceDetails = new( |
| 12 | + file: TestUtilities.NormalizePath("Completion/CompletionExamples.psm1"), |
| 13 | + text: string.Empty, |
| 14 | + startLineNumber: 16, |
| 15 | + startColumnNumber: 38, |
| 16 | + startOffset: 0, |
| 17 | + endLineNumber: 0, |
| 18 | + endColumnNumber: 0, |
| 19 | + endOffset: 0); |
20 | 20 |
|
21 |
| - public static readonly BufferRange ExpectedRange = |
22 |
| - new BufferRange( |
23 |
| - new BufferPosition(16, 33), |
24 |
| - new BufferPosition(16, 38)); |
| 21 | + public static readonly CompletionItem ExpectedCompletion1 = new() |
| 22 | + { |
| 23 | + Kind = CompletionItemKind.Property, |
| 24 | + Detail = "System.Boolean ValueFromPipeline", |
| 25 | + InsertTextFormat = InsertTextFormat.PlainText, |
| 26 | + InsertText = "ValueFromPipeline", |
| 27 | + FilterText = "ValueFromPipeline", |
| 28 | + Label = "ValueFromPipeline", |
| 29 | + SortText = "0001ValueFromPipeline", |
| 30 | + TextEdit = new TextEdit |
| 31 | + { |
| 32 | + NewText = "ValueFromPipeline", |
| 33 | + Range = new Range |
| 34 | + { |
| 35 | + Start = new Position { Line = 15, Character = 32 }, |
| 36 | + End = new Position { Line = 15, Character = 37 } |
| 37 | + } |
| 38 | + } |
| 39 | + }; |
| 40 | + |
| 41 | + public static readonly CompletionItem ExpectedCompletion2 = new() |
| 42 | + { |
| 43 | + Kind = CompletionItemKind.Property, |
| 44 | + Detail = "System.Boolean ValueFromPipelineByPropertyName", |
| 45 | + InsertTextFormat = InsertTextFormat.PlainText, |
| 46 | + InsertText = "ValueFromPipelineByPropertyName", |
| 47 | + FilterText = "ValueFromPipelineByPropertyName", |
| 48 | + Label = "ValueFromPipelineByPropertyName", |
| 49 | + SortText = "0002ValueFromPipelineByPropertyName", |
| 50 | + TextEdit = new TextEdit |
| 51 | + { |
| 52 | + NewText = "ValueFromPipelineByPropertyName", |
| 53 | + Range = new Range |
| 54 | + { |
| 55 | + Start = new Position { Line = 15, Character = 32 }, |
| 56 | + End = new Position { Line = 15, Character = 37 } |
| 57 | + } |
| 58 | + } |
| 59 | + }; |
| 60 | + |
| 61 | + public static readonly CompletionItem ExpectedCompletion3 = new() |
| 62 | + { |
| 63 | + Kind = CompletionItemKind.Property, |
| 64 | + Detail = "System.Boolean ValueFromRemainingArguments", |
| 65 | + InsertTextFormat = InsertTextFormat.PlainText, |
| 66 | + InsertText = "ValueFromRemainingArguments", |
| 67 | + FilterText = "ValueFromRemainingArguments", |
| 68 | + Label = "ValueFromRemainingArguments", |
| 69 | + SortText = "0003ValueFromRemainingArguments", |
| 70 | + TextEdit = new TextEdit |
| 71 | + { |
| 72 | + NewText = "ValueFromRemainingArguments", |
| 73 | + Range = new Range |
| 74 | + { |
| 75 | + Start = new Position { Line = 15, Character = 32 }, |
| 76 | + End = new Position { Line = 15, Character = 37 } |
| 77 | + } |
| 78 | + } |
| 79 | + }; |
25 | 80 | }
|
26 | 81 | }
|
27 |
| - |
|
0 commit comments