Skip to content

Add query language for type signatures #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Apr 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
053e7e3
Add query langauge for type signatures
SeeminglyScience Aug 30, 2021
8f911d4
Add Format-MemberSignature and formatting
SeeminglyScience Sep 7, 2021
9f55b4d
Abstract logic for type and member searches
SeeminglyScience Sep 8, 2021
c635072
Make signature keywords case insensitive
SeeminglyScience Sep 8, 2021
e8daf5f
Lots of fixes
SeeminglyScience Feb 2, 2022
804ec30
Fix and add many things
SeeminglyScience Mar 12, 2022
20d5108
Add features to Pointer signature
SeeminglyScience Apr 2, 2022
d7097c4
Ignore JIT time exceptions
SeeminglyScience Apr 17, 2022
d55e725
Add examples for new pointer query
SeeminglyScience Apr 23, 2022
64fbe55
Fix pointer signature test
SeeminglyScience Apr 23, 2022
5b99bcc
Fix pipeline stop exceptions from being caught
SeeminglyScience Apr 23, 2022
a64ab62
Fix escapes in string literals
SeeminglyScience Apr 23, 2022
5aa8d18
Clean up build files
SeeminglyScience Apr 23, 2022
950a8a6
Add ToString to RangeExpression
SeeminglyScience Apr 23, 2022
dee0e67
Fix required dotnet SDK version
SeeminglyScience Apr 23, 2022
754c5d0
Ensure powershell-yaml is installed for build
SeeminglyScience Apr 23, 2022
540d44b
Checking PowerShell version in actions -_-
SeeminglyScience Apr 23, 2022
af593cf
Add a fix that definitely won't work
SeeminglyScience Apr 24, 2022
b898253
Especially if it doesn't parse...
SeeminglyScience Apr 24, 2022
61de66f
Add -Force to make this three useless commits
SeeminglyScience Apr 24, 2022
5164efd
Why not four
SeeminglyScience Apr 24, 2022
07afb3c
Last one before I abandon this module
SeeminglyScience Apr 24, 2022
e937921
Resolve assembly conflict with platyPS and yaml
SeeminglyScience Apr 24, 2022
729e377
Revert to using PSGet2
SeeminglyScience Apr 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .circleci/config.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: build

on:
push:
branches:
- master
pull_request:
branches:
- master

env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
POWERSHELL_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true

defaults:
run:
shell: pwsh

jobs:
build:
name: Build and Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- name: Check Version
run: $PSVersionTable
- uses: actions/checkout@v1
- name: Test and Build
run: ./build.ps1 -Force
- uses: actions/upload-artifact@v1
if: matrix.os == 'windows-latest'
with:
name: ClassExplorer
path: ./Release/ClassExplorer
- uses: actions/upload-artifact@v1
if: matrix.os != 'windows-latest'
with:
name: ClassExplorer-${{ matrix.os }}
path: ./Release/ClassExplorer
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Unit Test Results (${{ matrix.os }})
path: ./TestResults/Pester.xml
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: publish
on:
release:
types: [ published ]

env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
POWERSHELL_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true


defaults:
run:
shell: pwsh

jobs:
build:
name: Publish
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: Test and Build
run: ./build.ps1 -Force -Publish
env:
GALLERY_API_KEY: ${{ secrets.GALLERY_API_KEY }}
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Unit Test Results
path: ./TestResults/Pester.xml
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"ms-vscode.csharp",
"ms-dotnettools.csharp",
"ms-vscode.powershell"
]
}
37 changes: 24 additions & 13 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,35 @@
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Attach",
"name": ".NET Attach",
"type": "coreclr",
"request": "attach",
"justMyCode": true,
},
{
"name": ".NET Classic Attach",
"type": "clr",
"request": "attach",
"processId": "${command:pickProcess}"
"justMyCode": true,
},
{
"name": ".NET Attach (!jmc)",
"type": "coreclr",
"request": "attach",
"justMyCode": false,
},
{
"name": ".NET Core Launch (console)",
"name": ".NET Classic Attach (!jmc)",
"type": "clr",
"request": "attach",
"justMyCode": false,
},
{
"name": "PowerShell Launch Current File",
"type": "PowerShell",
"request": "launch",
"preLaunchTask": "Build",
"program": "powershell",
"args": [
"-NoExit",
". ${workspaceRoot}/debugHarness.ps1"],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"console": "externalTerminal"
}
"script": "${file}",
"cwd": "${file}"
},
]
}

89 changes: 15 additions & 74 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,83 +1,24 @@
// Available variables which can be used inside of strings.
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${relativeFile}: the current opened file relative to workspaceRoot
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"runner": "terminal",

// Start PowerShell
"windows": {
"command": "PowerShell.exe"
},
"linux": {
"command": "/usr/bin/powershell"
},
"osx": {
"command": "/usr/local/bin/powershell"
},

// The command is a shell script
"isShellCommand": true,

// Show the output window always
"showOutput": "always",

"args": [
"-NoProfile", "-ExecutionPolicy", "Bypass"
],

