forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve interpreter selection on different platforms (#517)
* Basic tokenizer * Fixed property names * Tests, round I * Tests, round II * tokenizer test * Remove temorary change * Fix merge issue * Merge conflict * Merge conflict * Completion test * Fix last line * Fix javascript math * Make test await for results * Add license headers * Rename definitions to types * License headers * Fix typo in completion details (typo) * Fix hover test * Russian translations * Update to better translation * Fix typo * #70 How to get all parameter info when filling in a function param list * Fix #70 How to get all parameter info when filling in a function param list * Clean up * Clean imports * CR feedback * Trim whitespace for test stability * More tests * Better handle no-parameters documentation * Better handle ellipsis and Python3 * Basic services * Install check * Output installer messages * Warn default Mac OS interpreter * Remove test change * Add tests * PR feedback * CR feedback * Mock process instead * Fix Brew detection * Update test * Add check suppression option & suppress vor VE by default * Fix most linter tests * Merge conflict
- Loading branch information
Mikhail Arkhipov
authored
Jan 4, 2018
1 parent
9853956
commit 4372809
Showing
25 changed files
with
788 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
'use strict'; | ||
|
||
// tslint:disable-next-line:no-require-imports no-var-requires | ||
const opn = require('opn'); | ||
|
||
import { injectable } from 'inversify'; | ||
import * as vscode from 'vscode'; | ||
import { IApplicationShell } from './types'; | ||
|
||
@injectable() | ||
export class ApplicationShell implements IApplicationShell { | ||
public showInformationMessage(message: string, ...items: string[]): Thenable<string> ; | ||
public showInformationMessage(message: string, options: vscode.MessageOptions, ...items: string[]): Thenable<string> ; | ||
public showInformationMessage<T extends vscode.MessageItem>(message: string, ...items: T[]): Thenable<T> ; | ||
public showInformationMessage<T extends vscode.MessageItem>(message: string, options: vscode.MessageOptions, ...items: T[]): Thenable<T> ; | ||
// tslint:disable-next-line:no-any | ||
public showInformationMessage(message: string, options?: any, ...items: any[]): Thenable<any> { | ||
return vscode.window.showInformationMessage(message, options, ...items); | ||
} | ||
|
||
public showWarningMessage(message: string, ...items: string[]): Thenable<string>; | ||
public showWarningMessage(message: string, options: vscode.MessageOptions, ...items: string[]): Thenable<string>; | ||
public showWarningMessage<T extends vscode.MessageItem>(message: string, ...items: T[]): Thenable<T>; | ||
public showWarningMessage<T extends vscode.MessageItem>(message: string, options: vscode.MessageOptions, ...items: T[]): Thenable<T>; | ||
// tslint:disable-next-line:no-any | ||
public showWarningMessage(message: any, options?: any, ...items: any[]) { | ||
return vscode.window.showWarningMessage(message, options, ...items); | ||
} | ||
|
||
public showErrorMessage(message: string, ...items: string[]): Thenable<string>; | ||
public showErrorMessage(message: string, options: vscode.MessageOptions, ...items: string[]): Thenable<string>; | ||
public showErrorMessage<T extends vscode.MessageItem>(message: string, ...items: T[]): Thenable<T>; | ||
public showErrorMessage<T extends vscode.MessageItem>(message: string, options: vscode.MessageOptions, ...items: T[]): Thenable<T>; | ||
// tslint:disable-next-line:no-any | ||
public showErrorMessage(message: any, options?: any, ...items: any[]) { | ||
return vscode.window.showErrorMessage(message, options, ...items); | ||
} | ||
|
||
public showQuickPick(items: string[] | Thenable<string[]>, options?: vscode.QuickPickOptions, token?: vscode.CancellationToken): Thenable<string>; | ||
public showQuickPick<T extends vscode.QuickPickItem>(items: T[] | Thenable<T[]>, options?: vscode.QuickPickOptions, token?: vscode.CancellationToken): Thenable<T>; | ||
// tslint:disable-next-line:no-any | ||
public showQuickPick(items: any, options?: any, token?: any) { | ||
return vscode.window.showQuickPick(items, options, token); | ||
} | ||
|
||
public showOpenDialog(options: vscode.OpenDialogOptions): Thenable<vscode.Uri[]> { | ||
return vscode.window.showOpenDialog(options); | ||
} | ||
public showSaveDialog(options: vscode.SaveDialogOptions): Thenable<vscode.Uri> { | ||
return vscode.window.showSaveDialog(options); | ||
} | ||
public showInputBox(options?: vscode.InputBoxOptions, token?: vscode.CancellationToken): Thenable<string> { | ||
return vscode.window.showInputBox(options, token); | ||
} | ||
public openUrl(url: string): void { | ||
opn(url); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,194 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
'use strict'; | ||
|
||
import * as vscode from 'vscode'; | ||
|
||
export const IApplicationShell = Symbol('IApplicationShell'); | ||
export interface IApplicationShell { | ||
showInformationMessage(message: string, ...items: string[]): Thenable<string | undefined>; | ||
|
||
/** | ||
* Show an information message to users. Optionally provide an array of items which will be presented as | ||
* clickable buttons. | ||
* | ||
* @param message The message to show. | ||
* @param options Configures the behaviour of the message. | ||
* @param items A set of items that will be rendered as actions in the message. | ||
* @return A thenable that resolves to the selected item or `undefined` when being dismissed. | ||
*/ | ||
showInformationMessage(message: string, options: vscode.MessageOptions, ...items: string[]): Thenable<string | undefined>; | ||
|
||
/** | ||
* Show an information message. | ||
* | ||
* @see [showInformationMessage](#window.showInformationMessage) | ||
* | ||
* @param message The message to show. | ||
* @param items A set of items that will be rendered as actions in the message. | ||
* @return A thenable that resolves to the selected item or `undefined` when being dismissed. | ||
*/ | ||
showInformationMessage<T extends vscode.MessageItem>(message: string, ...items: T[]): Thenable<T | undefined>; | ||
|
||
/** | ||
* Show an information message. | ||
* | ||
* @see [showInformationMessage](#window.showInformationMessage) | ||
* | ||
* @param message The message to show. | ||
* @param options Configures the behaviour of the message. | ||
* @param items A set of items that will be rendered as actions in the message. | ||
* @return A thenable that resolves to the selected item or `undefined` when being dismissed. | ||
*/ | ||
showInformationMessage<T extends vscode.MessageItem>(message: string, options: vscode.MessageOptions, ...items: T[]): Thenable<T | undefined>; | ||
|
||
/** | ||
* Show a warning message. | ||
* | ||
* @see [showInformationMessage](#window.showInformationMessage) | ||
* | ||
* @param message The message to show. | ||
* @param items A set of items that will be rendered as actions in the message. | ||
* @return A thenable that resolves to the selected item or `undefined` when being dismissed. | ||
*/ | ||
showWarningMessage(message: string, ...items: string[]): Thenable<string | undefined>; | ||
|
||
/** | ||
* Show a warning message. | ||
* | ||
* @see [showInformationMessage](#window.showInformationMessage) | ||
* | ||
* @param message The message to show. | ||
* @param options Configures the behaviour of the message. | ||
* @param items A set of items that will be rendered as actions in the message. | ||
* @return A thenable that resolves to the selected item or `undefined` when being dismissed. | ||
*/ | ||
showWarningMessage(message: string, options: vscode.MessageOptions, ...items: string[]): Thenable<string | undefined>; | ||
|
||
/** | ||
* Show a warning message. | ||
* | ||
* @see [showInformationMessage](#window.showInformationMessage) | ||
* | ||
* @param message The message to show. | ||
* @param items A set of items that will be rendered as actions in the message. | ||
* @return A thenable that resolves to the selected item or `undefined` when being dismissed. | ||
*/ | ||
showWarningMessage<T extends vscode.MessageItem>(message: string, ...items: T[]): Thenable<T | undefined>; | ||
|
||
/** | ||
* Show a warning message. | ||
* | ||
* @see [showInformationMessage](#window.showInformationMessage) | ||
* | ||
* @param message The message to show. | ||
* @param options Configures the behaviour of the message. | ||
* @param items A set of items that will be rendered as actions in the message. | ||
* @return A thenable that resolves to the selected item or `undefined` when being dismissed. | ||
*/ | ||
showWarningMessage<T extends vscode.MessageItem>(message: string, options: vscode.MessageOptions, ...items: T[]): Thenable<T | undefined>; | ||
|
||
/** | ||
* Show an error message. | ||
* | ||
* @see [showInformationMessage](#window.showInformationMessage) | ||
* | ||
* @param message The message to show. | ||
* @param items A set of items that will be rendered as actions in the message. | ||
* @return A thenable that resolves to the selected item or `undefined` when being dismissed. | ||
*/ | ||
showErrorMessage(message: string, ...items: string[]): Thenable<string | undefined>; | ||
|
||
/** | ||
* Show an error message. | ||
* | ||
* @see [showInformationMessage](#window.showInformationMessage) | ||
* | ||
* @param message The message to show. | ||
* @param options Configures the behaviour of the message. | ||
* @param items A set of items that will be rendered as actions in the message. | ||
* @return A thenable that resolves to the selected item or `undefined` when being dismissed. | ||
*/ | ||
showErrorMessage(message: string, options: vscode.MessageOptions, ...items: string[]): Thenable<string | undefined>; | ||
|
||
/** | ||
* Show an error message. | ||
* | ||
* @see [showInformationMessage](#window.showInformationMessage) | ||
* | ||
* @param message The message to show. | ||
* @param items A set of items that will be rendered as actions in the message. | ||
* @return A thenable that resolves to the selected item or `undefined` when being dismissed. | ||
*/ | ||
showErrorMessage<T extends vscode.MessageItem>(message: string, ...items: T[]): Thenable<T | undefined>; | ||
|
||
/** | ||
* Show an error message. | ||
* | ||
* @see [showInformationMessage](#window.showInformationMessage) | ||
* | ||
* @param message The message to show. | ||
* @param options Configures the behaviour of the message. | ||
* @param items A set of items that will be rendered as actions in the message. | ||
* @return A thenable that resolves to the selected item or `undefined` when being dismissed. | ||
*/ | ||
showErrorMessage<T extends vscode.MessageItem>(message: string, options: vscode.MessageOptions, ...items: T[]): Thenable<T | undefined>; | ||
|
||
/** | ||
* Shows a selection list. | ||
* | ||
* @param items An array of strings, or a promise that resolves to an array of strings. | ||
* @param options Configures the behavior of the selection list. | ||
* @param token A token that can be used to signal cancellation. | ||
* @return A promise that resolves to the selection or `undefined`. | ||
*/ | ||
showQuickPick(items: string[] | Thenable<string[]>, options?: vscode.QuickPickOptions, token?: vscode.CancellationToken): Thenable<string | undefined>; | ||
|
||
/** | ||
* Shows a selection list. | ||
* | ||
* @param items An array of items, or a promise that resolves to an array of items. | ||
* @param options Configures the behavior of the selection list. | ||
* @param token A token that can be used to signal cancellation. | ||
* @return A promise that resolves to the selected item or `undefined`. | ||
*/ | ||
showQuickPick<T extends vscode.QuickPickItem>(items: T[] | Thenable<T[]>, options?: vscode.QuickPickOptions, token?: vscode.CancellationToken): Thenable<T | undefined>; | ||
|
||
/** | ||
* Shows a file open dialog to the user which allows to select a file | ||
* for opening-purposes. | ||
* | ||
* @param options Options that control the dialog. | ||
* @returns A promise that resolves to the selected resources or `undefined`. | ||
*/ | ||
showOpenDialog(options: vscode.OpenDialogOptions): Thenable<vscode.Uri[] | undefined>; | ||
|
||
/** | ||
* Shows a file save dialog to the user which allows to select a file | ||
* for saving-purposes. | ||
* | ||
* @param options Options that control the dialog. | ||
* @returns A promise that resolves to the selected resource or `undefined`. | ||
*/ | ||
showSaveDialog(options: vscode.SaveDialogOptions): Thenable<vscode.Uri | undefined>; | ||
|
||
/** | ||
* Opens an input box to ask the user for input. | ||
* | ||
* The returned value will be `undefined` if the input box was canceled (e.g. pressing ESC). Otherwise the | ||
* returned value will be the string typed by the user or an empty string if the user did not type | ||
* anything but dismissed the input box with OK. | ||
* | ||
* @param options Configures the behavior of the input box. | ||
* @param token A token that can be used to signal cancellation. | ||
* @return A promise that resolves to a string the user provided or to `undefined` in case of dismissal. | ||
*/ | ||
showInputBox(options?: vscode.InputBoxOptions, token?: vscode.CancellationToken): Thenable<string | undefined>; | ||
|
||
/** | ||
* Opens URL in a default browser. | ||
* | ||
* @param url Url to open. | ||
*/ | ||
openUrl(url: string): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.