Commit graph

63 commits

Author SHA1 Message Date
dependabot-preview[bot] e3369e4c48
Bump XunitXml.TestLogger from 3.0.56 to 3.0.62 (#14702) 2021-02-04 17:54:18 -08:00
Dongbo Wang e803d3bc8d
Update the ICommandPredictor to provide more feedback and also make feedback easier to be corelated (#14649) 2021-02-04 15:34:17 -08:00
dependabot-preview[bot] 2d2fb8d702
Bump XunitXml.TestLogger from 2.1.45 to 3.0.56 (#14682)
Bumps [XunitXml.TestLogger](https://github.com/spekt/xunit.testlogger) from 2.1.45 to 3.0.56.
- [Release notes](https://github.com/spekt/xunit.testlogger/releases)
- [Changelog](https://github.com/spekt/xunit.testlogger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/spekt/xunit.testlogger/compare/v2.1.45...v3.0.56)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-02-01 15:01:45 -08:00
dependabot-preview[bot] b049017be2
Bump XunitXml.TestLogger from 2.1.26 to 2.1.45 (#14660)
Bumps [XunitXml.TestLogger](https://github.com/spekt/xunit.testlogger) from 2.1.26 to 2.1.45.
- [Release notes](https://github.com/spekt/xunit.testlogger/releases)
- [Commits](https://github.com/spekt/xunit.testlogger/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-01-25 10:59:48 -08:00
xtqqczze aecada3e67
Enable CA1822: Mark private members as static (#13897) 2020-12-09 11:04:23 -08:00
dependabot-preview[bot] 18b50e80ef
Bump Microsoft.NET.Test.Sdk from 16.8.0 to 16.8.3 (#14310)
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 16.8.0 to 16.8.3.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Commits](https://github.com/microsoft/vstest/compare/v16.8.0...v16.8.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-12-04 16:42:27 +05:00
xtqqczze c7bdb24ff3
Mark local variable as const (#13217)
RCS1118: Mark local variable as const https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1118.md
2020-11-24 20:06:16 +05:00
xtqqczze 358db74479
Enable CA1816: Dispose methods should call SuppressFinalize (#14074)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1816
2020-11-24 09:29:15 +05:00
xtqqczze f14c76aab9
Enable SA1516: Elements should be separated by blank line (#14137)
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1516.md
2020-11-20 16:11:36 +05:00
xtqqczze 006fe4d2dd
Enable IDE0082: ConvertTypeOfToNameOf (#14042)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0082
2020-11-16 19:56:07 +05:00
xtqqczze e7232b89c9
Fix PriorityAttribute name (#14094)
Fix regression after #13496
2020-11-15 16:31:50 +05:00
Ilya d9090b4a49
Write better error message if config file is broken (#13496) 2020-11-13 17:22:26 -08:00
dependabot-preview[bot] f2139dfa3b
Bump Microsoft.NET.Test.Sdk from 16.7.1 to 16.8.0 (#14020)
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 16.7.1 to 16.8.0.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Commits](https://github.com/microsoft/vstest/compare/v16.7.1...v16.8.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-13 08:50:33 +05:00
xtqqczze 47c92090db
Enable CA1068: CancellationToken parameters must come last (#13867)
* Enable CA1068: CancellationToken parameters must come last
2020-11-05 09:08:28 +05:00
xtqqczze 1d7a93c2e0
Enable CA1825: Avoid zero-length array allocations (#13961) 2020-11-04 08:56:26 +05:00
xtqqczze a2a938e964
Fix IDE0044: MakeFieldReadonly part 10 (#13893)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0044
2020-10-30 12:20:06 +05:00
xtqqczze 9932560841
Enable CA1050: Declare types in namespaces (#13872) 2020-10-26 22:34:26 +05:00
xtqqczze 859890374a
Use read-only auto-implemented properties (#13507)
* Autofix RCS1170: Use read-only auto-implemented property
2020-09-02 08:11:16 +05:00
Ilya 3b83a686a1
Add null check for args in CommandLineParser (#13451) 2020-08-28 12:03:30 -07:00
Dongbo Wang 6615fa3df6
Fix test hooks for CommandLineParameterParser (#13459) 2020-08-21 11:59:30 -07:00
dependabot-preview[bot] ff2143d07b
Bump Microsoft.NET.Test.Sdk from 16.7.0 to 16.7.1 (#13492)
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 16.7.0 to 16.7.1.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Commits](https://github.com/microsoft/vstest/compare/v16.7.0...v16.7.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-08-21 08:53:58 -07:00
Dongbo Wang fc4c9cbfd7
Initial work of the subsystem plugin model (for minimal powershell) (#13186) 2020-08-20 17:41:44 -07:00
Ilya 68d46c1792
Refactor command line parser to do early parsing (#11482) 2020-08-12 09:58:46 -07:00
dependabot-preview[bot] 8bbd86ddab
Bump Microsoft.NET.Test.Sdk from 16.6.1 to 16.7.0 (#13364) 2020-08-06 10:26:12 -07:00
dependabot-preview[bot] 2b4d147be7
Bump xunit.runner.visualstudio from 2.4.2 to 2.4.3 (#13343) 2020-08-05 10:09:48 -07:00
Dongbo Wang 4464d1b414
Add DefaultVisit method to the visitor interface and class (#13258) 2020-07-31 10:16:59 -07:00
Dongbo Wang 4b9b0788ed
Revert "Use is null syntax (#13277)" (#13322)
This reverts commit 6c03776d74.
2020-07-30 16:06:38 -07:00
xtqqczze 7beec89f50
Add copyright header to .editorconfig and update files (#13306) 2020-07-30 09:47:21 -07:00
xtqqczze 6c03776d74
Use is null syntax (#13277)
Replace `== null` with `is null`
2020-07-30 18:04:03 +05:00
dependabot-preview[bot] 16736a30b2
Bump Xunit.SkippableFact from 1.4.8 to 1.4.13 (#13143) 2020-07-13 10:13:05 -07:00
xtqqczze 8901d2a509
Cleanup: use int instead of uint in places where it's more appropriate (#13141) 2020-07-13 07:10:57 -07:00
dependabot-preview[bot] 766e166f99
Bump xunit.runner.visualstudio from 2.4.1 to 2.4.2 (#12874) 2020-06-29 09:51:58 -07:00
xtqqczze 05cab7fa5a
Formatting: Add empty line between declarations (#12824)
# PR Summary

Automated fixes:
* RCS0013: Add empty line between single-line declarations of different kind
* RCS010: Add empty line between declarations

## PR Context


## PR Checklist

- [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
    - Use the present tense and imperative mood when describing your changes
- [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress).
    - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready.
- **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)**
    - [x] None
    - **OR**
    - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md)
        - [ ] Experimental feature name(s): <!-- Experimental feature name(s) here -->
- **User-facing changes**
    - [x] Not Applicable
    - **OR**
    - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
        - [ ] Issue filed: <!-- Number/link of that issue here -->
- **Testing - New and feature**
    - [x] N/A or can only be tested interactively
    - **OR**
    - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting)
- **Tooling**
    - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted.
    - **OR**
    - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include:
        - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host).
        - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features.
        - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions).
        - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors).
2020-05-29 04:56:33 +00:00
dependabot-preview[bot] 1bda154fc7
Bump Xunit.SkippableFact from 1.3.12 to 1.4.8 (#12480) 2020-04-28 10:35:40 -07:00
Steve Lee b7cb335f03
Update copyright notice to latest guidance (#12190) 2020-03-24 11:08:37 -07:00
John Dennis 895d4b3f3e
Allow cross-platform CAPI-compatible remote key exchange (#11185) 2020-02-19 12:28:43 -08:00
xtqqczze a34d0f3e80
Reformat code according to EditorConfig rules (#11681) 2020-01-31 14:56:22 -08:00
xtqqczze 70d9ed4d55 Remove Unicode BOM from text files (#11546) 2020-01-11 12:15:34 +05:00
Dongbo Wang 7772418dec Update PSConfiguration.ReadValueFromFile to make it faster and more memory efficient (#10839) 2019-10-30 14:44:34 -07:00
Dongbo Wang e1203aa31b
Skip the flaky test 'TestAppDomainProcessExitEvenHandlerNotLeaking' for now (#10827) 2019-10-17 17:39:14 -07:00
Dongbo Wang 48db3de03e
Make the event handler leaking test stable (#10790) 2019-10-16 09:55:41 -07:00
Dongbo Wang 60a930c9ba Add test for the even handler leaking fix (#10768)
Add a test for the even handler leaking fix addressed in #10626 https://github.com/PowerShell/PowerShell/pull/10626
The test is added to verify that PowerShell unregister the 'AppDomain.ProcessExit' event handler when a Runspace closes.
2019-10-11 23:34:53 +05:00
Dongbo Wang ec105da3f1 Some code cleanup work (#10698)
* Move Utils.GetUserConfigurationDirectory to Platform.ConfigDirectory
* Unify the use of Platform.ConfigDirectory and Platform.CacheDirectory
2019-10-07 14:15:01 +05:00
Kirk Munro cc0fed479a Add APIs for breakpoint management in runspaces and enable attach to process without BreakAll for PSES (#10338) 2019-09-05 11:30:25 -07:00
Ilya cf7699b4b9 Add tests for WildcardPattern.Escape() and Unescape() (#10090) 2019-08-07 13:25:10 -07:00
Ilya 2be3db8ab8
Cleanup unused pinvokes on unix (#9531)
* Remove TemporaryDirectory()
* Remove GetUserName()
* Use Environment.UserName on Unix
* Remove old comment
* Use Environment.UserName on Windows too
2019-05-07 10:22:01 +05:00
Tyler James Leonhardt 13fd3af810 New New-PSBreakpoint cmdlet & new -Breakpoint parameter for Debug-Runspace (#8923)
This PR does 4 things:

* Adds a new cmdlet `New-PSBreakpoint` which creates new `Breakpoint` objects and writes them to the pipeline
* Adds a `-Breakpoint` parameter to `Debug-Runspace` which will receive `Breakpoint` objects
* Makes the constructors for `*Breakpoint` public for use with the API
* Makes `Debugger.GetBreakpoint(string id)` and `Debugger.GetBreakpoints()` public since `SetBreakpoints` is public

Note: `New-PSBreakpoint` and `Set-PSBreakpoint` (which already exists) are similar... but `Set-PSBreakpoint` also sets the breakpoints in the _current_ runspace. This is not ideal if we want to set breakpoints in a _different runspace than the current one_.

## PR Context  

The "Attach to process" debugging experience in the PowerShell extension for VSCode is _ok_ but it's not great.

The reason it's not great is due to the `BreakAll` feature of PowerShell debugging which, when you run `Debug-Runspace`, will break at the first piece of code that gets run. This is not ideal when you "Attach to process" _and then_ run your code in the other runspace.

Today, the experience drops you in `PSReadLine`'s psm1 if PSRL is available or in the vscode PowerShell helper psm1.

It's unexpected for the user and not ideal.

This PR will allow the extension to pass in the breakpoints that need to be set initially with `BreakAll` turned off for none of this silly behavior.

### Silly behavior example

If you want a repro, try this:

PowerShell instance 1:
```
Enter-PSHostProcess -Id $otherprocesspid
Debug-Runspace 1
```

PowerShell instance 2:
```
./runfoo.ps1
```

Note that you end up NOT `runfoo.ps1`
2019-04-13 19:14:53 -07:00
Ilya cc6540b614
Cleanup style issues in CoreAdapter and MshObject (#9190) 2019-03-23 09:52:30 +05:00
Staffan Gustafsson 42c289fc8e Improve formatting performance by having better primitives on PSObject (#8785)
By not doing excessive amounts of extra work, formatting can be sped up quite significantly (about 8x faster).
The main change comes from adding new, more efficient, primitive to query an object for the existence of an instance member.
The formatting system has been checking for if an object has properties other than some decorated properties added by PS remoting, and it doesn't this by retrieving all properties which results in heavy allocations and wasted cycles.
By adding `GetFirstOrDefault` to `PSObject` and similar primitives to the underlying Adapters, we are able to return early, without having to get all properties back.
2019-03-20 18:43:52 -07:00
Dongbo Wang 24d3152f00 Make Start-Job throw terminating exception when -RunAs32 is specified in 64-bit pwsh (#9143) 2019-03-18 10:23:29 -07:00