Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into rchiodo/kernel_no_not…
Browse files Browse the repository at this point in the history
…ebooks_7
  • Loading branch information
rchiodo committed Jun 8, 2022
2 parents fd17b87 + cb7c2f3 commit 4a4e3db
Show file tree
Hide file tree
Showing 101 changed files with 376 additions and 346 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ module.exports = {
],
'react/jsx-uses-vars': 'error',
'react/jsx-uses-react': 'error',
'no-restricted-imports': ['error', { paths: ['lodash'] }],
'no-restricted-imports': ['error', { paths: ['lodash', 'rxjs'] }],
'import/no-restricted-paths': [
'error',
{
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ jobs:
- name: Verify Translation files
run: npm run validateTranslationFiles

- name: Validate npm dependencies
run: npm run validateDependencies

- name: Run linting on TypeScript code (eslint)
run: npm run lint

Expand Down
20 changes: 10 additions & 10 deletions TELEMETRY.md
Original file line number Diff line number Diff line change
Expand Up @@ -1545,7 +1545,7 @@ No properties for event

## Locations Used

[src/notebooks/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/execution/kernelExecution.ts)
[src/kernels/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/kernelExecution.ts)
```typescript
this.documentExecutions.set(document, newCellExecutionQueue);
return newCellExecutionQueue;
Expand Down Expand Up @@ -2689,7 +2689,7 @@ function resetData(resource: Resource, eventName: string, properties: any) {
```


[src/notebooks/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/execution/kernelExecution.ts)
[src/kernels/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/kernelExecution.ts)
```typescript
// Otherwise a real error occurred.
sendKernelTelemetryEvent(
Expand All @@ -2701,7 +2701,7 @@ function resetData(resource: Resource, eventName: string, properties: any) {
```


[src/notebooks/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/execution/kernelExecution.ts)
[src/kernels/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/kernelExecution.ts)
```typescript
})();

Expand Down Expand Up @@ -2805,7 +2805,7 @@ No properties for event
: this.start(new DisplayOptions(false)));
sendKernelTelemetryEvent(this.resourceUri, Telemetry.NotebookRestart, stopWatch.elapsedTime);
} catch (ex) {
traceError(`Restart failed ${getDisplayPath(this.id)}`, ex);
traceError(`Restart failed ${getDisplayPath(this.uri)}`, ex);
this._ignoreJupyterSessionDisposedErrors = true;
```

Expand Down Expand Up @@ -5238,7 +5238,7 @@ No properties for event

## Locations Used

[src/notebooks/execution/cellExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/execution/cellExecution.ts)
[src/kernels/execution/cellExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/cellExecution.ts)
```typescript
const props = { notebook: true };
if (!CellExecution.sentExecuteCellTelemetry) {
Expand Down Expand Up @@ -5281,7 +5281,7 @@ No properties for event

## Locations Used

[src/notebooks/execution/cellExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/execution/cellExecution.ts)
[src/kernels/execution/cellExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/cellExecution.ts)
```typescript
CellExecution.sentExecuteCellTelemetry = true;
sendTelemetryEvent(Telemetry.ExecuteCellPerceivedCold, this.stopWatchForTelemetry.elapsedTime, props);
Expand Down Expand Up @@ -5799,7 +5799,7 @@ No properties for event

## Locations Used

[src/notebooks/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/execution/kernelExecution.ts)
[src/kernels/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/kernelExecution.ts)
```typescript
return newCellExecutionQueue;
}
Expand Down Expand Up @@ -7995,7 +7995,7 @@ No properties for event

## Locations Used

[src/notebooks/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/execution/kernelExecution.ts)
[src/kernels/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/kernelExecution.ts)
```typescript
}

Expand Down Expand Up @@ -8023,7 +8023,7 @@ No properties for event

## Locations Used

[src/notebooks/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/execution/kernelExecution.ts)
[src/kernels/execution/kernelExecution.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/kernelExecution.ts)
```typescript
});
}
Expand Down Expand Up @@ -8671,7 +8671,7 @@ No description provided

## Locations Used

[src/notebooks/helpers.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/helpers.ts)
[src/kernels/execution/helpers.ts](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/execution/helpers.ts)
```typescript
// Unless we already know its an unknown output type.
const outputType: nbformat.OutputType =
Expand Down
2 changes: 1 addition & 1 deletion build/webpack/webpack.extension.web.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const config = {
}
]
},
externals: ['vscode', 'commonjs', 'electron'], // Don't bundle these
externals: ['vscode', 'commonjs', 'electron', 'moment'], // Don't bundle these
plugins: [
// Work around for Buffer is undefined:
new webpack.ProvidePlugin({
Expand Down
24 changes: 24 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,27 @@ gulp.task('validateTelemetryMD', async () => {
throw new Error('Telemetry MD is not valid, please re-run `npm run generateTelemetry`');
}
});

gulp.task('validateDependencies', async () => {
const packageLock = fs.readFileSync(path.join(__dirname, 'package-lock.json'), 'utf-8');
const dependencies = JSON.parse(packageLock).dependencies;
const modules = [];
Object.keys(dependencies).forEach((key) => {
const value = dependencies[key];
const requires = value.requires;

if (requires && requires['moment']) {
modules.push(key);
}
});

if (modules.length > 0) {
console.log(modules);
if (modules.length > 1 || modules[0] !== '@jupyterlab/coreutils') {
// we already validate that we are not using moment in @jupyterlab/coreutils
const message = `The following modules require moment: ${modules.join(', ')}. Please validate if moment is being used.`;
console.error(message);
throw new Error(message);
}
}
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2141,6 +2141,7 @@
"download-api": "vscode-dts dev",
"postdownload-api": "vscode-dts main",
"generateTelemetry": "gulp generateTelemetryMd",
"validateDependencies": "gulp validateDependencies",
"openInBrowser": "vscode-test-web --extensionDevelopmentPath=. ./src/test/datascience",
"startJupyterServer": "node build/preDebugWebTest.js",
"stopJupyterServer": "node build/postDebugWebTest.js",
Expand Down
3 changes: 1 addition & 2 deletions src/intellisense/cellLanguageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ import {
getLanguageInNotebookMetadata
} from '../kernels/helpers';
import { KernelConnectionMetadata } from '../kernels/types';
import { isJupyterNotebook, getNotebookMetadata } from '../notebooks/helpers';
import { translateKernelLanguageToMonaco } from '../platform/common/utils';
import { getNotebookMetadata, isJupyterNotebook, translateKernelLanguageToMonaco } from '../platform/common/utils';

export const LastSavedNotebookCellLanguage = 'DATASCIENCE.LAST_SAVED_CELL_LANGUAGE';
/**
Expand Down
4 changes: 2 additions & 2 deletions src/intellisense/diagnosticsProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import { PYTHON_LANGUAGE } from '../platform/common/constants';
import { disposeAllDisposables } from '../platform/common/helpers';
import { IDisposable, IDisposableRegistry } from '../platform/common/types';
import { DataScience } from '../platform/common/utils/localize';
import { JupyterNotebookView } from '../notebooks/constants';
import { getAssociatedJupyterNotebook } from '../notebooks/helpers';
import { JupyterNotebookView } from '../platform/common/constants';
import { getAssociatedJupyterNotebook } from '../platform/common/utils';

type CellUri = string;
type CellVersion = number;
Expand Down
5 changes: 2 additions & 3 deletions src/intellisense/emptyNotebookCellLanguageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ import { PYTHON_LANGUAGE } from '../platform/common/constants';
import { traceError } from '../platform/logging';
import { IDisposableRegistry } from '../platform/common/types';
import { noop } from '../platform/common/utils/misc';
import { chainWithPendingUpdates } from '../notebooks/execution/notebookUpdater';
import { isJupyterNotebook } from '../notebooks/helpers';
import { chainWithPendingUpdates } from '../kernels/execution/notebookUpdater';
import { INotebookControllerManager } from '../notebooks/types';
import { translateKernelLanguageToMonaco } from '../platform/common/utils';
import { isJupyterNotebook, translateKernelLanguageToMonaco } from '../platform/common/utils';
import { IVSCodeNotebookController } from '../notebooks/controllers/types';
/**
* If user creates a blank notebook, then they'll mostl likely end up with a blank cell with language, lets assume `Python`.
Expand Down
2 changes: 1 addition & 1 deletion src/intellisense/intellisenseProvider.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import { IDisposableRegistry, IConfigurationService, IsPreRelease } from '../pla
import { IInterpreterService } from '../platform/interpreter/contracts';
import { PythonEnvironment } from '../platform/pythonEnvironments/info';
import { getInterpreterId } from '../platform/pythonEnvironments/info/interpreter';
import { isJupyterNotebook } from '../notebooks/helpers';
import { INotebookControllerManager, INotebookCompletionProvider, INotebookEditorProvider } from '../notebooks/types';
import { LanguageServer } from './languageServer.node';
import { IVSCodeNotebookController } from '../notebooks/controllers/types';
import { getComparisonKey } from '../platform/vscode-path/resources';
import { CompletionRequest } from 'vscode-languageclient';
import { NotebookPythonPathService } from './notebookPythonPathService';
import { isJupyterNotebook } from '../platform/common/utils';

const EmptyWorkspaceKey = '';

Expand Down
2 changes: 1 addition & 1 deletion src/intellisense/pythonKernelCompletionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import { waitForPromise } from '../platform/common/utils/async';
import { isNotebookCell } from '../platform/common/utils/misc';
import { StopWatch } from '../platform/common/utils/stopWatch';
import { IJupyterSession, IKernelProvider } from '../kernels/types';
import { getAssociatedJupyterNotebook } from '../notebooks/helpers';
import { INotebookCompletionProvider, INotebookEditorProvider } from '../notebooks/types';
import { mapJupyterKind } from './conversion';
import { isTestExecution, Settings } from '../platform/common/constants';
import { INotebookCompletion } from './types';
import { getAssociatedJupyterNotebook } from '../platform/common/utils';

let IntellisenseTimeout = Settings.IntellisenseTimeout;
export function setIntellisenseTimeout(timeoutMs: number) {
Expand Down
2 changes: 1 addition & 1 deletion src/interactive-window/commands/exportCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import { DataScience } from '../../platform/common/utils/localize';
import { isUri } from '../../platform/common/utils/misc';
import { PythonEnvironment } from '../../platform/pythonEnvironments/info';
import { sendTelemetryEvent } from '../../telemetry';
import { getNotebookMetadata, isPythonNotebook } from '../../notebooks/helpers';
import { INotebookControllerManager } from '../../notebooks/types';
import { Commands, Telemetry } from '../../platform/common/constants';
import { IFileConverter, ExportFormat } from '../../platform/export/types';
import { IExportCommands, IInteractiveWindowProvider } from '../types';
import { IFileSystem } from '../../platform/common/platform/types';
import { isPythonNotebook, getNotebookMetadata } from '../../platform/common/utils';

interface IExportQuickPickItem extends QuickPickItem {
handler(): void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ import { IKernel, isLocalConnection } from '../../kernels/types';
import { IInteractiveWindowDebugger } from '../types';
import { IFileGeneratedCodes } from '../editor-integration/types';
import { IJupyterDebugService } from '../../kernels/debugger/types';
import { getAssociatedNotebookDocument } from '../../notebooks/controllers/kernelSelector';
import { executeSilently } from '../../kernels/helpers';
import { executeSilently, getAssociatedNotebookDocument } from '../../kernels/helpers';
import { buildSourceMap } from './helper';

@injectable()
Expand Down
2 changes: 1 addition & 1 deletion src/interactive-window/editor-integration/cellFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { NotebookCell, NotebookCellKind, NotebookDocument, Range, TextDocument,

import { appendLineFeed, generateMarkdownFromCodeLines, parseForComments } from '../../webviews/webview-side/common';
import { CellMatcher } from './cellMatcher';
import { createJupyterCellFromVSCNotebookCell } from '../../notebooks/helpers';
import { ICell, ICellRange, IJupyterSettings, Resource } from '../../platform/common/types';
import { noop } from '../../platform/common/utils/misc';
import { getInteractiveCellMetadata } from '../helpers';
import { createJupyterCellFromVSCNotebookCell } from '../../kernels/execution/helpers';

export function createCodeCell(): nbformat.ICodeCell;
// eslint-disable-next-line @typescript-eslint/unified-signatures
Expand Down
5 changes: 2 additions & 3 deletions src/interactive-window/editor-integration/codeLensFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ import { ICellRange, IConfigurationService, IDisposableRegistry, Resource } from
import * as localize from '../../platform/common/utils/localize';
import { getInteractiveCellMetadata } from '../helpers';
import { IKernelProvider } from '../../kernels/types';
import { InteractiveWindowView } from '../../notebooks/constants';
import { CodeLensCommands, Commands } from '../../platform/common/constants';
import { CodeLensCommands, Commands, InteractiveWindowView } from '../../platform/common/constants';
import { generateCellRangesFromDocument } from './cellFactory';
import { ICodeLensFactory, IGeneratedCode, IGeneratedCodeStorageFactory } from './types';
import { getAssociatedNotebookDocument } from '../../notebooks/controllers/kernelSelector';
import { getAssociatedNotebookDocument } from '../../kernels/helpers';

type CodeLensCacheData = {
cachedDocumentVersion: number | undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/interactive-window/editor-integration/decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { IPythonExtensionChecker } from '../../platform/api/types';
import { IDocumentManager } from '../../platform/common/application/types';
import { PYTHON_LANGUAGE } from '../../platform/common/constants';
import { IConfigurationService, IDisposable, IDisposableRegistry } from '../../platform/common/types';
import { getAssociatedJupyterNotebook } from '../../notebooks/helpers';
import { getAssociatedJupyterNotebook } from '../../platform/common/utils';
import { generateCellRangesFromDocument } from './cellFactory';

@injectable()
Expand Down
3 changes: 1 addition & 2 deletions src/interactive-window/editor-integration/hoverProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ import * as vscode from 'vscode';
import { IExtensionSyncActivationService } from '../../platform/activation/types';
import { IVSCodeNotebook } from '../../platform/common/application/types';
import { Cancellation } from '../../platform/common/cancellation';
import { Identifiers, PYTHON, Telemetry } from '../../platform/common/constants';
import { Identifiers, InteractiveWindowView, PYTHON, Telemetry } from '../../platform/common/constants';
import { traceError } from '../../platform/logging';
import { IDisposableRegistry } from '../../platform/common/types';

import { sleep } from '../../platform/common/utils/async';
import { StopWatch } from '../../platform/common/utils/stopWatch';
import { sendTelemetryEvent } from '../../telemetry';
import { IKernel, IKernelProvider } from '../../kernels/types';
import { InteractiveWindowView } from '../../notebooks/constants';
import { IJupyterVariables } from '../../kernels/variables/types';
import { IInteractiveWindowProvider } from '../types';
import { getInteractiveCellMetadata } from '../helpers';
Expand Down
4 changes: 2 additions & 2 deletions src/interactive-window/generatedCodeStoreManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

import { inject, injectable } from 'inversify';
import { NotebookDocument } from 'vscode';
import { getAssociatedNotebookDocument } from '../kernels/helpers';
import { IKernel, IKernelProvider } from '../kernels/types';
import { InteractiveWindowView } from '../notebooks/constants';
import { getAssociatedNotebookDocument } from '../notebooks/controllers/kernelSelector';
import { INotebookControllerManager } from '../notebooks/types';
import { IExtensionSyncActivationService } from '../platform/activation/types';
import { InteractiveWindowView } from '../platform/common/constants';
import { disposeAllDisposables } from '../platform/common/helpers';
import { IDisposable, IDisposableRegistry } from '../platform/common/types';
import { ICodeGeneratorFactory, IGeneratedCodeStorageFactory } from './editor-integration/types';
Expand Down
6 changes: 3 additions & 3 deletions src/interactive-window/interactiveWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ import { DataScience } from '../platform/common/utils/localize';
import { createDeferred, Deferred } from '../platform/common/utils/async';
import { IServiceContainer } from '../platform/ioc/types';
import { SysInfoReason } from '../platform/messageTypes';
import { chainWithPendingUpdates } from '../notebooks/execution/notebookUpdater';
import { updateNotebookMetadata } from '../notebooks/helpers';
import { CellExecutionCreator } from '../notebooks/execution/cellExecutionCreator';
import { createOutputWithErrorMessageForDisplay } from '../platform/errors/errorUtils';
import { INotebookExporter } from '../kernels/jupyter/types';
import { IDataScienceErrorHandler } from '../platform/errors/types';
Expand All @@ -74,6 +71,9 @@ import {
InteractiveCellMetadata
} from './editor-integration/types';
import { IInteractiveWindowDebuggingManager } from '../kernels/debugger/types';
import { CellExecutionCreator } from '../kernels/execution/cellExecutionCreator';
import { updateNotebookMetadata } from '../kernels/execution/helpers';
import { chainWithPendingUpdates } from '../kernels/execution/notebookUpdater';

export class InteractiveWindow implements IInteractiveWindowLoadable {
public get onDidChangeViewState(): Event<void> {
Expand Down
11 changes: 8 additions & 3 deletions src/interactive-window/interactiveWindowCommandListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ import {
IDocumentManager,
IVSCodeNotebook
} from '../platform/common/application/types';
import { Commands, JVSC_EXTENSION_ID, PYTHON_LANGUAGE, Telemetry } from '../platform/common/constants';
import {
Commands,
JupyterNotebookView,
JVSC_EXTENSION_ID,
PYTHON_LANGUAGE,
Telemetry
} from '../platform/common/constants';
import { traceError, traceInfo } from '../platform/logging';
import { IFileSystem } from '../platform/common/platform/types';
import { IConfigurationService, IDataScienceCommandListener, IDisposableRegistry } from '../platform/common/types';
Expand All @@ -33,15 +39,14 @@ import { CommandSource } from '../platform/testing/common/constants';
import { JupyterInstallError } from '../platform/errors/jupyterInstallError';
import { INotebookControllerManager, INotebookEditorProvider } from '../notebooks/types';
import { KernelConnectionMetadata } from '../kernels/types';
import { chainWithPendingUpdates } from '../notebooks/execution/notebookUpdater';
import { INotebookExporter, IJupyterExecution } from '../kernels/jupyter/types';
import { IDataScienceErrorHandler } from '../platform/errors/types';
import { IFileConverter, IExportDialog, ExportFormat } from '../platform/export/types';
import { IStatusProvider } from '../platform/progress/types';
import { generateCellsFromDocument } from './editor-integration/cellFactory';
import { IInteractiveWindowProvider } from './types';
import { JupyterNotebookView } from '../notebooks/constants';
import { getDisplayPath, getFilePath } from '../platform/common/platform/fs-paths';
import { chainWithPendingUpdates } from '../kernels/execution/notebookUpdater';

@injectable()
export class InteractiveWindowCommandListener implements IDataScienceCommandListener {
Expand Down
Loading

0 comments on commit 4a4e3db

Please sign in to comment.