kbrose / vsc-python-indent

Correctly indent python code on the fly, in Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=KevinRose.vsc-python-indent
MIT License
82 stars 19 forks source link

Extreme lag from pressing Enter to action when extension is running in remote (ssh) host. #91

Closed picrots closed 2 years ago

picrots commented 2 years ago

Due to network speed or load on the remote host machine sometimes I experience huge delays from when I press the Enter key until I see the cursor move. It can get up to 10 sec sometimes and there is noting more annoying than typing unresponsiveness.

I guess my question is that does the extension have to run on the remote site or it can achieve the same result running locally? If it can't be run locally, then is it possible to have a timeout of max one second (or maybe adjustable via settings) for remote host to respond and if it doesn't respond it just run normal Enter?

kbrose commented 2 years ago

Hey @picrots, I'm sorry to hear you're experiencing bad typing lag. I have not experimented with having the extension run locally vs remotely (but I'm guessing the default is to run it locally).

Luckily, it seems like there is a quick way to force an extension to run on the host? You will need to add the following to your settings:

    "remote.extensionKind": {
        "KevinRose.vsc-python-indent": [
            "ui"
        ]
    }

Can you try that and reply here to see if that helps?

(Edited this comment because I had things exactly backwards with respect to local vs remote)

picrots commented 2 years ago

Brilliant! @kbrose your suggested solution worked perfectly and my lag is now disappeared. Thank you very much. I close the issue.

etse1288 commented 2 years ago

thanks, it works for me, too!

kbrose commented 2 years ago

FYI This behavior (preferring to run on the remote host) is now the default.

etse1288 commented 2 years ago

so i can remove the setting from my settings.json now?

kbrose commented 2 years ago

If you're using version 1.18 or later, yes. Keeping what you had in the settings should also continue to work, though.