diff --git a/CHANGELOG.md b/CHANGELOG.md index 753dc07ee..e45039eda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ Fix intellisense and `F5` not working after debugging. - 🐛🧰 [vscode-PowerShell #2495](https://github.com/PowerShell/PowerShellEditorServices/pull/1211) - Fix PowerShellEditorServices.Commands module commands not working due to types being moved. +- 🐛👮 [vscode-PowerShell #2516](https://github.com/PowerShell/PowerShellEditorServices/pull/1216) - + Fix CommentHelp for when a function has other problems with it. ## v2.0.0-preview.9 ### Thursday, February 20, 2020 diff --git a/src/PowerShellEditorServices/Services/Analysis/AnalysisService.cs b/src/PowerShellEditorServices/Services/Analysis/AnalysisService.cs index 873a269f9..ef7979e55 100644 --- a/src/PowerShellEditorServices/Services/Analysis/AnalysisService.cs +++ b/src/PowerShellEditorServices/Services/Analysis/AnalysisService.cs @@ -490,8 +490,8 @@ private static Hashtable GetCommentHelpRuleSettings(string helpLocation, bool fo { "BlockComment", forBlockComment }, { "VSCodeSnippetCorrection", true }, { "Placement", helpLocation }} - }} - }}; + }}}, + { "IncludeRules", "PSProvideCommentHelp" }}; } #region IDisposable Support @@ -505,7 +505,7 @@ protected virtual void Dispose(bool disposing) { if (_analysisEngineLazy != null && _analysisEngineLazy.IsValueCreated) - { + { _analysisEngineLazy.Value.Dispose(); } diff --git a/test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs b/test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs index 4774ed6d0..0c1e4afe7 100644 --- a/test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs +++ b/test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs @@ -809,9 +809,13 @@ public async Task CanSendGetCommentHelpRequest() string scriptPath = NewTestFile(@" function CanSendGetCommentHelpRequest { param( - [string] - $myParam + $myParam, + $myOtherParam, + $yetAnotherParam ) + + # Include other problematic code to make sure this still works + gci } ");