Skip to content

Commit

Permalink
fix(type): fix bad types
Browse files Browse the repository at this point in the history
  • Loading branch information
chemzqm committed Aug 31, 2023
1 parent 5385efd commit b2ae10c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/__tests__/core/workspaceFolder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ describe('WorkspaceFolderController', () => {
it('should not throw on timeout', async () => {
let spy = jest.spyOn(workspaceFolder, 'checkFolder').mockImplementation((_dir, _patterns, token) => {
return new Promise((resolve, reject) => {
let timer = setTimeout(resolve, 200)
let timer = setTimeout(() => {
resolve(undefined)
}, 200)
token.onCancellationRequested(() => {
clearTimeout(timer)
reject(new CancellationError())
Expand Down
2 changes: 1 addition & 1 deletion src/language-client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ export abstract class BaseLanguageClient implements FeatureClient<Middleware, La
this.cleanUp(mode)

let tm: NodeJS.Timeout
const tp = new Promise<undefined>(c => { tm = setTimeout(c, timeout) })
const tp = new Promise<any>(c => { tm = setTimeout(c, timeout) })
const shutdown = (async connection => {
await connection.shutdown()
await connection.exit()
Expand Down
2 changes: 1 addition & 1 deletion src/util/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export function findUp(name: string | string[], cwd: string): string {
return null
}

export function readFile(fullpath: string, encoding: string): Promise<string> {
export function readFile(fullpath: string, encoding: BufferEncoding): Promise<string> {
return new Promise((resolve, reject) => {
fs.readFile(fullpath, encoding, (err, content) => {
if (err) reject(err)
Expand Down

0 comments on commit b2ae10c

Please sign in to comment.