Skip to content

Commit 6819cdc

Browse files
authored
Merge pull request #368 from PowerShell/daviwil/minor-fixes
Various fixes for 0.8.0
2 parents 657446d + 9c1a6a5 commit 6819cdc

File tree

4 files changed

+44
-27
lines changed

4 files changed

+44
-27
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ that Visual Studio Code provides.
1010

1111
- **Windows 7 through 10** with PowerShell v3 and higher
1212
- **Linux** with PowerShell v6 (all PowerShell-supported distribtions)
13-
- **Mac OS X** with PowerShell v6
13+
- **macOS and OS X** with PowerShell v6
1414

1515
Read the [installation instructions](https://github.com/PowerShell/PowerShell/blob/master/docs/learning-powershell/using-vscode.md)
1616
to get more details on how to use the extension on these platforms.
@@ -67,7 +67,7 @@ Restart Visual Studio Code and try to reproduce the problem. Once you are done
6767
that, zip up the logs in the corresponding folder for your operating system:
6868

6969
- **Windows**: `$HOME\.vscode\extensions\ms-vscode.PowerShell-<CURRENT VERSION>\logs`
70-
- **Linux and Mac OS X**: `~/.vscode/extensions/ms-vscode.PowerShell-<CURRENT VERSION>/logs`
70+
- **Linux and macOS**: `~/.vscode/extensions/ms-vscode.PowerShell-<CURRENT VERSION>/logs`
7171

7272
You have two options for sending us the logs:
7373

docs/troubleshooting.md

+32-13
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,34 @@
33
This document contains troubleshooting steps for commonly reported issues when using the
44
PowerShell extension for Visual Studio Code.
55

6-
## Mac OS X
6+
## Windows
7+
8+
### 1. IntelliSense is extremely slow on PowerShell 5.0
9+
10+
There is a known issue with PowerShell 5.0 which, for a small number of users, causes IntelliSense
11+
(code completions) to return after 5-15 seconds. The following steps *might* resolve the issue for you:
12+
13+
1. In a PowerShell console, run the following command: `Remove-Item -Force -Recurse $env:LOCALAPPDATA\Microsoft\Windows\PowerShell\CommandAnalysis`
14+
2. Restart Visual Studio Code and try getting IntelliSense again.
15+
16+
This issue has been resolved in PowerShell 5.1.
17+
18+
## macOS (OS X)
719

820
### 1. PowerShell IntelliSense does not work, can't debug scripts
921

10-
The most common problem when the PowerShell extension doesn't work on Mac OS X is that
22+
The most common problem when the PowerShell extension doesn't work on macOS is that
1123
OpenSSL is not installed. You can check for the installation of OpenSSL by looking for
12-
the following two files:
24+
the following files:
25+
26+
If installed using Homebrew:
27+
28+
```
29+
/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
30+
/usr/local/opt/openssl/lib/libssl.1.0.0.dylib
31+
```
32+
33+
If installed by some other means:
1334

1435
```
1536
/usr/local/lib/libcrypto.1.0.0.dylib
@@ -21,17 +42,15 @@ do not have OpenSSL installed.
2142

2243
#### Installing OpenSSL via Homebrew
2344

24-
You can use [Homebrew](http://brew.sh) to easily install OpenSSL. First, install Homebrew and then run the following command:
45+
We **highly recommend** that you use [Homebrew](http://brew.sh) to install OpenSSL. The PowerShell distribution for macOS
46+
has built-in support for Homebrew's OpenSSL library paths. If you install with Homebrew, you will avoid
47+
[security concerns](https://github.com/PowerShell/PowerShell/blob/master/docs/installation/linux.md#openssl)
48+
around creating symbolic links in your `/usr/local/lib` path which are needed when using other means of installation.
2549

26-
```
27-
brew install openssl
28-
```
29-
30-
After installation, the libraries of interest must be symlinked to `/usr/local/lib`; e.g. (note that /usr/local/lib may not already exist and may need to be created before symlinking):
50+
First, install Homebrew and then run the following command:
3151

3252
```
33-
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/libcrypto.1.0.0.dylib
34-
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/libssl.1.0.0.dylib
53+
brew install openssl
3554
```
3655

3756
Restart VS Code after completing the installation and verify that the extension is working correctly.
@@ -47,8 +66,8 @@ sudo port install openssl
4766
You will need to take an additional step once installation completes:
4867

4968
```
50-
sudo ln -s /opt/local/lib/libcrypto.1.0.0.dylib /usr/local/lib/
51-
sudo ln -s /opt/local/lib/libssl.1.0.0.dylib /usr/local/lib/
69+
sudo ln -s /opt/local/lib/libcrypto.1.0.0.dylib /usr/local/lib/libcrypto.1.0.0.dylib
70+
sudo ln -s /opt/local/lib/libssl.1.0.0.dylib /usr/local/lib/libssl.1.0.0.dylib
5271
```
5372

5473
Thanks to [@MarlonRodriguez](https://github.com/MarlonRodriguez) for the tip!

src/features/Console.ts

+3-8
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ export class ConsoleFeature implements IFeature {
172172
this.languageClient.sendRequest(EvaluateRequest.type, {
173173
expression: editor.document.getText(selectionRange)
174174
});
175+
176+
// Show the output window if it isn't already visible
177+
this.consoleChannel.show(vscode.ViewColumn.Three);
175178
});
176179

177180
this.consoleChannel = vscode.window.createOutputChannel("PowerShell Output");
@@ -189,14 +192,6 @@ export class ConsoleFeature implements IFeature {
189192
promptDetails => showInputPrompt(promptDetails, this.languageClient));
190193

191194
this.languageClient.onNotification(OutputNotification.type, (output) => {
192-
var outputEditorExist = vscode.window.visibleTextEditors.some((editor) => {
193-
return editor.document.languageId == 'Log'
194-
});
195-
196-
if (!outputEditorExist) {
197-
this.consoleChannel.show(vscode.ViewColumn.Three);
198-
}
199-
200195
this.consoleChannel.append(output.output);
201196
});
202197
}

src/session.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -454,12 +454,15 @@ export class SessionManager {
454454
else if (os.platform() == "darwin") {
455455
powerShellExePath = "/usr/local/bin/powershell";
456456

457-
// Check for OpenSSL dependency on OS X
458-
if (!utils.checkIfFileExists("/usr/local/lib/libcrypto.1.0.0.dylib") ||
459-
!utils.checkIfFileExists("/usr/local/lib/libssl.1.0.0.dylib")) {
457+
// Check for OpenSSL dependency on macOS. Look for the default Homebrew installation
458+
// path and if that fails check the system-wide library path.
459+
if (!(utils.checkIfFileExists("/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib") &&
460+
utils.checkIfFileExists("/usr/local/opt/openssl/lib/libssl.1.0.0.dylib")) &&
461+
!(utils.checkIfFileExists("/usr/local/lib/libcrypto.1.0.0.dylib") &&
462+
utils.checkIfFileExists("/usr/local/lib/libssl.1.0.0.dylib"))) {
460463
var thenable =
461464
vscode.window.showWarningMessage(
462-
"The PowerShell extension will not work without OpenSSL on Mac OS X",
465+
"The PowerShell extension will not work without OpenSSL on macOS and OS X",
463466
"Show Documentation");
464467

465468
thenable.then(

0 commit comments

Comments
 (0)