feat: TypeScript 5.0.2 (except decorators) (#18294)

This upgrades TypeScript to 5.0.2, but does not have ES decorator
support because swc does not support that yet.
This commit is contained in:
David Sherret 2023-03-21 11:46:40 -04:00 committed by GitHub
parent 0366d6833f
commit 2fcf1f14cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
111 changed files with 173492 additions and 178485 deletions

View file

@ -723,7 +723,7 @@ fn lsp_hover_asset() {
"textDocument": {
"uri": "deno:/asset/lib.es2015.symbol.wellknown.d.ts"
},
"position": { "line": 109, "character": 13 }
"position": { "line": 111, "character": 13 }
}),
);
assert_eq!(
@ -737,8 +737,8 @@ fn lsp_hover_asset() {
"Enables basic storage and retrieval of dates and times."
],
"range": {
"start": { "line": 109, "character": 10, },
"end": { "line": 109, "character": 14, }
"start": { "line": 111, "character": 10, },
"end": { "line": 111, "character": 14, }
}
})
);
@ -3673,23 +3673,6 @@ export class DuckConfig {
}]
}]
}
}, {
"title": "Add all missing imports",
"kind": "quickfix",
"diagnostics": [{
"range": {
"start": { "line": 0, "character": 50 },
"end": { "line": 0, "character": 67 }
},
"severity": 1,
"code": 2304,
"source": "deno-ts",
"message": "Cannot find name 'DuckConfigOptions'."
}],
"data": {
"specifier": "file:///a/file00.ts",
"fixId": "fixMissingImport"
}
}, {
"title": "Add import from \"./file01.ts\"",
"kind": "quickfix",
@ -3718,6 +3701,23 @@ export class DuckConfig {
}]
}]
}
}, {
"title": "Add all missing imports",
"kind": "quickfix",
"diagnostics": [{
"range": {
"start": { "line": 0, "character": 50 },
"end": { "line": 0, "character": 67 }
},
"severity": 1,
"code": 2304,
"source": "deno-ts",
"message": "Cannot find name 'DuckConfigOptions'."
}],
"data": {
"specifier": "file:///a/file00.ts",
"fixId": "fixMissingImport"
}
}])
);
let res = client.write_request(
@ -3830,6 +3830,19 @@ fn lsp_code_actions_refactor() {
assert_eq!(
res,
json!([{
"title": "Move to a new file",
"kind": "refactor.move.newFile",
"isPreferred": false,
"data": {
"specifier": "file:///a/file.ts",
"range": {
"start": { "line": 0, "character": 0 },
"end": { "line": 1, "character": 0 }
},
"refactorName": "Move to a new file",
"actionName": "Move to a new file"
}
}, {
"title": "Extract to function in module scope",
"kind": "refactor.extract.function",
"isPreferred": false,
@ -3855,19 +3868,6 @@ fn lsp_code_actions_refactor() {
"refactorName": "Extract Symbol",
"actionName": "constant_scope_0"
}
}, {
"title": "Move to a new file",
"kind": "refactor.move.newFile",
"isPreferred": false,
"data": {
"specifier": "file:///a/file.ts",
"range": {
"start": { "line": 0, "character": 0 },
"end": { "line": 1, "character": 0 }
},
"refactorName": "Move to a new file",
"actionName": "Move to a new file"
}
}, {
"title": "Convert default export to named export",
"kind": "refactor.rewrite.export.named",
@ -4047,19 +4047,6 @@ fn lsp_code_actions_refactor_no_disabled_support() {
assert_eq!(
res,
json!([{
"title": "Extract to function in module scope",
"kind": "refactor.extract.function",
"isPreferred": false,
"data": {
"specifier": "file:///a/file.ts",
"range": {
"start": { "line": 0, "character": 0 },
"end": { "line": 14, "character": 0 }
},
"refactorName": "Extract Symbol",
"actionName": "function_scope_0"
}
}, {
"title": "Move to a new file",
"kind": "refactor.move.newFile",
"isPreferred": false,
@ -4072,6 +4059,19 @@ fn lsp_code_actions_refactor_no_disabled_support() {
"refactorName": "Move to a new file",
"actionName": "Move to a new file"
}
}, {
"title": "Extract to function in module scope",
"kind": "refactor.extract.function",
"isPreferred": false,
"data": {
"specifier": "file:///a/file.ts",
"range": {
"start": { "line": 0, "character": 0 },
"end": { "line": 14, "character": 0 }
},
"refactorName": "Extract Symbol",
"actionName": "function_scope_0"
}
}])
);
client.shutdown();
@ -4394,6 +4394,7 @@ fn lsp_completions_auto_import() {
panic!("completions items missing 'foo' symbol");
}
// the request here is one of the items in `list`
let res = client.write_request(
"completionItem/resolve",
json!({
@ -4411,10 +4412,11 @@ fn lsp_completions_auto_import() {
"specifier": "file:///a/file.ts",
"position": 12,
"name": "foo",
"source": "./b",
"source": "./b.ts",
"data": {
"exportName": "foo",
"moduleSpecifier": "./b",
"exportMapKey": "foo|6843|file:///a/b",
"moduleSpecifier": "./b.ts",
"fileName": "file:///a/b.ts"
},
"useCodeSnippet": false
@ -6357,53 +6359,68 @@ fn lsp_workspace_symbol() {
);
assert_eq!(
res,
json!([
{
"name": "fieldA",
"kind": 8,
"location": {
"uri": "file:///a/file.ts",
"range": {
"start": { "line": 1, "character": 2 },
"end": { "line": 1, "character": 17 }
}
json!([{
"name": "fieldA",
"kind": 8,
"location": {
"uri": "file:///a/file.ts",
"range": {
"start": { "line": 1, "character": 2 },
"end": { "line": 1, "character": 17 }
}
},
"containerName": "A"
}, {
"name": "fieldB",
"kind": 8,
"location": {
"uri": "file:///a/file.ts",
"range": {
"start": { "line": 2, "character": 2 },
"end": { "line": 2, "character": 17 }
}
},
"containerName": "A"
}, {
"name": "fieldC",
"kind": 8,
"location": {
"uri": "file:///a/file_01.ts",
"range": {
"start": { "line": 1, "character": 2 },
"end": { "line": 1, "character": 17 }
}
},
"containerName": "B"
}, {
"name": "fieldD",
"kind": 8,
"location": {
"uri": "file:///a/file_01.ts",
"range": {
"start": { "line": 2, "character": 2 },
"end": { "line": 2, "character": 17 }
}
},
"containerName": "B"
}, {
"name": "ClassFieldDecoratorContext",
"kind": 11,
"location": {
"uri": "deno:/asset/lib.decorators.d.ts",
"range": {
"start": {
"line": 331,
"character": 0,
},
"end": {
"line": 371,
"character": 1,
},
},
"containerName": "A"
}, {
"name": "fieldB",
"kind": 8,
"location": {
"uri": "file:///a/file.ts",
"range": {
"start": { "line": 2, "character": 2 },
"end": { "line": 2, "character": 17 }
}
},
"containerName": "A"
}, {
"name": "fieldC",
"kind": 8,
"location": {
"uri": "file:///a/file_01.ts",
"range": {
"start": { "line": 1, "character": 2 },
"end": { "line": 1, "character": 17 }
}
},
"containerName": "B"
}, {
"name": "fieldD",
"kind": 8,
"location": {
"uri": "file:///a/file_01.ts",
"range": {
"start": { "line": 2, "character": 2 },
"end": { "line": 2, "character": 17 }
}
},
"containerName": "B"
}
])
},
"containerName": "",
}])
);
client.shutdown();
}