Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
533 changes: 533 additions & 0 deletions LSP.md

Large diffs are not rendered by default.

23 changes: 13 additions & 10 deletions build/esbuild/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const deskTopNodeModulesToExternalize = [
// Lazy loaded modules.
'vscode-languageclient/node',
'@jupyterlab/nbformat',
'vscode-jsonrpc' // Used by a few modules, might as well pull this out, instead of duplicating it in separate bundles.
'vscode-jsonrpc'
];
const commonExternals = [
'log4js',
Expand Down Expand Up @@ -226,10 +226,15 @@ function createConfig(
inject.push(path.join(__dirname, 'jquery.js'));
}
// Create a copy to avoid mutating the original arrays
const external = [...(target === 'web' ? webExternals : commonExternals)];
let external = [...(target === 'web' ? webExternals : commonExternals)];
if (source.toLowerCase().endsWith('extension.node.ts')) {
external.push(...desktopExternals);
}
// When building vscode-languageclient, bundle vscode-jsonrpc into it
// to avoid ESM/CommonJS interop issues at runtime
if (source.includes('vscode-languageclient')) {
external = external.filter((e) => e !== 'vscode-jsonrpc');
}
const isPreRelease = isDevbuild || process.env.IS_PRE_RELEASE_VERSION_OF_JUPYTER_EXTENSION === 'true';
const releaseVersionScriptFile = isPreRelease ? 'release.pre-release.js' : 'release.stable.js';
const alias = {
Expand Down Expand Up @@ -534,20 +539,18 @@ async function copyNodeGypBuild() {
await fs.ensureDir(target);
await fs.copy(source, target, { recursive: true });
}

async function buildVSCodeJsonRPC() {
const source = path.join(extensionFolder, 'node_modules', 'vscode-jsonrpc');
const target = path.join(extensionFolder, 'dist', 'node_modules', 'vscode-jsonrpc', 'index.js');
await fs.ensureDir(path.dirname(target));
const fullPath = require.resolve(source);
const contents = `
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ----------------------------------------------------------------------------------------- */
'use strict';

module.exports = require('./index');`;
// ESM re-export for node.js entry point
const contents = `export * from './index.js';`;
await fs.writeFile(path.join(path.dirname(target), 'node.js'), contents);
// Add package.json for ESM module resolution
const packageJson = JSON.stringify({ type: 'module', main: './index.js' }, null, 2);
await fs.writeFile(path.join(path.dirname(target), 'package.json'), packageJson);
return build(fullPath, target, {
target: 'desktop',
watch: false
Expand Down
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"pids",
"Pids",
"plotly",
"pylsp",
"PYTHONHOME",
"Reselecting",
"scipy",
Expand Down
123 changes: 85 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2547,7 +2547,7 @@
"vega-embed": "^7.1.0",
"vega-lite": "^6.4.1",
"vscode-debugprotocol": "^1.41.0",
"vscode-languageclient": "8.0.2-next.5",
"vscode-languageclient": "^9.0.1",
"vscode-tas-client": "^0.1.84",
"ws": "^6.2.3",
"zeromq": "^6.5.0",
Expand Down
2 changes: 0 additions & 2 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,6 @@ export interface ICommandNameArgumentTypeMapping {
[DSCommands.RunAndDebugCell]: [NotebookCell];
[DSCommands.RunByLineNext]: [NotebookCell];
[DSCommands.RunByLineStop]: [NotebookCell];
[DSCommands.ReplayPylanceLog]: [Uri];
[DSCommands.ReplayPylanceLogStep]: [];
[DSCommands.InstallPythonExtensionViaKernelPicker]: [];
[DSCommands.InstallPythonViaKernelPicker]: [];
[DSCommands.ContinueEditSessionInCodespace]: [];
Expand Down
12 changes: 0 additions & 12 deletions src/extension.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
import {
STANDARD_OUTPUT_CHANNEL,
JUPYTER_OUTPUT_CHANNEL,
PylanceExtension,
PythonExtension,
Telemetry,
PythonEnvironmentExtension
Expand All @@ -39,7 +38,6 @@ import { IServiceContainer, IServiceManager } from './platform/ioc/types';
import { initializeLoggers as init, logger } from './platform/logging';
import { ILogger } from './platform/logging/types';
import { getJupyterOutputChannel } from './standalone/devTools/jupyterOutputChannel';
import { isUsingPylance } from './standalone/intellisense/notebookPythonPathService';
import { noop } from './platform/common/utils/misc';
import { sendErrorTelemetry } from './platform/telemetry/startupTelemetry';
import { StopWatch } from './platform/common/utils/stopWatch';
Expand Down Expand Up @@ -77,16 +75,6 @@ export async function initializeLoggers(
} else {
standardOutputChannel.appendLine('Python Environment Extension not installed.');
}
const pylanceExtension = extensions.getExtension(PylanceExtension);
if (pylanceExtension) {
standardOutputChannel.appendLine(
`Pylance Extension Version${isUsingPylance() ? '' : ' (Not Used) '}: ${
pylanceExtension.packageJSON['version']
}.`
);
} else {
standardOutputChannel.appendLine('Pylance Extension not installed.');
}
if (options?.platform) {
standardOutputChannel.appendLine(`Platform: ${options.platform} (${options.arch}).`);
}
Expand Down
Loading