File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
- import { promises as fs } from 'fs'
1
+ import * as fs from 'fs'
2
2
import * as FuzzySearch from 'fuzzy-search'
3
3
import * as request from 'request-promise-native'
4
4
import * as URI from 'urijs'
5
+ import { promisify } from 'util'
5
6
import * as LSP from 'vscode-languageserver'
6
7
import * as Parser from 'web-tree-sitter'
7
8
@@ -13,6 +14,8 @@ import { getFilePaths } from './util/fs'
13
14
import { getShebang , isBashShebang } from './util/shebang'
14
15
import * as TreeSitterUtil from './util/tree-sitter'
15
16
17
+ const readFileAsync = promisify ( fs . readFile )
18
+
16
19
type Kinds = { [ type : string ] : LSP . SymbolKind }
17
20
18
21
type Declarations = { [ name : string ] : LSP . SymbolInformation [ ] }
@@ -67,7 +70,7 @@ export default class Analyzer {
67
70
connection . console . log ( `Analyzing ${ uri } ` )
68
71
69
72
try {
70
- const fileContent = await fs . readFile ( filePath , 'utf8' )
73
+ const fileContent = await readFileAsync ( filePath , 'utf8' )
71
74
const shebang = getShebang ( fileContent )
72
75
if ( shebang && ! isBashShebang ( shebang ) ) {
73
76
connection . console . log ( `Skipping file ${ uri } with shebang "${ shebang } "` )
You can’t perform that action at this time.
0 commit comments