Skip to content

Fix startup on empty workspace #1289

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
Show file tree
Hide file tree
Changes from all commits
Commits
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
40 changes: 40 additions & 0 deletions .vscode/snippets.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
// Place your PowerShellEditorServices workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
// Use https://snippet-generator.app/ to generate snippets
"Wait for debugger to be attached": {
"prefix": "WaitForDebugger",
"body": [
"while (!System.Diagnostics.Debugger.IsAttached)",
"{",
" System.Console.WriteLine(System.Diagnostics.Process.GetCurrentProcess().Id);",
" System.Threading.Thread.Sleep(2000);",
"}"
],
"description": "Wait for debugger to be attached"
},
"Copyright header": {
"prefix": "CopyrightHeader",
"body": [
"//",
"// Copyright (c) Microsoft. All rights reserved.",
"// Licensed under the MIT license. See LICENSE file in the project root for full license information.",
"//"
],
"description": "Copyright header"
}
}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## v2.2.0-preview.2
### Wednesday, May 06, 2020

- 🛫🐛 [PowerShellEditorServices #1289](https://github.com/PowerShell/PowerShellEditorServices/pull/1289) -
Fix startup on empty workspaces.
- 🛫🐛 [PowerShellEditorServices #1285](https://github.com/PowerShell/PowerShellEditorServices/pull/1285) -
Use API on ScriptBlock to generate PSCommand to run in ConstrainedLanguage mode.
- ⚡️🧠 [PowerShellEditorServices #1283](https://github.com/PowerShell/PowerShellEditorServices/pull/1283) -
Expand Down
2 changes: 1 addition & 1 deletion src/PowerShellEditorServices/Server/PsesLanguageServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public async Task StartAsync()
{
workspaceService.WorkspacePath = request.RootUri.GetFileSystemPath();
}
else
else if (request.WorkspaceFolders != null)
{
// If RootUri isn't set, try to use the first WorkspaceFolder.
// TODO: Support multi-workspace.
Expand Down