Support TS's includeInlayVariableTypeHintsWhenTypeMatchesName setting (#150489)

From https://github.com/microsoft/TypeScript/pull/48529

Let users control is variable type inlay hints are suppresed if the variable name matches the type name, such as:

```ts
const range = new Range();
```
This commit is contained in:
Matt Bierner
2022-05-26 16:00:04 -07:00
committed by GitHub
parent e2adf980b1
commit 6428d0fc7d
4 changed files with 19 additions and 6 deletions

View File

@@ -88,10 +88,7 @@
"message": "Enable/disable inlay hints for parameter names:\n```typescript\n\nparseInt(/* str: */ '123', /* radix: */ 8)\n \n```\nRequires using TypeScript 4.4+ in the workspace.",
"comment": "The text inside the ``` block is code and should not be localized."
},
"configuration.inlayHints.parameterNames.suppressWhenArgumentMatchesName": {
"message": "Suppress parameter name hints on arguments whose text is identical to the parameter name.",
"comment": "The text inside the ``` block is code and should not be localized."
},
"configuration.inlayHints.parameterNames.suppressWhenArgumentMatchesName": "Suppress parameter name hints on arguments whose text is identical to the parameter name.",
"configuration.inlayHints.parameterTypes.enabled": {
"message": "Enable/disable inlay hints for implicit parameter types:\n```typescript\n\nel.addEventListener('click', e /* :MouseEvent */ => ...)\n \n```\nRequires using TypeScript 4.4+ in the workspace.",
"comment": "The text inside the ``` block is code and should not be localized."
@@ -100,6 +97,7 @@
"message": "Enable/disable inlay hints for implicit variable types:\n```typescript\n\nconst foo /* :number */ = Date.now();\n \n```\nRequires using TypeScript 4.4+ in the workspace.",
"comment": "The text inside the ``` block is code and should not be localized."
},
"configuration.inlayHints.variableTypes.suppressWhenTypeMatchesName": "Suppress type hints on variables whose name is identical to the type name. Requires using TypeScript 4.8+ in the workspace.",
"configuration.inlayHints.propertyDeclarationTypes.enabled": {
"message": "Enable/disable inlay hints for implicit types on property declarations:\n```typescript\n\nclass Foo {\n\tprop /* :number */ = Date.now();\n}\n \n```\nRequires using TypeScript 4.4+ in the workspace.",
"comment": "The text inside the ``` block is code and should not be localized."