initial
This commit is contained in:
commit
baa0056244
352 changed files with 47928 additions and 0 deletions
|
|
@ -0,0 +1,3 @@
|
|||
. ./SimpleFile.ps1
|
||||
|
||||
My-Function "test"
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using Microsoft.PowerShell.EditorServices.Services.TextDocument;
|
||||
|
||||
namespace Microsoft.PowerShell.EditorServices.Test.Shared.References
|
||||
{
|
||||
public static class FindsReferencesOnBuiltInCommandWithAliasData
|
||||
{
|
||||
public static readonly ScriptRegion SourceDetails = new(
|
||||
file: TestUtilities.NormalizePath("References/SimpleFile.ps1"),
|
||||
text: string.Empty,
|
||||
startLineNumber: 14,
|
||||
startColumnNumber: 3,
|
||||
startOffset: 0,
|
||||
endLineNumber: 0,
|
||||
endColumnNumber: 0,
|
||||
endOffset: 0);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using Microsoft.PowerShell.EditorServices.Services.TextDocument;
|
||||
|
||||
namespace Microsoft.PowerShell.EditorServices.Test.Shared.References
|
||||
{
|
||||
public static class FindsReferencesOnFunctionData
|
||||
{
|
||||
public static readonly ScriptRegion SourceDetails = new(
|
||||
file: TestUtilities.NormalizePath("References/SimpleFile.ps1"),
|
||||
text: string.Empty,
|
||||
startLineNumber: 3,
|
||||
startColumnNumber: 8,
|
||||
startOffset: 0,
|
||||
endLineNumber: 0,
|
||||
endColumnNumber: 0,
|
||||
endOffset: 0);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using Microsoft.PowerShell.EditorServices.Services.TextDocument;
|
||||
|
||||
namespace Microsoft.PowerShell.EditorServices.Test.Shared.References
|
||||
{
|
||||
public static class FindsReferencesOnTypeSymbolsData
|
||||
{
|
||||
public static readonly ScriptRegion ClassSourceDetails = new(
|
||||
file: TestUtilities.NormalizePath("References/TypeAndClassesFile.ps1"),
|
||||
text: string.Empty,
|
||||
startLineNumber: 8,
|
||||
startColumnNumber: 12,
|
||||
startOffset: 0,
|
||||
endLineNumber: 0,
|
||||
endColumnNumber: 0,
|
||||
endOffset: 0);
|
||||
|
||||
public static readonly ScriptRegion EnumSourceDetails = new(
|
||||
file: TestUtilities.NormalizePath("References/TypeAndClassesFile.ps1"),
|
||||
text: string.Empty,
|
||||
startLineNumber: 39,
|
||||
startColumnNumber: 8,
|
||||
startOffset: 0,
|
||||
endLineNumber: 0,
|
||||
endColumnNumber: 0,
|
||||
endOffset: 0);
|
||||
|
||||
public static readonly ScriptRegion ConstructorSourceDetails = new(
|
||||
file: TestUtilities.NormalizePath("References/TypeAndClassesFile.ps1"),
|
||||
text: string.Empty,
|
||||
startLineNumber: 9,
|
||||
startColumnNumber: 8,
|
||||
startOffset: 0,
|
||||
endLineNumber: 0,
|
||||
endColumnNumber: 0,
|
||||
endOffset: 0);
|
||||
|
||||
public static readonly ScriptRegion MethodSourceDetails = new(
|
||||
file: TestUtilities.NormalizePath("References/TypeAndClassesFile.ps1"),
|
||||
text: string.Empty,
|
||||
startLineNumber: 36,
|
||||
startColumnNumber: 16,
|
||||
startOffset: 0,
|
||||
endLineNumber: 0,
|
||||
endColumnNumber: 0,
|
||||
endOffset: 0);
|
||||
|
||||
public static readonly ScriptRegion PropertySourceDetails = new(
|
||||
file: TestUtilities.NormalizePath("References/TypeAndClassesFile.ps1"),
|
||||
text: string.Empty,
|
||||
startLineNumber: 35,
|
||||
startColumnNumber: 12,
|
||||
startOffset: 0,
|
||||
endLineNumber: 0,
|
||||
endColumnNumber: 0,
|
||||
endOffset: 0);
|
||||
|
||||
public static readonly ScriptRegion EnumMemberSourceDetails = new(
|
||||
file: TestUtilities.NormalizePath("References/TypeAndClassesFile.ps1"),
|
||||
text: string.Empty,
|
||||
startLineNumber: 45,
|
||||
startColumnNumber: 16,
|
||||
startOffset: 0,
|
||||
endLineNumber: 0,
|
||||
endColumnNumber: 0,
|
||||
endOffset: 0);
|
||||
|
||||
public static readonly ScriptRegion TypeExpressionSourceDetails = new(
|
||||
file: TestUtilities.NormalizePath("References/TypeAndClassesFile.ps1"),
|
||||
text: string.Empty,
|
||||
startLineNumber: 34,
|
||||
startColumnNumber: 12,
|
||||
startOffset: 0,
|
||||
endLineNumber: 0,
|
||||
endColumnNumber: 0,
|
||||
endOffset: 0);
|
||||
|
||||
public static readonly ScriptRegion TypeConstraintSourceDetails = new(
|
||||
file: TestUtilities.NormalizePath("References/TypeAndClassesFile.ps1"),
|
||||
text: string.Empty,
|
||||
startLineNumber: 25,
|
||||
startColumnNumber: 22,
|
||||
startOffset: 0,
|
||||
endLineNumber: 0,
|
||||
endColumnNumber: 0,
|
||||
endOffset: 0);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using Microsoft.PowerShell.EditorServices.Services.TextDocument;
|
||||
|
||||
namespace Microsoft.PowerShell.EditorServices.Test.Shared.References
|
||||
{
|
||||
public static class FindsReferencesOnVariableData
|
||||
{
|
||||
public static readonly ScriptRegion SourceDetails = new(
|
||||
file: TestUtilities.NormalizePath("References/SimpleFile.ps1"),
|
||||
text: string.Empty,
|
||||
startLineNumber: 10,
|
||||
startColumnNumber: 17,
|
||||
startOffset: 0,
|
||||
endLineNumber: 0,
|
||||
endColumnNumber: 0,
|
||||
endOffset: 0);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
function BasicFunction {}
|
||||
BasicFunction
|
||||
|
||||
function FunctionWithExtraSpace
|
||||
{
|
||||
|
||||
} FunctionWithExtraSpace
|
||||
|
||||
function
|
||||
|
||||
|
||||
FunctionNameOnDifferentLine
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{}
|
||||
|
||||
|
||||
FunctionNameOnDifferentLine
|
||||
|
||||
function IndentedFunction { } IndentedFunction
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
function My-Function ($myInput)
|
||||
{
|
||||
My-Function $myInput
|
||||
}
|
||||
|
||||
$things = 4
|
||||
|
||||
$things = 3
|
||||
|
||||
My-Function $things
|
||||
|
||||
Write-Output "Hello World";
|
||||
|
||||
Get-ChildItem
|
||||
gci
|
||||
dir
|
||||
Write-Host
|
||||
Get-ChildItem
|
||||
|
||||
My-Alias
|
||||
|
||||
Invoke-Command -ScriptBlock ${Function:My-Function}
|
||||
|
||||
[string]$hello = "test"
|
||||
Write-Host $hello
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
Get-ChildItem ./file1.ps1
|
||||
$myScriptVar = 123
|
||||
|
||||
class BaseClass {
|
||||
|
||||
}
|
||||
|
||||
class SuperClass : BaseClass {
|
||||
SuperClass([string]$name) {
|
||||
|
||||
}
|
||||
|
||||
SuperClass() { }
|
||||
|
||||
[string]$SomePropWithDefault = 'this is a default value'
|
||||
|
||||
[int]$SomeProp
|
||||
|
||||
[string]MyClassMethod([string]$param1, $param2, [int]$param3) {
|
||||
$this.SomePropWithDefault = 'something happend'
|
||||
return 'finished'
|
||||
}
|
||||
|
||||
[string]
|
||||
MyClassMethod([MyEnum]$param1) {
|
||||
return 'hello world'
|
||||
}
|
||||
[string]MyClassMethod() {
|
||||
return 'hello world'
|
||||
}
|
||||
}
|
||||
|
||||
New-Object SuperClass
|
||||
$o = [SuperClass]::new()
|
||||
$o.SomeProp
|
||||
$o.MyClassMethod()
|
||||
|
||||
|
||||
enum MyEnum {
|
||||
First
|
||||
Second
|
||||
Third
|
||||
}
|
||||
|
||||
[MyEnum]::First
|
||||
'First' -is [MyEnum]
|
||||
Loading…
Add table
Add a link
Reference in a new issue