Skip to content

Commit fc12896

Browse files
Add query language for type signatures (#14)
Adds support for a new type expression based query language to `Find-Member` and `Find-Type`. Also better formatting, a new cmdlet (`Format-MemberSignature`) and a lot of other new parameters.
1 parent 209564a commit fc12896

File tree

129 files changed

+15050
-2110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+15050
-2110
lines changed

.circleci/config.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
env:
12+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
13+
POWERSHELL_TELEMETRY_OPTOUT: 1
14+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
15+
DOTNET_NOLOGO: true
16+
17+
defaults:
18+
run:
19+
shell: pwsh
20+
21+
jobs:
22+
build:
23+
name: Build and Test
24+
runs-on: ${{ matrix.os }}
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
os: [ ubuntu-latest, macos-latest, windows-latest ]
29+
steps:
30+
- name: Check Version
31+
run: $PSVersionTable
32+
- uses: actions/checkout@v1
33+
- name: Test and Build
34+
run: ./build.ps1 -Force
35+
- uses: actions/upload-artifact@v1
36+
if: matrix.os == 'windows-latest'
37+
with:
38+
name: ClassExplorer
39+
path: ./Release/ClassExplorer
40+
- uses: actions/upload-artifact@v1
41+
if: matrix.os != 'windows-latest'
42+
with:
43+
name: ClassExplorer-${{ matrix.os }}
44+
path: ./Release/ClassExplorer
45+
- name: Upload Test Results
46+
if: always()
47+
uses: actions/upload-artifact@v2
48+
with:
49+
name: Unit Test Results (${{ matrix.os }})
50+
path: ./TestResults/Pester.xml

.github/workflows/publish.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: publish
2+
on:
3+
release:
4+
types: [ published ]
5+
6+
env:
7+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
8+
POWERSHELL_TELEMETRY_OPTOUT: 1
9+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
10+
DOTNET_NOLOGO: true
11+
12+
13+
defaults:
14+
run:
15+
shell: pwsh
16+
17+
jobs:
18+
build:
19+
name: Publish
20+
runs-on: windows-latest
21+
steps:
22+
- uses: actions/checkout@v1
23+
- name: Test and Build
24+
run: ./build.ps1 -Force -Publish
25+
env:
26+
GALLERY_API_KEY: ${{ secrets.GALLERY_API_KEY }}
27+
- name: Upload Test Results
28+
if: always()
29+
uses: actions/upload-artifact@v2
30+
with:
31+
name: Unit Test Results
32+
path: ./TestResults/Pester.xml

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// See http://go.microsoft.com/fwlink/?LinkId=827846
33
// for the documentation about the extensions.json format
44
"recommendations": [
5-
"ms-vscode.csharp",
5+
"ms-dotnettools.csharp",
66
"ms-vscode.powershell"
77
]
88
}

.vscode/launch.json

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,35 @@
22
"version": "0.2.0",
33
"configurations": [
44
{
5-
"name": ".NET Core Attach",
5+
"name": ".NET Attach",
6+
"type": "coreclr",
7+
"request": "attach",
8+
"justMyCode": true,
9+
},
10+
{
11+
"name": ".NET Classic Attach",
612
"type": "clr",
713
"request": "attach",
8-
"processId": "${command:pickProcess}"
14+
"justMyCode": true,
15+
},
16+
{
17+
"name": ".NET Attach (!jmc)",
18+
"type": "coreclr",
19+
"request": "attach",
20+
"justMyCode": false,
921
},
1022
{
11-
"name": ".NET Core Launch (console)",
23+
"name": ".NET Classic Attach (!jmc)",
1224
"type": "clr",
25+
"request": "attach",
26+
"justMyCode": false,
27+
},
28+
{
29+
"name": "PowerShell Launch Current File",
30+
"type": "PowerShell",
1331
"request": "launch",
14-
"preLaunchTask": "Build",
15-
"program": "powershell",
16-
"args": [
17-
"-NoExit",
18-
". ${workspaceRoot}/debugHarness.ps1"],
19-
"cwd": "${workspaceRoot}",
20-
"stopAtEntry": false,
21-
"console": "externalTerminal"
22-
}
32+
"script": "${file}",
33+
"cwd": "${file}"
34+
},
2335
]
2436
}
25-

.vscode/tasks.json

