Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 41dc161

Browse files
committed
Format code + update dev dependencies
1 parent 9e01d29 commit 41dc161

File tree

3 files changed

+82
-83
lines changed

3 files changed

+82
-83
lines changed

lib/index.js

Lines changed: 43 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ function getPath() {
1919
// Make sure the cargo directory is in PATH
2020
let { PATH } = process.env
2121
PATH = PATH + ":" + path.join(os.homedir(), ".cargo/bin")
22-
2322
return PATH
2423
}
2524

@@ -36,7 +35,7 @@ async function exec(command) {
3635
})
3736
}
3837

39-
function logErr(e, logFn=console.warn) {
38+
function logErr(e, logFn = console.warn) {
4039
const message = e && '' + e
4140
message && logFn(message)
4241
}
@@ -55,8 +54,7 @@ function atomPrompt(message, options, buttons) {
5554
return new Promise(resolve => {
5655
const notification = atom.notifications.addInfo(
5756
message,
58-
Object.assign(
59-
{
57+
Object.assign({
6058
dismissable: true,
6159
_src: 'ide-rust',
6260
buttons: (buttons || []).map(button => ({
@@ -353,51 +351,52 @@ class RustLanguageClient extends AutoLanguageClient {
353351
* @param {string} toolchain
354352
*/
355353
async _handleMissingToolchainMissingRls(toolchain) {
356-
const note = {
357-
description: '**Warning**: This toolchain is unavilable or missing Rls.',
358-
buttons: [{
359-
text: 'Configure',
360-
onDidClick: () => atom.workspace.open('atom://config/packages/ide-rust')
361-
}],
362-
}
363-
364-
if (toolchain === 'nightly') {
365-
note.description += ' Try using a previous _dated_ nightly.'
366-
}
367-
else if (toolchain.startsWith('nightly')) {
368-
note.description += ' Try using another nightly version.'
369-
}
370-
371-
let suggestChannel = toolchain.startsWith('beta') && 'beta' ||
372-
toolchain.startsWith('stable') && 'stable' ||
373-
'nightly'
374-
375-
try {
376-
let suggestedVersion = await suggestChannelOrDated(suggestChannel)
377-
if (suggestedVersion) {
378-
note.buttons.push({
379-
text: `Use ${suggestedVersion}`,
380-
className: 'btn-success',
381-
onDidClick: () => {
382-
clearIdeRustInfos()
383-
atom.config.set('ide-rust.rlsToolchain', suggestedVersion)
384-
}
385-
})
386-
}
387-
} catch (e) {
388-
console.warn(e)
389-
}
390-
391-
atomPrompt(`\`rustup\` missing ${toolchain} toolchain`, note)
392-
}
354+
const note = {
355+
description: '**Warning**: This toolchain is unavilable or missing Rls.',
356+
buttons: [{
357+
text: 'Configure',
358+
onDidClick: () => atom.workspace.open('atom://config/packages/ide-rust')
359+
}],
360+
}
361+
362+
if (toolchain === 'nightly') {
363+
note.description += ' Try using a previous _dated_ nightly.'
364+
}
365+
else if (toolchain.startsWith('nightly')) {
366+
note.description += ' Try using another nightly version.'
367+
}
368+
369+
let suggestChannel = toolchain.startsWith('beta') && 'beta' ||
370+
toolchain.startsWith('stable') && 'stable' ||
371+
'nightly'
372+
373+
try {
374+
let suggestedVersion = await suggestChannelOrDated(suggestChannel)
375+
if (suggestedVersion) {
376+
note.buttons.push({
377+
text: `Use ${suggestedVersion}`,
378+
className: 'btn-success',
379+
onDidClick: () => {
380+
clearIdeRustInfos()
381+
atom.config.set('ide-rust.rlsToolchain', suggestedVersion)
382+
}
383+
})
384+
}
385+
}
386+
catch (e) {
387+
console.warn(e)
388+
}
389+
390+
atomPrompt(`\`rustup\` missing ${toolchain} toolchain`, note)
391+
}
393392

394393
/** Takes appropriate action when missing rustup */
395394
async _handleMissingRustup() {
396395
try {
397396
let clicked = await atomPrompt("`rustup` is not available", {
398-
description: "From https://www.rustup.rs/",
399-
detail: "curl https://sh.rustup.rs -sSf | sh"
400-
}, ["Install"])
397+
description: "From https://www.rustup.rs/",
398+
detail: "curl https://sh.rustup.rs -sSf | sh"
399+
}, ["Install"])
401400

402401
if (clicked === "Install") {
403402
// Install rustup and try again

package-lock.json

Lines changed: 38 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"underscore-plus": "^1.6.6"
2525
},
2626
"devDependencies": {
27-
"eslint": "^4.17.0"
27+
"eslint": "^4.18.0"
2828
},
2929
"scripts": {
3030
"test": "eslint lib test --max-warnings 0"

0 commit comments

Comments
 (0)