vscode-zap
Advanced tools
Comparing version 0.0.87 to 0.0.88
@@ -19,3 +19,3 @@ "use strict"; | ||
open(resource) { | ||
return vscode_1.commands.executeCommand("vscode.open", resource.uri); | ||
return vscode_1.commands.executeCommand("vscode.diff", resource.uri.with({ query: resource.uri.query + "~0" }), resource.uri); | ||
} | ||
@@ -39,3 +39,3 @@ getOriginalResource(uri) { | ||
for (const f of op.create) { | ||
this._resources.set(f, new Resource(resourcePath(f), false)); | ||
this._resources.set(workspace_1.stripFileOrBufferPathPrefix(f), new Resource(resourcePath(f), false)); | ||
} | ||
@@ -45,3 +45,3 @@ } | ||
for (const f of op.delete) { | ||
this._resources.set(f, new Resource(resourcePath(f), true)); | ||
this._resources.set(workspace_1.stripFileOrBufferPathPrefix(f), new Resource(resourcePath(f), true)); | ||
} | ||
@@ -51,3 +51,3 @@ } | ||
for (const f of Object.keys(op.edit)) { | ||
this._resources.set(f, new Resource(resourcePath(f), false)); | ||
this._resources.set(workspace_1.stripFileOrBufferPathPrefix(f), new Resource(resourcePath(f), false)); | ||
} | ||
@@ -57,3 +57,3 @@ } | ||
for (const f of op.truncate) { | ||
this._resources.set(f, new Resource(resourcePath(f), false)); | ||
this._resources.set(workspace_1.stripFileOrBufferPathPrefix(f), new Resource(resourcePath(f), false)); | ||
} | ||
@@ -60,0 +60,0 @@ } |
@@ -456,3 +456,4 @@ "use strict"; | ||
const changes = this.pendingWorkspaceFileEdits[`/${fileName}`]; | ||
if (this.pendingWorkspaceFileEdits[`/${fileName}`]) { | ||
delete this.pendingWorkspaceFileEdits[`/${fileName}`]; | ||
if (changes) { | ||
const edit = op_1.resolvePendingEditOpsToWorkspaceEdit(doc, changes); | ||
@@ -465,3 +466,2 @@ if (edit && edit.entries().length > 0) { | ||
yield vscode.workspace.applyEdit(edit); | ||
delete this.pendingWorkspaceFileEdits[`/${fileName}`]; | ||
} | ||
@@ -468,0 +468,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"description": "Real-time code synchronization", | ||
"version": "0.0.87", | ||
"version": "0.0.88", | ||
"publisher": "sqs", | ||
@@ -42,3 +42,3 @@ "preview": true, | ||
"dependencies": { | ||
"libzap": "^0.0.87", | ||
"libzap": "^0.0.88", | ||
"open": "^0.0.5", | ||
@@ -45,0 +45,0 @@ "vscode-jsonrpc": "3.0.1-alpha.7" |
import { scm, commands, workspace, Uri, Disposable, SCMProvider, SCMResourceGroup, Event, EventEmitter, SCMResource, SCMResourceDecorations, ProviderResult } from "vscode"; | ||
import { WorkspaceOp, stripFileOrBufferPathPrefix } from "libzap/lib/ot/workspace"; | ||
import { WorkspaceOp, stripFileOrBufferPathPrefix as stripPathPrefix } from "libzap/lib/ot/workspace"; | ||
@@ -26,3 +26,3 @@ export class ZapSCMProvider implements SCMProvider { | ||
open(resource: Resource): ProviderResult<void> { | ||
return commands.executeCommand<void>("vscode.open", resource.uri); | ||
return commands.executeCommand<void>("vscode.diff", resource.uri.with({ query: resource.uri.query + "~0" }), resource.uri); | ||
} | ||
@@ -51,3 +51,3 @@ | ||
for (const f of op.create) { | ||
this._resources.set(f, new Resource(resourcePath(f), false)); | ||
this._resources.set(stripPathPrefix(f), new Resource(resourcePath(f), false)); | ||
} | ||
@@ -57,3 +57,3 @@ } | ||
for (const f of op.delete) { | ||
this._resources.set(f, new Resource(resourcePath(f), true)); | ||
this._resources.set(stripPathPrefix(f), new Resource(resourcePath(f), true)); | ||
} | ||
@@ -63,3 +63,3 @@ } | ||
for (const f of Object.keys(op.edit)) { | ||
this._resources.set(f, new Resource(resourcePath(f), false)); | ||
this._resources.set(stripPathPrefix(f), new Resource(resourcePath(f), false)); | ||
} | ||
@@ -69,3 +69,3 @@ } | ||
for (const f of op.truncate) { | ||
this._resources.set(f, new Resource(resourcePath(f), false)); | ||
this._resources.set(stripPathPrefix(f), new Resource(resourcePath(f), false)); | ||
} | ||
@@ -112,3 +112,3 @@ } | ||
function resourcePath(f: string): Uri { | ||
return Uri.parse(`${workspace.rootPath}#${stripFileOrBufferPathPrefix(f)}`); | ||
return Uri.parse(`${workspace.rootPath}#${stripPathPrefix(f)}`); | ||
} |
@@ -494,3 +494,4 @@ import * as vscode from "vscode"; | ||
const changes = this.pendingWorkspaceFileEdits[`/${fileName}`]; | ||
if (this.pendingWorkspaceFileEdits[`/${fileName}`]) { | ||
delete this.pendingWorkspaceFileEdits[`/${fileName}`]; | ||
if (changes) { | ||
const edit = resolvePendingEditOpsToWorkspaceEdit(doc, changes); | ||
@@ -503,3 +504,2 @@ if (edit && edit.entries().length > 0) { | ||
await vscode.workspace.applyEdit(edit); | ||
delete this.pendingWorkspaceFileEdits[`/${fileName}`]; | ||
} | ||
@@ -506,0 +506,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
483049
72
+ Addedlibzap@0.0.88(transitive)
- Removedlibzap@0.0.87(transitive)
Updatedlibzap@^0.0.88