Skip to content
This repository was archived by the owner on Aug 29, 2021. It is now read-only.

Commit 5069b0f

Browse files
committed
Fix some tslint stuff and remove util.promisify
1 parent 1330ad9 commit 5069b0f

File tree

6 files changed

+58
-74
lines changed

6 files changed

+58
-74
lines changed

.travis.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ branches:
88
- master
99
sudo: false
1010
node_js:
11-
- stable
12-
# Needs to support node 7 for vscode
13-
# Possibly irrelevant as of ~1.27
14-
- "7"
11+
# - stable
12+
# For vscode - same as stable
13+
- "10"
1514
before_install:
1615
- npm install -g npm@6
1716
install:

package-lock.json

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

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
"sprintf-js": "^1.1.2",
4545
"synchronous-promise": "^2.0.6",
4646
"tslib": "^1.9.3",
47-
"util.promisify": "^1.0.0",
4847
"vscode-json-languageservice": "^3.2.0",
4948
"vscode-languageserver": "^5.2.1",
5049
"vscode-uri": "^1.0.6"

src/declaration.d.ts

Lines changed: 35 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Create global variables
22

3+
// tslint:disable-next-line:no-namespace
34
declare namespace NodeJS {
45
interface Global {
56
mcLangLog: typeof mcLangLog;
@@ -12,28 +13,23 @@ declare namespace NodeJS {
1213
declare const mcLangSettings: McFunctionSettings;
1314

1415
interface McFunctionSettings extends LocalMcFunctionSettings {
15-
/**
16-
* Settings related to information tracking
17-
*/
18-
trace: {
19-
/**
20-
* Whether or not to show output from internal logging messages.
21-
*/
22-
internalLogging: boolean;
23-
};
24-
/**
25-
* Settings related to translating the server errors.
26-
*/
27-
translation: {
28-
/**
29-
* The code for the language to be used.
30-
*/
31-
lang: string;
32-
};
3316
/**
3417
* Settings related to the collection of data.
3518
*/
3619
data: {
20+
/**
21+
* Global Scoped Setting
22+
*
23+
* __Advanced Users Only__
24+
*
25+
* The path to a custom (server) jar to attempt to extract data from.
26+
*
27+
* This is recommended for when working with mods,
28+
* or past Minecraft versions (AFTER 1.13 Snapshot 18w01a) only.
29+
*
30+
* Note that not all mod parsers will be always supported, and features may change between snapshots.
31+
*/
32+
customJar: string;
3733
/**
3834
* Global Scoped Setting
3935
*
@@ -54,19 +50,6 @@ interface McFunctionSettings extends LocalMcFunctionSettings {
5450
* Disabled by default.
5551
*/
5652
enabled: boolean;
57-
/**
58-
* Global Scoped Setting
59-
*
60-
* __Advanced Users Only__
61-
*
62-
* The path to a custom (server) jar to attempt to extract data from.
63-
*
64-
* This is recommended for when working with mods,
65-
* or past Minecraft versions (AFTER 1.13 Snapshot 18w01a) only.
66-
*
67-
* Note that not all mod parsers will be always supported, and features may change between snapshots.
68-
*/
69-
customJar: string;
7053
/**
7154
* Global Scoped Setting
7255
*
@@ -89,6 +72,24 @@ interface McFunctionSettings extends LocalMcFunctionSettings {
8972
parsers?: {
9073
[name: string]: import("./types").Parser;
9174
};
75+
/**
76+
* Settings related to information tracking
77+
*/
78+
trace: {
79+
/**
80+
* Whether or not to show output from internal logging messages.
81+
*/
82+
internalLogging: boolean;
83+
};
84+
/**
85+
* Settings related to translating the server errors.
86+
*/
87+
translation: {
88+
/**
89+
* The code for the language to be used.
90+
*/
91+
lang: string;
92+
};
9293
}
9394

9495
interface LocalMcFunctionSettings {
@@ -118,39 +119,13 @@ interface McLogger {
118119
* This is disabled or enabled
119120
* based on the "mcfunction.trace.internalLogging" setting
120121
*/
121-
internal: (message: string) => void;
122+
internal(message: string): void;
122123
}
123124
/**
124125
* An internal logging type to allow proper typing information to be used for mcLangLog.
125126
*/
126127
type InternalLog = (message: string) => void;
127128

128-
type Dictionary<T> = { [key: string]: T };
129-
130-
// Type definitions for util.promisify 1.0
131-
// Project: https://github.com/ljharb/util.promisify#readme
132-
// Definitions by: Adam Voss <https://github.com/adamvoss>
133-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
134-
135-
// Modified to exclude the redeclaration of util.promisify for this project
136-
declare module "util.promisify" {
137-
export = promisify;
138-
139-
function promisify(
140-
f: (...args: any[]) => void
141-
): (...args: any[]) => Promise<any>;
142-
143-
namespace promisify {
144-
interface implementation {
145-
(fn: (...args: any[]) => void): (...args: any[]) => Promise<any>;
146-
custom: symbol;
147-
customPromisifyArgs: symbol | undefined;
148-
}
149-
150-
const custom: symbol;
151-
const customPromisifyArgs: symbol;
152-
function getPolyfill(): implementation;
153-
const implementation: implementation;
154-
function shim(): implementation;
155-
}
129+
interface Dictionary<T> {
130+
[key: string]: T;
156131
}

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { EventEmitter } from "events";
22
import { promisify } from "util";
3-
import { shim } from "util.promisify";
43
import {
54
CompletionList,
65
createConnection,

src/test/logging-setup.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as path from "path";
2-
import { shim } from "util.promisify";
3-
shim();
2+
43
const logger = (message: string) => {
54
// tslint:disable-next-line:no-console
65
console.log(message);

0 commit comments

Comments
 (0)