Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #1229 disable installer prompts via do not show again option #1243

Merged
merged 4 commits into from
Sep 27, 2017

Conversation

DonJayamanne
Copy link
Owner

fix #1229

@@ -166,6 +167,8 @@ export class PythonSettings extends EventEmitter implements IPythonSettings {
this.devOptions = systemVariables.resolveAny(pythonSettings.get<any[]>('devOptions'))!;
this.devOptions = Array.isArray(this.devOptions) ? this.devOptions : [];
let lintingSettings = systemVariables.resolveAny(pythonSettings.get<ILintingSettings>('linting'))!;
this.disablePromptForFeatures = pythonSettings.get<string[]>('disablePromptForFeatures')!;
this.disablePromptForFeatures = Array.isArray(this.disablePromptForFeatures) ? this.disablePromptForFeatures : [];;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the double ;; for?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woops

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@@ -146,9 +143,9 @@ ProductTypes.set(Product.yapf, ProductType.Formatter);
ProductTypes.set(Product.rope, ProductType.RefactoringLibrary);

export class Installer implements vscode.Disposable {
private static terminal: vscode.Terminal;
private static terminal: vscode.Terminal | undefined | null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, what does this pattern do?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allow it to be nullable (i'm slowly introducing some strict checks.
I don't want to turn this on globally, else we'll have 100s of errors.
New --strict master option

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the errors from dependencies or just old code that needs an update?


const installOption = 'Install ' + productName;
const disableOption = 'Disable ' + productTypeName;
const disableOptionGlobally = `Disable ${productTypeName} globally`;
const dontShowAgain = `Don't show this again`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Don't show this prompt again"?

@@ -275,12 +291,12 @@ export function disableLinter(product: Product, global?: boolean) {
}
}

function isProductInstalled(product: Product): Promise<boolean | undefined> {
async function isProductInstalled(product: Product): Promise<boolean | undefined> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To help me learn, what are the rules for when to use null versus undefined?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, undefined is the similar to None in Python, null is more or less an actual value.
Generally in JS people use either, as both evaluate to nothing.
Don't you love JS.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figures. Wasn't sure if there was a move towards just null or something to overlook the weirdness of having both values or to use the ! operator or something.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g. if you declare a variable or call a function without passing in a value, the default value of those variables or parameters is undefined.
null is a value that you'd assign manually to something.

@DonJayamanne DonJayamanne merged commit 75f66aa into master Sep 27, 2017
@DonJayamanne DonJayamanne deleted the 1229DisablePrompts branch October 11, 2017 18:02
DonJayamanne pushed a commit that referenced this pull request Mar 30, 2018
…. (#1241) (#1243)

Forward-port from 2018.3.1
Fixes #1239
DonJayamanne pushed a commit that referenced this pull request Apr 3, 2018
…. (#1241) (#1243)

Forward-port from 2018.3.1
Fixes #1239
Goom11 pushed a commit to mostafaeweda/pythonVSCode that referenced this pull request Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants