Skip to content

Commit e52839f

Browse files
committed
fix: remove excess async
1 parent e15d390 commit e52839f

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lib/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class PythonLanguageClient extends AutoLanguageClient {
111111
}
112112
}
113113

114-
async getSuggestions(request) {
114+
getSuggestions(request) {
115115
if (!PYTHON_REGEX.test(request.prefix)) {
116116
return null
117117
}

lib/utils.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,29 @@ function detectPipEnv(path) {
2222
}
2323

2424
async function detectVirtualEnv(path) {
25-
const entries = await new Promise((resolve) =>
26-
new Directory(path).getEntries((error, entries) => {
25+
const entries = await new Promise((resolve) => {
26+
new Directory(path).getEntries((error, resolvedEntries) => {
2727
if (error === null) {
28-
resolve(entries)
28+
resolve(resolvedEntries)
2929
} else {
3030
resolve(null)
3131
}
3232
})
33-
)
33+
})
3434
if (entries) {
3535
for (const entry of entries) {
3636
if (entry.isDirectory()) {
3737
if (VIRTUAL_ENV_BIN_DIRS.indexOf(entry.getBaseName()) !== -1) {
3838
for (const executable of VIRTUAL_ENV_EXECUTABLES) {
39+
/* eslint-disable-next-line no-await-in-loop */
3940
if (await entry.getFile(executable).exists()) {
4041
return path
4142
}
4243
}
4344
} else {
4445
for (const dir_name of VIRTUAL_ENV_BIN_DIRS) {
4546
for (const executable of VIRTUAL_ENV_EXECUTABLES) {
47+
/* eslint-disable-next-line no-await-in-loop */
4648
if (await entry.getSubdirectory(dir_name).getFile(executable).exists()) {
4749
return entry.getPath()
4850
}

0 commit comments

Comments
 (0)