Skip to content

Commit 5489cf1

Browse files
authored
Gathered nb's from py don't show original file. (#8374)
1 parent ef6d780 commit 5489cf1

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/client/datascience/gather/gatherListener.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { IConfigurationService } from '../../common/types';
88
import * as localize from '../../common/utils/localize';
99
import { noop } from '../../common/utils/misc';
1010
import { generateCellsFromString } from '../cellFactory';
11+
import { Identifiers } from '../constants';
1112
import { IInteractiveWindowMapping, InteractiveWindowMessages } from '../interactive-common/interactiveWindowTypes';
1213
import { ICell, IGatherExecution, IInteractiveWindowListener, IInteractiveWindowProvider, IJupyterExecution, INotebook, INotebookEditorProvider, INotebookExporter } from '../types';
1314
import { GatherLogger } from './gatherLogger';
@@ -102,11 +103,11 @@ export class GatherListener implements IInteractiveWindowListener {
102103
if (this.configService.getSettings().datascience.gatherToScript) {
103104
await this.showFile(slicedProgram, cell.file);
104105
} else {
105-
await this.showNotebook(slicedProgram);
106+
await this.showNotebook(slicedProgram, cell);
106107
}
107108
}
108109

109-
private async showNotebook(slicedProgram: string) {
110+
private async showNotebook(slicedProgram: string, cell: ICell) {
110111
if (slicedProgram) {
111112
let cells: ICell[] = [{
112113
id: uuid(),
@@ -115,7 +116,7 @@ export class GatherListener implements IInteractiveWindowListener {
115116
state: 0,
116117
data: {
117118
cell_type: 'markdown',
118-
source: localize.DataScience.gatheredNotebookDescriptionInMarkdown().format(this.notebookUri.fsPath),
119+
source: localize.DataScience.gatheredNotebookDescriptionInMarkdown().format(cell.file === Identifiers.EmptyFileName ? this.notebookUri.fsPath : cell.file),
119120
metadata: {}
120121
}
121122
}];

0 commit comments

Comments
 (0)