GeezerVison is showing github.com — Fix Gather and update py analysis (#7539) · iserko/vscode-python@51cdc7e
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: build/ci/postInstall.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -14,7 +14,7 @@ var constants_1 = require("../constants"); | 14 | 14 | * The solution is to modify the type definition file after `npm install`. | 15 | 15 | */ | 16 | 16 | function fixJupyterLabDTSFiles() { | 17 | | - var relativePath = path.join('node_modules', '@jupyterlab', 'services', 'node_modules', '@jupyterlab', 'coreutils', 'lib', 'settingregistry.d.ts'); | | 17 | + var relativePath = path.join('node_modules', '@jupyterlab', 'coreutils', 'lib', 'settingregistry.d.ts'); | 18 | 18 | var filePath = path.join(constants_1.ExtensionRootDir, relativePath); | 19 | 19 | if (!fs.existsSync(filePath)) { | 20 | 20 | throw new Error("Type Definition file from JupyterLab not found '" + filePath + "' (pvsc post install script)"); | |
Collapse file Copy file name to clipboardExpand all lines: package-lock.json +413-405Lines changed: 413 additions & 405 deletions Collapse file Copy file name to clipboardExpand all lines: package.datascience-ui.dependencies.json -2Lines changed: 0 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 43 | 43 | "replace-ext", | 44 | 44 | "resize-observer-polyfill", | 45 | 45 | "scheduler", | 46 | | - "tslib", | 47 | 46 | "warning", | 48 | 47 | "character-entities-legacy", | 49 | 48 | "character-reference-invalid", | | 86 | 85 | "escape-carriage", | 87 | 86 | "extend", | 88 | 87 | "fast-plist", | 89 | | - "fbjs", | 90 | 88 | "inherits", | 91 | 89 | "is-alphabetical", | 92 | 90 | "is-alphanumerical", | |
Collapse file Copy file name to clipboardExpand all lines: package.json +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 2599 | 2599 | }, | 2600 | 2600 | "dependencies": { | 2601 | 2601 | "@jupyterlab/services": "^3.2.1", | 2602 | | - "@msrvida/python-program-analysis": "0.0.5", | | 2602 | + "@msrvida/python-program-analysis": "^0.2.6", | | 2603 | + "@blueprintjs/select": "3.10.0", | 2603 | 2604 | "ansi-regex": "^4.1.0", | 2604 | 2605 | "arch": "^2.1.0", | 2605 | 2606 | "azure-storage": "^2.10.3", | |
Collapse file Copy file name to clipboardExpand all lines: pythonFiles/datascience/getJupyterVariableDataFrameInfo.py -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -# %DATASCIENCE_INTERNAL_KEY% | 2 | 1 | # Query Jupyter server for the info about a dataframe | 3 | 2 | import json as _VSCODE_json | 4 | 3 | import pandas as _VSCODE_pd | |
Collapse file Copy file name to clipboardExpand all lines: pythonFiles/datascience/getJupyterVariableDataFrameRows.py -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -#%DATASCIENCE_INTERNAL_KEY%# | 2 | 1 | # Query Jupyter server for the rows of a data frame | 3 | 2 | import json as _VSCODE_json | 4 | 3 | import pandas as _VSCODE_pd | |
Collapse file Copy file name to clipboardExpand all lines: pythonFiles/datascience/getJupyterVariableList.py -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -#%DATASCIENCE_INTERNAL_KEY%# | 2 | 1 | # Query Jupyter server for defined variables list | 3 | 2 | # Tested on 2.7 and 3.6 | 4 | 3 | from sys import getsizeof as _VSCODE_getsizeof | |
Collapse file Copy file name to clipboardExpand all lines: pythonFiles/datascience/getJupyterVariableValue.py -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -#%DATASCIENCE_INTERNAL_KEY%# | 2 | 1 | import sys as VC_sys | 3 | 2 | import locale as VC_locale | 4 | 3 |
| |
Collapse file Copy file name to clipboardExpand all lines: pythonFiles/datascience/getServerInfo.py -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -#%DATASCIENCE_INTERNAL_KEY%# | 2 | 1 | # Copyright (c) Microsoft Corporation. All rights reserved. | 3 | 2 | # Licensed under the MIT License. | 4 | 3 |
| |
Collapse file Copy file name to clipboardExpand all lines: src/client/datascience/gather/gather.ts +12-14Lines changed: 12 additions & 14 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import { DataflowAnalyzer } from '@msrvida/python-program-analysis'; | 2 | | -import { JupyterCell as ICell, LabCell } from '@msrvida/python-program-analysis/lib/cell'; | 3 | | -import { CellSlice } from '@msrvida/python-program-analysis/lib/cellslice'; | 4 | | -import { ExecutionLogSlicer } from '@msrvida/python-program-analysis/lib/log-slicer'; | | 2 | +import { Cell as ICell, LogCell } from '@msrvida/python-program-analysis/dist/es5/cell'; | | 3 | +import { CellSlice } from '@msrvida/python-program-analysis/dist/es5/cellslice'; | | 4 | +import { ExecutionLogSlicer } from '@msrvida/python-program-analysis/dist/es5/log-slicer'; | 5 | 5 |
| 6 | 6 | import { inject, injectable } from 'inversify'; | 7 | 7 | // tslint:disable-next-line: no-require-imports | @@ -15,7 +15,7 @@ import { Common } from '../../common/utils/localize'; | 15 | 15 | import { noop } from '../../common/utils/misc'; | 16 | 16 | import { CellMatcher } from '../cellMatcher'; | 17 | 17 | import { concatMultilineString } from '../common'; | 18 | | -import { CellState, ICell as IVscCell, IGatherExecution, INotebookExecutionLogger, internalUseCellKey } from '../types'; | | 18 | +import { CellState, ICell as IVscCell, IGatherExecution, INotebookExecutionLogger } from '../types'; | 19 | 19 |
| 20 | 20 | /** | 21 | 21 | * An adapter class to wrap the code gathering functionality from [microsoft/python-program-analysis](https://www.npmjs.com/package/@msrvida/python-program-analysis). | @@ -34,11 +34,10 @@ export class GatherExecution implements IGatherExecution, INotebookExecutionLogg | 34 | 34 | ) { | 35 | 35 | this._enabled = this.configService.getSettings().datascience.enableGather ? true : false; | 36 | 36 |
| 37 | | - const rules = this.configService.getSettings().datascience.gatherRules; | 38 | | - this.dataflowAnalyzer = new DataflowAnalyzer(rules); | | 37 | + this.dataflowAnalyzer = new DataflowAnalyzer(); | 39 | 38 | this._executionSlicer = new ExecutionLogSlicer(this.dataflowAnalyzer); | 40 | 39 |
| 41 | | - if (this.enabled) { | | 40 | + if (this._enabled) { | 42 | 41 | this.disposables.push(this.configService.getSettings().onDidChange(e => this.updateEnableGather(e))); | 43 | 42 | } | 44 | 43 |
| @@ -51,9 +50,10 @@ export class GatherExecution implements IGatherExecution, INotebookExecutionLogg | 51 | 50 | } | 52 | 51 |
| 53 | 52 | public async postExecute(vscCell: IVscCell, _silent: boolean): Promise<void> { | 54 | | - if (this.enabled) { | 55 | | - // Don't log if vscCell.data.source is an empty string. Original Jupyter extension also does this. | 56 | | - if (vscCell.data.source !== '') { | | 53 | + if (this._enabled) { | | 54 | + // Don't log if vscCell.data.source is an empty string or if it was | | 55 | + // silently executed. Original Jupyter extension also does this. | | 56 | + if (vscCell.data.source !== '' && !_silent) { | 57 | 57 | // First make a copy of this cell, as we are going to modify it | 58 | 58 | const cloneCell: IVscCell = cloneDeep(vscCell); | 59 | 59 |
| @@ -62,12 +62,10 @@ export class GatherExecution implements IGatherExecution, INotebookExecutionLogg | 62 | 62 | cloneCell.data.source = cellMatcher.stripFirstMarker(concatMultilineString(vscCell.data.source)); | 63 | 63 |
| 64 | 64 | // Convert IVscCell to IGatherCell | 65 | | - const cell = convertVscToGatherCell(cloneCell) as LabCell; | | 65 | + const cell = convertVscToGatherCell(cloneCell) as LogCell; | 66 | 66 |
| 67 | 67 | // Call internal logging method | 68 | | - if (!cloneCell.data.source.startsWith(internalUseCellKey)) { | 69 | | - this._executionSlicer.logExecution(cell); | 70 | | - } | | 68 | + this._executionSlicer.logExecution(cell); | 71 | 69 | } | 72 | 70 | } | 73 | 71 | } | |
|