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

Sign up
Appearance settings

Commit a4a263d

Browse files
committed
Get rid of noImplicitAny in server
1 parent 1061658 commit a4a263d

File tree

4 files changed

+92
-5
lines changed

4 files changed

+92
-5
lines changed

‎server/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,11 @@
3030
"compile": "rm -rf out && ../node_modules/.bin/tsc -p ./",
3131
"compile:watch": "../node_modules/.bin/tsc -w -p ./",
3232
"prepublishOnly": "yarn run compile"
33+
},
34+
"devDependencies": {
35+
"@types/glob": "^7.1.1",
36+
"@types/request-promise-native": "^1.0.17",
37+
"@types/turndown": "^5.0.0",
38+
"@types/urijs": "^1.19.4"
3339
}
3440
}

‎server/src/analyser.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ export default class Analyzer {
136136
interestingNode.endIndex,
137137
)
138138

139+
// FIXME: type the response and unit test it
139140
const explainshellResponse = await request({
140141
uri: URI(endpoint)
141142
.path('/api/explain')
@@ -158,7 +159,7 @@ export default class Analyzer {
158159
interestingNode.startIndex
159160

160161
const match = explainshellResponse.matches.find(
161-
helpItem =>
162+
(helpItem: any) =>
162163
helpItem.start <= offsetOfMousePointerInCommand &&
163164
offsetOfMousePointerInCommand < helpItem.end,
164165
)
@@ -189,7 +190,7 @@ export default class Analyzer {
189190
const tree = this.uriToTreeSitterTrees[uri]
190191
const contents = this.uriToFileContent[uri]
191192

192-
const locations = []
193+
const locations: LSP.Location[] = []
193194

194195
TreeSitterUtil.forEach(tree.rootNode, n => {
195196
let name: string = null
@@ -225,7 +226,7 @@ export default class Analyzer {
225226
* Find unique symbol completions for the given file.
226227
*/
227228
public findSymbolCompletions(uri: string): LSP.CompletionItem[] {
228-
const hashFunction = ({ name, kind }) => `${name}${kind}`
229+
const hashFunction = ({ name, kind }: LSP.SymbolInformation) => `${name}${kind}`
229230

230231
return uniqueBasedOnHash(this.findSymbols(uri), hashFunction).map(
231232
(symbol: LSP.SymbolInformation) => ({
@@ -256,7 +257,7 @@ export default class Analyzer {
256257
this.uriToDeclarations[uri] = {}
257258
this.uriToFileContent[uri] = contents
258259

259-
const problems = []
260+
const problems: LSP.Diagnostic[] = []
260261

261262
TreeSitterUtil.forEach(tree.rootNode, (n: Parser.SyntaxNode) => {
262263
if (n.type === 'ERROR') {

‎server/tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
"compilerOptions": {
44
"outDir": "out",
55

6+
"lib": [
7+
"dom", // Required by @types/turndown
8+
"es2016"
9+
],
610
// TODO: enable:
711
"strict": false,
8-
"noImplicitAny": false,
912
}
1013
}

‎server/yarn.lock

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,67 @@
22
# yarn lockfile v1
33

44

5+
"@types/caseless@*":
6+
version "0.12.2"
7+
resolved "https://registry.yarnpkg.com/@types/caseless/-/caseless-0.12.2.tgz#f65d3d6389e01eeb458bd54dc8f52b95a9463bc8"
8+
integrity sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w==
9+
10+
"@types/events@*":
11+
version "3.0.0"
12+
resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7"
13+
integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==
14+
15+
"@types/glob@^7.1.1":
16+
version "7.1.1"
17+
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575"
18+
integrity sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==
19+
dependencies:
20+
"@types/events" "*"
21+
"@types/minimatch" "*"
22+
"@types/node" "*"
23+
24+
"@types/minimatch@*":
25+
version "3.0.3"
26+
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
27+
integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==
28+
29+
"@types/node@*":
30+
version "12.7.7"
31+
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.7.7.tgz#f9bd8c00fa9e1a8129af910fc829f6139c397d6c"
32+
integrity sha512-4jUncNe2tj1nmrO/34PsRpZqYVnRV1svbU78cKhuQKkMntKB/AmdLyGgswcZKjFHEHGpiY8pVD8CuVI55nP54w==
33+
34+
"@types/request-promise-native@^1.0.17":
35+
version "1.0.17"
36+
resolved "https://registry.yarnpkg.com/@types/request-promise-native/-/request-promise-native-1.0.17.tgz#74a2d7269aebf18b9bdf35f01459cf0a7bfc7fab"
37+
integrity sha512-05/d0WbmuwjtGMYEdHIBZ0tqMJJQ2AD9LG2F6rKNBGX1SSFR27XveajH//2N/XYtual8T9Axwl+4v7oBtPUZqg==
38+
dependencies:
39+
"@types/request" "*"
40+
41+
"@types/request@*":
42+
version "2.48.3"
43+
resolved "https://registry.yarnpkg.com/@types/request/-/request-2.48.3.tgz#970b8ed2317568c390361d29c555a95e74bd6135"
44+
integrity sha512-3Wo2jNYwqgXcIz/rrq18AdOZUQB8cQ34CXZo+LUwPJNpvRAL86+Kc2wwI8mqpz9Cr1V+enIox5v+WZhy/p3h8w==
45+
dependencies:
46+
"@types/caseless" "*"
47+
"@types/node" "*"
48+
"@types/tough-cookie" "*"
49+
form-data "^2.5.0"
50+
51+
"@types/tough-cookie@*":
52+
version "2.3.5"
53+
resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-2.3.5.tgz#9da44ed75571999b65c37b60c9b2b88db54c585d"
54+
integrity sha512-SCcK7mvGi3+ZNz833RRjFIxrn4gI1PPR3NtuIS+6vMkvmsGjosqTJwRt5bAEFLRz+wtJMWv8+uOnZf2hi2QXTg==
55+
56+
"@types/turndown@^5.0.0":
57+
version "5.0.0"
58+
resolved "https://registry.yarnpkg.com/@types/turndown/-/turndown-5.0.0.tgz#2b763b36f783e4e237cea62cdc8f8592b72b9285"
59+
integrity sha512-Y7KZn6SfSv1vzjByJGijrM9w99HoUbLiAgYwe+sGH6RYi5diIGLYOcr4Z1YqR2biFs9K5PnxKv/Fbkmh57pvzg==
60+
61+
"@types/urijs@^1.19.4":
62+
version "1.19.4"
63+
resolved "https://registry.yarnpkg.com/@types/urijs/-/urijs-1.19.4.tgz#29c4a694d4842d7f95e359a26223fc1865f1ab13"
64+
integrity sha512-uHUvuLfy4YkRHL4UH8J8oRsINhdEHd9ymag7KJZVT94CjAmY1njoUzhazJsZjwfy+IpWKQKGVyXCwzhZvg73Fg==
65+
566
abab@^1.0.4:
667
version "1.0.4"
768
resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.4.tgz#5faad9c2c07f60dd76770f71cf025b62a63cfd4e"
@@ -106,6 +167,13 @@ combined-stream@1.0.6, combined-stream@~1.0.5:
106167
dependencies:
107168
delayed-stream "~1.0.0"
108169

170+
combined-stream@^1.0.6:
171+
version "1.0.8"
172+
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
173+
integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==
174+
dependencies:
175+
delayed-stream "~1.0.0"
176+
109177
concat-map@0.0.1:
110178
version "0.0.1"
111179
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
@@ -230,6 +298,15 @@ forever-agent@~0.6.1:
230298
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
231299
integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=
232300

301+
form-data@^2.5.0:
302+
version "2.5.1"
303+
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.1.tgz#f2cbec57b5e59e23716e128fe44d4e5dd23895f4"
304+
integrity sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==
305+
dependencies:
306+
asynckit "^0.4.0"
307+
combined-stream "^1.0.6"
308+
mime-types "^2.1.12"
309+
233310
form-data@~2.3.1:
234311
version "2.3.2"
235312
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099"

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /