Skip to content

Commit

Permalink
Merge pull request #10 from eleanorjboyd/fix_main_3
Browse files Browse the repository at this point in the history
Fix main 3
  • Loading branch information
eleanorjboyd committed May 4, 2023
2 parents 0822427 + 89db1e9 commit 339e6c9
Show file tree
Hide file tree
Showing 46 changed files with 489 additions and 184 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- 'release-*'

env:
NODE_VERSION: 14.18.2
NODE_VERSION: 16.17.1
PYTHON_VERSION: '3.10' # YML treats 3.10 the number as 3.1, so quotes around 3.10
# Force a path with spaces and to test extension works in these scenarios
# Unicode characters are causing 2.7 failures so skip that for now.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- release*

env:
NODE_VERSION: 14.18.2
NODE_VERSION: 16.17.1
PYTHON_VERSION: '3.10' # YML treats 3.10 the number as 3.1, so quotes around 3.10
MOCHA_REPORTER_JUNIT: true # Use the mocha-multi-reporters and send output to both console (spec) and JUnit (mocha-junit-reporter). Also enables a reporter which exits the process running the tests if it haven't already.
ARTIFACT_NAME_VSIX: ms-python-insiders-vsix
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14.18.2
v16.17.1
2 changes: 1 addition & 1 deletion build/azure-pipeline.pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extends:
buildSteps:
- task: NodeTool@0
inputs:
versionSpec: '14.18.2'
versionSpec: '16.17.1'
displayName: Select Node version

- task: UsePythonVersion@0
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipeline.stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extends:
buildSteps:
- task: NodeTool@0
inputs:
versionSpec: '14.18.2'
versionSpec: '16.17.1'
displayName: Select Node version

- task: UsePythonVersion@0
Expand Down
59 changes: 18 additions & 41 deletions package-lock.json

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

18 changes: 12 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "python",
"displayName": "Python",
"description": "IntelliSense (Pylance), Linting, Debugging (multi-threaded, remote), Jupyter Notebooks, code formatting, refactoring, unit tests, and more.",
"version": "2023.7.0-dev",
"version": "2023.9.0-dev",
"featureFlags": {
"usingNewInterpreterStorage": true
},
Expand All @@ -23,7 +23,8 @@
"envShellEvent",
"testObserver",
"quickPickItemTooltip",
"envCollectionWorkspace"
"envCollectionWorkspace",
"saveEditor"
],
"author": {
"name": "Microsoft Corporation"
Expand All @@ -44,7 +45,7 @@
"theme": "dark"
},
"engines": {
"vscode": "^1.78.0-20230421"
"vscode": "^1.78.0"
},
"keywords": [
"python",
Expand Down Expand Up @@ -277,6 +278,11 @@
"command": "python.createEnvironment",
"title": "%python.command.python.createEnvironment.title%"
},
{
"category": "Python",
"command": "python.createEnvironment-button",
"title": "%python.command.python.createEnvironment.title%"
},
{
"category": "Python",
"command": "python.enableLinting",
Expand Down Expand Up @@ -1700,12 +1706,12 @@
"editor/content": [
{
"group": "Python",
"command": "python.createEnvironment",
"command": "python.createEnvironment-button",
"when": "resourceLangId == pip-requirements && !virtualWorkspace && shellExecutionSupported && !inDiffEditor"
},
{
"group": "Python",
"command": "python.createEnvironment",
"command": "python.createEnvironment-button",
"when": "resourceFilename == pyproject.toml && pipInstallableToml && !virtualWorkspace && shellExecutionSupported && !inDiffEditor"
}
],
Expand Down Expand Up @@ -1915,7 +1921,7 @@
"@types/md5": "^2.1.32",
"@types/mocha": "^9.1.0",
"@types/nock": "^10.0.3",
"@types/node": "^14.18.0",
"@types/node": "^16.17.0",
"@types/semver": "^5.5.0",
"@types/shortid": "^0.0.29",
"@types/sinon": "^10.0.11",
Expand Down
10 changes: 10 additions & 0 deletions src/client/common/application/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,16 @@ export interface IWorkspaceService {
* @return A promise that resolves to a {@link TextDocument document}.
*/
openTextDocument(options?: { language?: string; content?: string }): Thenable<TextDocument>;
/**
* Saves the editor identified by the given resource to a new file name as provided by the user and
* returns the resulting resource or `undefined` if save was not successful or cancelled.
*
* **Note** that an editor with the provided resource must be opened in order to be saved as.
*
* @param uri the associated uri for the opened editor to save as.
* @return A thenable that resolves when the save-as operation has finished.
*/
saveAs(uri: Uri): Thenable<Uri | undefined>;
}

export const ITerminalManager = Symbol('ITerminalManager');
Expand Down
10 changes: 10 additions & 0 deletions src/client/common/application/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,14 @@ export class WorkspaceService implements IWorkspaceService {
const enabledSearchExcludes = Object.keys(searchExcludes).filter((key) => searchExcludes.get(key) === true);
return `{${enabledSearchExcludes.join(',')}}`;
}

public async saveAs(uri: Uri): Promise<Uri | undefined> {
try {
// This is a proposed API hence putting it inside try...catch.
const result = await workspace.saveAs(uri);
return result;
} catch (ex) {
return undefined;
}
}
}
1 change: 1 addition & 0 deletions src/client/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export namespace Commands {
export const CreateNewFile = 'python.createNewFile';
export const ClearWorkspaceInterpreter = 'python.clearWorkspaceInterpreter';
export const Create_Environment = 'python.createEnvironment';
export const Create_Environment_Button = 'python.createEnvironment-button';
export const Create_Terminal = 'python.createTerminal';
export const Debug_In_Terminal = 'python.debugInTerminal';
export const Enable_Linter = 'python.enableLinting';
Expand Down
3 changes: 2 additions & 1 deletion src/client/common/process/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export class ProcessLogger implements IProcessLogger {
: fileOrCommand;
const info = [`> ${this.getDisplayCommands(command)}`];
if (options?.cwd) {
info.push(`cwd: ${this.getDisplayCommands(options.cwd)}`);
const cwd: string = typeof options?.cwd === 'string' ? options?.cwd : options?.cwd?.toString();
info.push(`cwd: ${this.getDisplayCommands(cwd)}`);
}
if (typeof options?.shell === 'string') {
info.push(`shell: ${identifyShellFromShellPath(options?.shell)}`);
Expand Down
2 changes: 1 addition & 1 deletion src/client/common/process/rawProcessApis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export function execObservable(
let procExited = false;
const disposable: IDisposable = {
dispose() {
if (proc && !proc.killed && !procExited) {
if (proc && proc.pid && !proc.killed && !procExited) {
killPid(proc.pid);
}
if (proc) {
Expand Down
6 changes: 5 additions & 1 deletion src/client/common/utils/localize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ export namespace DebugConfigStrings {
export const enterManagePyPath = {
title: l10n.t('Debug Django'),
prompt: l10n.t(
"Enter the path to manage.py ('${workspaceFolderToken}' points to the root of the current workspace folder)",
"Enter the path to manage.py ('${workspaceFolder}' points to the root of the current workspace folder)",
),
invalid: l10n.t('Enter a valid Python file path'),
};
Expand Down Expand Up @@ -407,9 +407,13 @@ export namespace Testing {
export const testNotConfigured = l10n.t('No test framework configured.');
export const cancelUnittestDiscovery = l10n.t('Canceled unittest test discovery');
export const errorUnittestDiscovery = l10n.t('Unittest test discovery error');
export const cancelPytestDiscovery = l10n.t('Canceled pytest test discovery');
export const errorPytestDiscovery = l10n.t('pytest test discovery error');
export const seePythonOutput = l10n.t('(see Output > Python)');
export const cancelUnittestExecution = l10n.t('Canceled unittest test execution');
export const errorUnittestExecution = l10n.t('Unittest test execution error');
export const cancelPytestExecution = l10n.t('Canceled pytest test execution');
export const errorPytestExecution = l10n.t('Pytest test execution error');
}

export namespace OutdatedDebugger {
Expand Down
6 changes: 3 additions & 3 deletions src/client/common/utils/multiStepInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ interface InputBoxParameters {
validate(value: string): Promise<string | undefined>;
}

type MultiStepInputQuickPicResponseType<T, P> = T | (P extends { buttons: (infer I)[] } ? I : never) | undefined;
type MultiStepInputQuickPickResponseType<T, P> = T | (P extends { buttons: (infer I)[] } ? I : never) | undefined;
type MultiStepInputInputBoxResponseType<P> = string | (P extends { buttons: (infer I)[] } ? I : never) | undefined;
export interface IMultiStepInput<S> {
run(start: InputStep<S>, state: S): Promise<void>;
Expand All @@ -88,7 +88,7 @@ export interface IMultiStepInput<S> {
activeItem,
placeholder,
customButtonSetups,
}: P): Promise<MultiStepInputQuickPicResponseType<T, P>>;
}: P): Promise<MultiStepInputQuickPickResponseType<T, P>>;
showInputBox<P extends InputBoxParameters>({
title,
step,
Expand Down Expand Up @@ -126,7 +126,7 @@ export class MultiStepInput<S> implements IMultiStepInput<S> {
keepScrollPosition,
sortByLabel,
initialize,
}: P): Promise<MultiStepInputQuickPicResponseType<T, P>> {
}: P): Promise<MultiStepInputQuickPickResponseType<T, P>> {
const disposables: Disposable[] = [];
const input = this.shell.createQuickPick<T>();
input.title = title;
Expand Down
Loading

0 comments on commit 339e6c9

Please sign in to comment.