Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d670fed

Browse filesBrowse files
author
Akos Kitta
committed
GH-18: Use promisified fs functions.
Closes: #18 Signed-off-by: Akos Kitta <kittaakos@typefox.io>
1 parent 537e98e commit d670fed
Copy full SHA for d670fed

File tree

Expand file treeCollapse file tree

1 file changed

+3
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-4
lines changed

‎src/extension.ts

Copy file name to clipboardExpand all lines: src/extension.ts
+3-4Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import * as fs from 'fs';
1+
import { promises as fs } from 'fs';
22
import * as path from 'path';
3-
import { promisify } from 'util';
43
import { spawnSync } from 'child_process';
54
import deepEqual from 'deep-equal';
65
import WebRequest from 'web-request';
@@ -140,7 +139,7 @@ async function startDebug(_: ExtensionContext, config: DebugConfig): Promise<boo
140139

141140
let customDebugConfig = {};
142141
try {
143-
const raw = await promisify(fs.readFile)(path.join(config.sketchPath, 'debug_custom.json'), { encoding: 'utf8' });
142+
const raw = await fs.readFile(path.join(config.sketchPath, 'debug_custom.json'), { encoding: 'utf8' });
144143
customDebugConfig = JSON.parse(raw);
145144
} catch { }
146145
const mergedDebugConfig = deepmerge(defaultDebugConfig, customDebugConfig);
@@ -199,7 +198,7 @@ async function buildLanguageClient(config: LanguageServerConfig): Promise<Langua
199198
let logPath: string | undefined = undefined;
200199
if (typeof log === 'string') {
201200
try {
202-
const stats = await promisify(fs.stat)(log);
201+
const stats = await fs.stat(log);
203202
if (stats.isDirectory()) {
204203
logPath = log;
205204
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.