vscode-powershell icon indicating copy to clipboard operation
vscode-powershell copied to clipboard

Code formatting causes cursor to jump to EOF

Open Cirzen opened this issue 8 years ago • 27 comments

I have my formatting style set to Allman. If I start typing something, e.g. a function, or a process block and put the open-brace at the end of the line, when the formatter kicks in and moves it to the next line, the cursor also jumps to the last line of the file. Here's a screen grab of what happens. formatter

Disabling the add-in resolves the issue

System Details

  • Operating system name and version: Win 10 1709
  • VS Code version: 1.26.1 493869ee8e8a846b0855873886fc79d480d342de x64
  • PowerShell extension version: 1.8.3
  • Output from $PSVersionTable: Name Value

PSVersion 6.1.0-preview.1 PSEdition Core GitCommitId v6.1.0-preview.1 OS Microsoft Windows 10.0.16299 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0

Issue Description

I am experiencing a problem with...

Attached Logs

EditorServices.zip Follow the instructions in the [README](https://github.com/PowerShell/vscode-powershell#reporting-problems

) about capturing and sending logs.

Cirzen avatar Aug 31 '18 15:08 Cirzen

If you've got a reproducible situation where it happens every time then that sounds incredibly useful!

andrewducker avatar Jun 15 '19 09:06 andrewducker

As a matter of fact, it's happening right now as I'm playing with some stuff. Should I share the recording?

lokwaniyash avatar Jun 15 '19 09:06 lokwaniyash

Does it still do it if you disable the PowerShell extension? Because if it's HTML then I'd expect it's not the extension doing it. Worth a test!

andrewducker avatar Jun 15 '19 09:06 andrewducker

I don't even have it installed.

lokwaniyash avatar Jun 15 '19 10:06 lokwaniyash

In that case, presumably not a plugin issue, but a VS Code issue.

andrewducker avatar Jun 15 '19 10:06 andrewducker

Have the same issue on one of my JS files. It has in total 4430 lines of code

ghost avatar Nov 26 '22 13:11 ghost

This issue was for a bug in the PowerShell extension, solved a good while ago. Issues with HTML and JS files need to be filed with their respective extensions, thank you!

andyleejordan avatar Nov 28 '22 20:11 andyleejordan