Lines changed: 15 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,24 @@
1-
// Available variables which can be used inside of strings.
2-
// ${workspaceRoot}: the root folder of the team
3-
// ${file}: the current opened file
4-
// ${relativeFile}: the current opened file relative to workspaceRoot
5-
// ${fileBasename}: the current opened file's basename
6-
// ${fileDirname}: the current opened file's dirname
7-
// ${fileExtname}: the current opened file's extension
8-
// ${cwd}: the current working directory of the spawned process
91
{
102
// See https://go.microsoft.com/fwlink/?LinkId=733558
113
// for the documentation about the tasks.json format
12-
"version": "0.1.0",
13-
"runner": "terminal",
14-
15-
// Start PowerShell
16-
"windows": {
17-
"command": "PowerShell.exe"
18-
},
19-
"linux": {
20-
"command": "/usr/bin/powershell"
21-
},
22-
"osx": {
23-
"command": "/usr/local/bin/powershell"
24-
},
25-
26-
// The command is a shell script
27-
"isShellCommand": true,
28-
29-
// Show the output window always
30-
"showOutput": "always",
31-
32-
"args": [
33-
"-NoProfile", "-ExecutionPolicy", "Bypass"
34-
],
35-
36-
// Associate with test task runner
4+
"version": "2.0.0",
375
"tasks": [
386
{
39-
"taskName": "Clean",
40-
"suppressTaskName": true,
41-
"showOutput": "always",
7+
"label": "build",
8+
"command": "dotnet",
9+
"type": "shell",
4210
"args": [
43-
"Invoke-Build -Task Clean"
44-
]
45-
},
46-
{
47-
"taskName": "Build",
48-
"suppressTaskName": true,
49-
"isBuildCommand": true,
50-
"showOutput": "always",
51-
"args": [
52-
"Invoke-Build"
53-
]
54-
},
55-
{
56-
"taskName": "Test",
57-
"suppressTaskName": true,
58-
"isTestCommand": true,
59-
"showOutput": "always",
60-
"args": [
61-
"Invoke-Build -Task Test"
62-
]
63-
},
64-
{
65-
"taskName": "Test With Coverage",
66-
"suppressTaskName": true,
67-
"isTestCommand": true,
68-
"showOutput": "always",
69-
"args": [
70-
"Invoke-Build -Task Test -GenerateCodeCoverage"
71-
]
72-
},
73-
{
74-
"taskName": "Install",
75-
"suppressTaskName": true,
76-
"showOutput": "always",
77-
"args": [
78-
"Invoke-Build -Task Install -Configuration Release"
79-
]
11+
"build",
12+
// Ask dotnet build to generate full paths for file names.
13+
"/property:GenerateFullPaths=true",
14+
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
15+
"/consoleloggerparameters:NoSummary"
16+
],
17+
"group": {
18+
"isDefault": true,
19+
"kind": "build",
20+
},
21+
"problemMatcher": "$msCompile"
8022
}
8123
]
8224
}
83-

