Skip to content

Commit 3cc8232

Browse files
authored
Bump TS versions (microsoft#189344)
Bumps TS version for building VS Code Bumps bundled TS version
1 parent ed59945 commit 3cc8232

File tree

6 files changed

+27
-12
lines changed

6 files changed

+27
-12
lines changed

extensions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "MIT",
55
"description": "Dependencies shared by all extensions",
66
"dependencies": {
7-
"typescript": "5.1.6"
7+
"typescript": "^5.2.0-dev.20230731"
88
},
99
"scripts": {
1010
"postinstall": "node ./postinstall.mjs"

extensions/typescript-language-features/src/languageFeatures/fileConfigurationManager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ export default class FileConfigurationManager extends Disposable {
195195
allowIncompleteCompletions: true,
196196
displayPartsForJSDoc: true,
197197
disableLineTextInReferences: true,
198+
interactiveInlayHints: true,
198199
...getInlayHintsPreferences(config),
199200
};
200201

extensions/typescript-language-features/src/languageFeatures/inlayHints.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { DocumentSelector } from '../configuration/documentSelector';
88
import { LanguageDescription } from '../configuration/languageDescription';
99
import { API } from '../tsServer/api';
1010
import type * as Proto from '../tsServer/protocol/protocol';
11-
import { Position } from '../typeConverters';
11+
import { Location, Position } from '../typeConverters';
1212
import { ClientCapability, ITypeScriptServiceClient } from '../typescriptService';
1313
import { Disposable } from '../utils/dispose';
1414
import FileConfigurationManager, { InlayHintSettingNames, getInlayHintsPreferences } from './fileConfigurationManager';
@@ -77,14 +77,28 @@ class TypeScriptInlayHintsProvider extends Disposable implements vscode.InlayHin
7777
return response.body.map(hint => {
7878
const result = new vscode.InlayHint(
7979
Position.fromLocation(hint.position),
80-
hint.text,
80+
this.convertInlayHintText(model.uri, hint),
8181
hint.kind && fromProtocolInlayHintKind(hint.kind)
8282
);
8383
result.paddingLeft = hint.whitespaceBefore;
8484
result.paddingRight = hint.whitespaceAfter;
8585
return result;
8686
});
8787
}
88+
89+
private convertInlayHintText(resource: vscode.Uri, tsHint: Proto.InlayHintItem): string | vscode.InlayHintLabelPart[] {
90+
if (typeof tsHint.text === 'string') {
91+
return tsHint.text;
92+
}
93+
94+
return tsHint.text.map((part): vscode.InlayHintLabelPart => {
95+
const out = new vscode.InlayHintLabelPart(part.text);
96+
if (part.span) {
97+
out.location = Location.fromTextSpan(resource, part.span);
98+
}
99+
return out;
100+
});
101+
}
88102
}
89103

90104
function fromProtocolInlayHintKind(kind: Proto.InlayHintKind): vscode.InlayHintKind | undefined {

extensions/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,10 @@ to-regex-range@^5.0.1:
228228
dependencies:
229229
is-number "^7.0.0"
230230

231-
typescript@5.1.6:
232-
version "5.1.6"
233-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274"
234-
integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==
231+
typescript@^5.2.0-dev.20230731:
232+
version "5.2.0-dev.20230731"
233+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.0-dev.20230731.tgz#a72083c07043568ab856dd8ca0d8f3a708c3e3a6"
234+
integrity sha512-RJVLgnDgu67ZrohYy0aBea+5TICfRod36+24zw0bR/KJDQJO9mlIjTC0k+/PKw87fXP5JuUHqepEk15PvFya7A==
235235

236236
vscode-grammar-updater@^1.1.0:
237237
version "1.1.0"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
"ts-loader": "^9.4.2",
213213
"ts-node": "^10.9.1",
214214
"tsec": "0.2.7",
215-
"typescript": "^5.2.0-dev.20230718",
215+
"typescript": "^5.2.0-dev.20230731",
216216
"typescript-formatter": "7.1.0",
217217
"underscore": "^1.12.1",
218218
"util": "^0.12.4",

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10075,10 +10075,10 @@ typescript@^4.7.4:
1007510075
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6"
1007610076
integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==
1007710077

10078-
typescript@^5.2.0-dev.20230718:
10079-
version "5.2.0-dev.20230718"
10080-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.0-dev.20230718.tgz#8c60b2f6807b3f8b2db47980ee6c73dea1f45e42"
10081-
integrity sha512-ED1Vm+2UzdbtKui+0lVswEuAX94fQXeoghXyy/+aTNers8X/WB81r5sFg6nA4e43nVQ2MP/Qsa7/XJRFuHR+Cg==
10078+
typescript@^5.2.0-dev.20230731:
10079+
version "5.2.0-dev.20230731"
10080+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.0-dev.20230731.tgz#a72083c07043568ab856dd8ca0d8f3a708c3e3a6"
10081+
integrity sha512-RJVLgnDgu67ZrohYy0aBea+5TICfRod36+24zw0bR/KJDQJO9mlIjTC0k+/PKw87fXP5JuUHqepEk15PvFya7A==
1008210082

1008310083
typical@^4.0.0:
1008410084
version "4.0.0"

0 commit comments

Comments
 (0)