// Associate with test task runner
"version": "2.0.0",
"tasks": [
{
"taskName": "Clean",
"suppressTaskName": true,
"showOutput": "always",
"label": "build",
"command": "dotnet",
"type": "shell",
"args": [
"Invoke-Build -Task Clean"
]
},
{
"taskName": "Build",
"suppressTaskName": true,
"isBuildCommand": true,
"showOutput": "always",
"args": [
"Invoke-Build"
]
},
{
"taskName": "Test",
"suppressTaskName": true,
"isTestCommand": true,
"showOutput": "always",
"args": [
"Invoke-Build -Task Test"
]
},
{
"taskName": "Test With Coverage",
"suppressTaskName": true,
"isTestCommand": true,
"showOutput": "always",
"args": [
"Invoke-Build -Task Test -GenerateCodeCoverage"
]
},
{
"taskName": "Install",
"suppressTaskName": true,
"showOutput": "always",
"args": [
"Invoke-Build -Task Install -Configuration Release"
]
"build",
// Ask dotnet build to generate full paths for file names.
"/property:GenerateFullPaths=true",
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
"/consoleloggerparameters:NoSummary"
],
"group": {
"isDefault": true,
"kind": "build",
},
"problemMatcher": "$msCompile"
}
]
}

47 changes: 25 additions & 22 deletions ClassExplorer.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ $script:Discovery = @{

$tools = "$PSScriptRoot\tools"
$script:GetDotNet = Get-Command $tools\GetDotNet.ps1
$script:CreateFormatDefinitions = Get-Command $tools\CreateFormatDefinitions.ps1
$script:AssertModule = Get-Command $tools\AssertRequiredModule.ps1
$script:GetOpenCover = Get-Command $tools\GetOpenCover.ps1
$script:GenerateSignatureMarkdown = Get-Command $tools\GenerateSignatureMarkdown.ps1

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

task AssertRequiredModules {
& $AssertModule Pester 4.1.1 -Force:$Force.IsPresent
& $AssertModule InvokeBuild 5.0.0 -Force:$Force.IsPresent
& $AssertModule platyPS 0.9.0 -Force:$Force.IsPresent
& $AssertModule Pester 5.3.0 -Force:$Force.IsPresent
& $AssertModule InvokeBuild 5.8.4 -Force:$Force.IsPresent
& $AssertModule platyPS 0.14.2 -Force:$Force.IsPresent

# Cannot import powershell-yaml and platyPS in the same session due to
# assembly conflict.
& $AssertModule powershell-yaml 0.4.2 -Force:$Force.IsPresent -NoImport
}

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

task Clean {
Expand All @@ -82,7 +85,7 @@ task Clean {
}

$null = New-Item $Folders.Results -ItemType Directory
& $dotnet clean
& $dotnet clean --verbosity quiet -nologo
}

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

$null = New-Item $releaseDocs -ItemType Directory -Force -ErrorAction SilentlyContinue
$null = New-ExternalHelp -Path $sourceDocs -OutputPath $releaseDocs

# Cannot import powershell-yaml and platyPS in the same session due to
# assembly conflict.
$generateSignatureMarkdownPath = $GenerateSignatureMarkdown.Source
Start-Job {
& $using:generateSignatureMarkdownPath -AboutHelp $using:releaseDocs\about_Type_Signatures.help.txt
& $using:generateSignatureMarkdownPath $using:PSScriptRoot\docs\en-US\about_Type_Signatures.help.md
} | Receive-Job -Wait -AutoRemoveJob
}

task BuildDll {
if (-not $Discovery.IsUnix) {
& $dotnet build --configuration $Configuration --framework net452
& $dotnet publish --configuration $Configuration --framework net471 --verbosity quiet -nologo
}
& $dotnet build --configuration $Configuration --framework netcoreapp2.0
}

task BuildFormat {
$xmlFolder = '{0}\xml' -f $Folders.Release

$null = New-Item $xmlFolder -ItemType Directory
& $CreateFormatDefinitions -Destination $xmlFolder
& $dotnet publish --configuration $Configuration --framework netcoreapp3.1 --verbosity quiet -nologo
}

task CopyToRelease {
$powershellSource = '{0}\*' -f $Folders.PowerShell
$release = $Folders.Release
$releaseDesktopBin = "$release\bin\Desktop"
$releaseCoreBin = "$release\bin\Core"
$sourceDesktopBin = '{0}\net452\{1}*' -f $Folders.Build, $Settings.Name
$sourceCoreBin = '{0}\netcoreapp2.0\{1}*' -f $Folders.Build, $Settings.Name
$sourceDesktopBin = '{0}\net471\publish\*' -f $Folders.Build
$sourceCoreBin = '{0}\netcoreapp3.1\publish\*' -f $Folders.Build
Copy-Item -Path $powershellSource -Destination $release -Recurse -Force

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

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

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

Rename-Item "$release.pdb" -NewName "$moduleName.pdb.tmp"
Rename-Item "$release.dll" -NewName "$moduleName.dll.tmp"
Expand Down Expand Up @@ -208,7 +212,7 @@ task DoPublish {
Publish-Module -Name $Folders.Release -NuGetApiKey $apiKey -Confirm
}

task Build -Jobs AssertDevDependencies, Clean, BuildDll, CopyToRelease, BuildDocs, BuildFormat
task Build -Jobs AssertDevDependencies, Clean, BuildDll, CopyToRelease, BuildDocs

task Test -Jobs Build, DoTest

Expand All @@ -219,4 +223,3 @@ task Install -Jobs PreRelease, DoInstall
task Publish -Jobs PreRelease, DoPublish

task . Build

Loading