Skip to content

Commit

Permalink
Add some logging when Pylance gets interpreter info (#15472)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne authored Apr 2, 2024
1 parent 1ffed99 commit 4c511d0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/standalone/intellisense/notebookPythonPathService.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { IExtensionSyncActivationService } from '../../platform/activation/types
import { IPythonApiProvider, IPythonExtensionChecker } from '../../platform/api/types';
import { PylanceExtension } from '../../platform/common/constants';
import { getDisplayPath, getFilePath } from '../../platform/common/platform/fs-paths';
import { traceInfo } from '../../platform/logging';
import { traceInfo, traceVerbose } from '../../platform/logging';
import { IControllerRegistration } from '../../notebooks/controllers/types';
import { IKernelProvider, isRemoteConnection } from '../../kernels/types';
import { noop } from '../../platform/common/utils/misc';
Expand Down Expand Up @@ -133,6 +133,12 @@ del _VSCODE_os, _VSCODE_sys, _VSCODE_builtins
if (!executable || !(await fs.pathExists(executable))) {
return;
}
traceVerbose(
`Remote Interpreter for Pylance for Notebook URI "${getDisplayPath(notebook.uri)}" is ${getDisplayPath(
executable
)}`
);

return executable;
}

Expand All @@ -143,6 +149,11 @@ del _VSCODE_os, _VSCODE_sys, _VSCODE_builtins
traceInfo(`No interpreter for Pylance for Notebook URI "${getDisplayPath(notebook.uri)}"`);
return '';
}
traceVerbose(
`Interpreter for Pylance for Notebook URI "${getDisplayPath(notebook.uri)}" is ${getDisplayPath(
interpreter.uri
)}`
);
return getFilePath(interpreter.uri);
}
}

0 comments on commit 4c511d0

Please sign in to comment.