Vscode-powershell: I cannot press enter in PowerShell files after Code 1.22.2 update

Created on 13 Apr 2018  路  10Comments  路  Source: PowerShell/vscode-powershell

System Details

  • Operating system name and version: Windows 10 v1709
  • VS Code version: 1.22.2
  • PowerShell extension version: 1.6.0
  • Output from $PSVersionTable:
1.22.2
3aeede733d9a3098f7b4bdc1f66b63b0f48c1ef9
ia32

Major  Minor  Build  Revision
-----  -----  -----  --------
1      6      0      0


[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]


Name                           Value
----                           -----
PSVersion                      5.1.16299.251
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.16299.251
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

After update to Code 1.22.2, the PowerShell extension does not let me press enter in some situations. The newline appears but focus returns to the previous line.

See https://youtu.be/Yql5mJbVHsk for demo.

Problem disappears if I disable PowerShell extension. I am unsure if I tried this scenario with 1.22.x earlier versions but certainly it worked a month ago.

Attached Logs

EditorServices.log
vscode-powershell.log

Area-Code Formatting Issue-Bug

All 10 comments

I don't have that issue.

  • VS Code 1.22.2,
  • PowerShell 1.6.0
  • Windows 10 Enterprise 1803
  • OS Build 17133.73

Here is my settings file, for reference, in case there is some connection here:

{
    "files.autoSave": "afterDelay",
    "editor.wordWrap": "on",
    "editor.tabSize": 4,
    "editor.wrappingIndent": "none",
    "editor.minimap.enabled": false,
    "editor.find.seedSearchStringFromSelection": false,
    "editor.find.autoFindInSelection": true,
    "editor.formatOnType": true,
    "editor.formatOnPaste": true,
    "window.reopenFolders": "none",
    "files.trimTrailingWhitespace": true,
    "search.useIgnoreFilesByDefault": true,
    "powershell.integratedConsole.showOnStartup": false,
    "eslint.enable": true,
    "git.confirmSync": false,
    "workbench.colorTheme": "Visual Studio Light",
    "plantuml.exportSubFolder": false,
    "plantuml.exportFormat": "png",
    "git.enableSmartCommit": true,
    "workbench.welcome.enabled": false,
    "extensions.ignoreRecommendations": false,
    "window.zoomLevel": 0,
    "git.autofetch": true
}
{
    "vsicons.dontShowNewVersionMessage": true,
    "team.showWelcomeMessage": false,
    "html.format.wrapLineLength": 0,
    "sync.gist": "",
    "sync.lastUpload": "",
    "sync.autoDownload": false,
    "sync.autoUpload": false,
    "sync.lastDownload": "",
    "sync.forceDownload": false,
    "sync.anonymousGist": false,
    "sync.host": "",
    "sync.pathPrefix": "",
    "sync.quietSync": false,
    "sync.askGistName": false,
    "workbench.activityBar.visible": true,
    "workbench.statusBar.visible": true,
    "window.menuBarVisibility": "default",
    "window.zoomLevel": 0,
    "powershell.powerShellExePath": "C:\\WINDOWS\\SysWow64\\WindowsPowerShell\\v1.0\\powershell.exe",
}

Here's mine. I would say you need to check if you remove editor.formatOnType/.formatOnPaste.

This seems to have some dependency on the file contents. By randomly changing parts of the file, I can get the effect to disappear. It is pretty hard to narrow it down - deleting random lines in various parts of the file just magically fixes it.

I am finding it hard to nail down a repro given the erratic behavior. Is there some way I can submit my project files privately for investigation?

Glad you're not totally blocked. It's sounding like it could be related to https://github.com/PowerShell/vscode-powershell/issues/1154

Which could be related to ScriptAnalyzer being run in the background.

You can email sensitive data to [email protected] this will only go to Microsoft employees.

Great. Sent you a file to repro this with.

I notice that the problem does not occur if I press enter before the "0 references" lines appear in the editor.

I also noticed what might be laggy undo actions while experimenting but it seemed too random to be able to say anything for sure. Just felt that undo sometimes took some hundreds of milliseconds to do its work.

@sandersaares Can you disable the format on type and format on paste features in your settings and see if you still see the issue?

The issue stops occurring if I disable the format on type feature.

Thanks for the info! We'll take a look. @ramya-rao-a thanks for offering the suggestion 馃憤

@sandersaares I got your email! Thanks!

Seems like our formatting isn't as good as it should be for "format on type".

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MiYanni picture MiYanni  路  3Comments

guidooliveira picture guidooliveira  路  3Comments

bgelens picture bgelens  路  3Comments

timoline picture timoline  路  3Comments

daviwil picture daviwil  路  4Comments