Skip to content

Commit f984885

Browse files
committed
cleanup
1 parent 66159ea commit f984885

File tree

2 files changed

+6
-47
lines changed

2 files changed

+6
-47
lines changed

client/out/languageserver.js

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

client/src/languageserver.ts

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -90,23 +90,6 @@ function getOuterMostWorkspaceFolder(folder: WorkspaceFolder): WorkspaceFolder {
9090
return folder;
9191
}
9292

93-
async function chmod(path: fs.PathLike, mode: fs.Mode) {
94-
await new Promise((resolve) => {
95-
fs.chmod(path, mode, resolve)
96-
})
97-
}
98-
99-
async function exists(path: fs.PathLike) {
100-
return await new Promise((resolve) => {
101-
fs.stat(path, (err, stats) => {
102-
if (stats && stats.isDirectory()) {
103-
resolve(true);
104-
}
105-
resolve(false);
106-
})
107-
})
108-
}
109-
11093
class LuaClient {
11194
private context: ExtensionContext;
11295
private documentSelector: DocumentSelector;
@@ -138,12 +121,7 @@ class LuaClient {
138121
let command: string;
139122
let platform: string = os.platform();
140123
let binDir: string;
141-
if (await exists(this.context.asAbsolutePath(
142-
path.join(
143-
'server',
144-
'bin',
145-
)
146-
))) {
124+
if ((await fs.promises.stat(this.context.asAbsolutePath('server/bin'))).isDirectory()) {
147125
binDir = 'bin';
148126
}
149127
switch (platform) {
@@ -164,7 +142,7 @@ class LuaClient {
164142
'lua-language-server'
165143
)
166144
);
167-
await chmod(command, '777');
145+
await fs.promises.chmod(command, '777')
168146
break;
169147
case "darwin":
170148
command = this.context.asAbsolutePath(
@@ -174,7 +152,7 @@ class LuaClient {
174152
'lua-language-server'
175153
)
176154
);
177-
await chmod(command, '777');
155+
await fs.promises.chmod(command, '777')
178156
break;
179157
}
180158

0 commit comments

Comments
 (0)