ClassExplorer.build.ps1

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ $script:Discovery = @{
4444

4545
$tools = "$PSScriptRoot\tools"
4646
$script:GetDotNet = Get-Command $tools\GetDotNet.ps1
47-
$script:CreateFormatDefinitions = Get-Command $tools\CreateFormatDefinitions.ps1
4847
$script:AssertModule = Get-Command $tools\AssertRequiredModule.ps1
4948
$script:GetOpenCover = Get-Command $tools\GetOpenCover.ps1
49+
$script:GenerateSignatureMarkdown = Get-Command $tools\GenerateSignatureMarkdown.ps1
5050

5151
task AssertDotNet {
5252
$script:dotnet = & $GetDotNet -Unix:$Discovery.IsUnix
@@ -63,12 +63,15 @@ task AssertOpenCover -If { $GenerateCodeCoverage.IsPresent } {
6363
}
6464

6565
task AssertRequiredModules {
66-
& $AssertModule Pester 4.1.1 -Force:$Force.IsPresent
67-
& $AssertModule InvokeBuild 5.0.0 -Force:$Force.IsPresent
68-
& $AssertModule platyPS 0.9.0 -Force:$Force.IsPresent
66+
& $AssertModule Pester 5.3.0 -Force:$Force.IsPresent
67+
& $AssertModule InvokeBuild 5.8.4 -Force:$Force.IsPresent
68+
& $AssertModule platyPS 0.14.2 -Force:$Force.IsPresent
69+
70+
# Cannot import powershell-yaml and platyPS in the same session due to
71+
# assembly conflict.
72+
& $AssertModule powershell-yaml 0.4.2 -Force:$Force.IsPresent -NoImport
6973
}
7074

71-
# TODO: Look into replacing this junk with PSDepend
7275
task AssertDevDependencies -Jobs AssertDotNet, AssertOpenCover, AssertRequiredModules
7376

7477
task Clean {
@@ -82,7 +85,7 @@ task Clean {
8285
}
8386

8487
$null = New-Item $Folders.Results -ItemType Directory
85-
& $dotnet clean
88+
& $dotnet clean --verbosity quiet -nologo
8689
}
8790

8891
task BuildDocs -If { $Discovery.HasDocs } {
@@ -91,29 +94,30 @@ task BuildDocs -If { $Discovery.HasDocs } {
9194

9295
$null = New-Item $releaseDocs -ItemType Directory -Force -ErrorAction SilentlyContinue
9396
$null = New-ExternalHelp -Path $sourceDocs -OutputPath $releaseDocs
97+
98+
# Cannot import powershell-yaml and platyPS in the same session due to
99+
# assembly conflict.
100+
$generateSignatureMarkdownPath = $GenerateSignatureMarkdown.Source
101+
Start-Job {
102+
& $using:generateSignatureMarkdownPath -AboutHelp $using:releaseDocs\about_Type_Signatures.help.txt
103+
& $using:generateSignatureMarkdownPath $using:PSScriptRoot\docs\en-US\about_Type_Signatures.help.md
104+
} | Receive-Job -Wait -AutoRemoveJob
94105
}
95106

96107
task BuildDll {
97108
if (-not $Discovery.IsUnix) {
98-
& $dotnet build --configuration $Configuration --framework net452
109+
& $dotnet publish --configuration $Configuration --framework net471 --verbosity quiet -nologo
99110
}
100-
& $dotnet build --configuration $Configuration --framework netcoreapp2.0
101-
}
102-
103-
task BuildFormat {
104-
$xmlFolder = '{0}\xml' -f $Folders.Release
105-
106-
$null = New-Item $xmlFolder -ItemType Directory
107-
& $CreateFormatDefinitions -Destination $xmlFolder
111+
& $dotnet publish --configuration $Configuration --framework netcoreapp3.1 --verbosity quiet -nologo
108112
}
109113

110114
task CopyToRelease {
111115
$powershellSource = '{0}\*' -f $Folders.PowerShell
112116
$release = $Folders.Release
113117
$releaseDesktopBin = "$release\bin\Desktop"
114118
$releaseCoreBin = "$release\bin\Core"
115-
$sourceDesktopBin = '{0}\net452\{1}*' -f $Folders.Build, $Settings.Name
116-
$sourceCoreBin = '{0}\netcoreapp2.0\{1}*' -f $Folders.Build, $Settings.Name
119+
$sourceDesktopBin = '{0}\net471\publish\*' -f $Folders.Build
120+
$sourceCoreBin = '{0}\netcoreapp3.1\publish\*' -f $Folders.Build
117121
Copy-Item -Path $powershellSource -Destination $release -Recurse -Force
118122

119123
if (-not $Discovery.IsUnix) {
@@ -153,12 +157,12 @@ task DoTest -If { $Discovery.HasTests -and $Settings.ShouldTest } {
153157

154158
if ($GenerateCodeCoverage.IsPresent) {
155159
# OpenCover needs full pdb's. I'm very open to suggestions for streamlining this...
156-
& $dotnet clean
157-
& $dotnet build --configuration $Configuration --framework net452 /p:DebugType=Full
160+
# & $dotnet clean
161+
& $dotnet publish --configuration $Configuration --framework net471 --verbosity quiet -nologo /p:DebugType=Full
158162

159163
$moduleName = $Settings.Name
160164
$release = '{0}\bin\Desktop\{1}' -f $Folders.Release, $moduleName
161-
$coverage = '{0}\net452\{1}' -f $Folders.Build, $moduleName
165+
$coverage = '{0}\net471\{1}' -f $Folders.Build, $moduleName
162166

163167
Rename-Item "$release.pdb" -NewName "$moduleName.pdb.tmp"
164168
Rename-Item "$release.dll" -NewName "$moduleName.dll.tmp"
@@ -208,7 +212,7 @@ task DoPublish {
208212
Publish-Module -Name $Folders.Release -NuGetApiKey $apiKey -Confirm
209213
}
210214

211-
task Build -Jobs AssertDevDependencies, Clean, BuildDll, CopyToRelease, BuildDocs, BuildFormat
215+
task Build -Jobs AssertDevDependencies, Clean, BuildDll, CopyToRelease, BuildDocs
212216

213217
task Test -Jobs Build, DoTest
214218

@@ -219,4 +223,3 @@ task Install -Jobs PreRelease, DoInstall
219223
task Publish -Jobs PreRelease, DoPublish
220224

221225
task . Build
222-

0 commit comments

Comments
 (0)