Skip to content

Commit 8fe3a16

Browse files
author
Diler Zaza
committed
Add document URI check for save telemetry
1 parent 6fead6e commit 8fe3a16

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

packages/core/src/stepFunctions/workflowStudio/workflowStudioEditor.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,18 @@ export class WorkflowStudioEditor {
147147

148148
// The text document acts as our model, thus we send and event to the webview on file save to trigger update
149149
contextObject.disposables.push(
150-
vscode.workspace.onDidSaveTextDocument(async () => {
151-
await telemetry.stepfunctions_saveFile.run(async (span) => {
152-
span.record({
153-
id: contextObject.fileId,
154-
saveType: 'MANUAL_SAVE',
155-
source: 'VSCODE',
156-
isInvalidJson: isInvalidJsonFile(contextObject.textDocument),
150+
vscode.workspace.onDidSaveTextDocument(async (savedDocument) => {
151+
if (savedDocument.uri.toString() === this.documentUri.toString()) {
152+
await telemetry.stepfunctions_saveFile.run(async (span) => {
153+
span.record({
154+
id: contextObject.fileId,
155+
saveType: 'MANUAL_SAVE',
156+
source: 'VSCODE',
157+
isInvalidJson: isInvalidJsonFile(contextObject.textDocument),
158+
})
159+
await broadcastFileChange(contextObject, 'MANUAL_SAVE')
157160
})
158-
await broadcastFileChange(contextObject, 'MANUAL_SAVE')
159-
})
161+
}
160162
})
161163
)
162164

0 commit comments

Comments
 (0)