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

add option to select default language #22

Merged
merged 4 commits into from
Apr 8, 2020
Merged

add option to select default language #22

merged 4 commits into from
Apr 8, 2020

Conversation

arcane810
Copy link
Contributor

No description provided.

Copy link
Owner

@agrawal-d agrawal-d left a comment

Choose a reason for hiding this comment

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

Thank you for working on this. Looks great. Comments below.

Additionally, please add a line or two in the README.md, in the Tips section, on how you can use this setting to make your favourite language as default!

package.json Outdated
"title": "Default Language for new problems",
"type": "string",
"default": "",
"enum": ["", "C", "C++", "Python", "Rust"],
Copy link
Owner

Choose a reason for hiding this comment

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

I think it's possible to be more explicit than "" - "None" can be better.

const defaultLanguage = preferences().get("defaultLanguage");
let selectLanguage;
if(defaultLanguage != "") {
selectLanguage = new Promise( (resolve) => {
Copy link
Owner

@agrawal-d agrawal-d Apr 8, 2020

Choose a reason for hiding this comment

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

Instead of using this useless promise, you can move both the logics within a single promise, and then do the clecking logic defaultLanguage != "" ... inside this single promise. This can also help eliminate the variable selectLanguage.

package.json Outdated
"title": "Default Language for new problems",
"type": "string",
"default": "",
"enum": ["", "C", "C++", "Python", "Rust"],
Copy link
Owner

Choose a reason for hiding this comment

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

Add a description - what this setting does.

@agrawal-d agrawal-d merged commit c92b6af into agrawal-d:master Apr 8, 2020
@agrawal-d
Copy link
Owner

Merged. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants