Skip to content
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

PSEdit not saving remote files #1040

Closed
muzzar78 opened this issue Oct 1, 2017 · 5 comments
Closed

PSEdit not saving remote files #1040

muzzar78 opened this issue Oct 1, 2017 · 5 comments

Comments

@muzzar78
Copy link

muzzar78 commented Oct 1, 2017

@daviwil - Could this issue be related to the following?

// NOTE: The following two DidSaveTextDocument* types will
// be removed when #593 gets fixed.
export interface DidSaveTextDocumentParams {
/**
* The document that was closed.
*/
textDocument: TextDocumentIdentifier;
}
export namespace DidSaveTextDocumentNotification {
export const type = new NotificationType<DidSaveTextDocumentParams, void>('textDocument/didSave');
}

When I remote into a server within the integrated terminal, run psedit the file appears in VSCode. However, when I make an edit and save the file the changes aren't getting saved back to the remote server. I have attached the verbose log output. https://github.com/PowerShell/vscode-powershell/files/1309888/vscode-powershell-psedit.zip

@djobin
Copy link

djobin commented Oct 11, 2017

Hi!
I see the same behaviour... except, I can remotely edit .ps1 files and it gets commited back to the remote server, BUT when editing other file types (.cmd, .txt, .log, etc.) it does not get synced back.

vs code : 1.17
ps extensions : 1.4.3

@muzzar78
Copy link
Author

Hi,
I can confirm the behaviour I'm seeing is the same as @djobin. Saving ps1 files do get committed back to the remote host but other extensions don't.

@muzzar78
Copy link
Author

Here is the logic - it checks if the languageId is powershell.

private isDocumentRemote(doc: vscode.TextDocument) {
return doc.languageId === "powershell" &&
doc.fileName.toLowerCase().startsWith(this.tempSessionPathPrefix);
}

So the workaround is to set the language mode to PowerShell regardless of the extension of the remote file and then the remote save works. I have tested this and it worked for me.

@daviwil
Copy link
Contributor

daviwil commented Oct 25, 2017

Thanks for looking into this Adam! I'll take that check out.

@daviwil daviwil added this to the 1.5.0 milestone Oct 25, 2017
daviwil added a commit to daviwil/vscode-powershell that referenced this issue Oct 26, 2017
@daviwil daviwil added Issue-Bug A bug to squash. and removed Area-Debugging labels Oct 26, 2017
daviwil added a commit to daviwil/vscode-powershell that referenced this issue Oct 26, 2017
@OnurGumus
Copy link

This issue still exists if you use VSCode Powershell extension along with Powershell 7 for remote files.

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Sep 4, 2019
@SydneyhSmith SydneyhSmith removed the Needs: Maintainer Attention Maintainer attention needed! label Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants