Skip to content

Commit

Permalink
feat: add inlay hint settings (#733)
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsonk authored Oct 16, 2022
1 parent 8581e36 commit 2b34bab
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ extension has the following configuration options:
- `deno.unstable`: Controls if code will be type checked with Deno's unstable
APIs. This is the equivalent to using `--unstable` on the command line.
_boolean, default `false`_
- `deno.enablePaths`: - Controls if the Deno Language Server is enabled for only specific paths of the workspace folder.
Defaults to an empty list.
- `deno.enablePaths`: - Controls if the Deno Language Server is enabled for only
specific paths of the workspace folder. Defaults to an empty list.

## Contribute

Expand Down
60 changes: 59 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,64 @@
"C:\\path\\to\\import_map.json"
]
},
"deno.inlayHints.parameterNames.enabled": {
"type": "string",
"enum": [
"none",
"literals",
"all"
],
"enumDescriptions": [
"Disable inlay hints for parameters.",
"Display inlay hints for literal arguments.",
"Display inlay hints for all literal and non-literal arguments."
],
"default": "none",
"markdownDescription": "Enable/disable inlay hints for parameter names.",
"scope": "resource"
},
"deno.inlayHints.parameterNames.suppressWhenArgumentMatchesName": {
"type": "boolean",
"default": true,
"markdownDescription": "Do not display an inlay hint when the argument name matches the parameter.",
"scope": "resource"
},
"deno.inlayHints.parameterTypes.enabled": {
"type": "boolean",
"default": false,
"markdownDescription": "Enable/disable inlay hints for implicit parameter types.",
"scope": "resource"
},
"deno.inlayHints.variableTypes.enabled": {
"type": "boolean",
"default": false,
"markdownDescription": "Enable/disable inlay hints for implicit variable types.",
"scope": "resource"
},
"deno.inlayHints.variableTypes.suppressWhenTypeMatchesName": {
"type": "boolean",
"default": true,
"markdownDescription": "Suppress type hints where the variable name matches the implicit type.",
"scope": "resource"
},
"deno.inlayHints.propertyDeclarationTypes.enabled": {
"type": "boolean",
"default": false,
"markdownDescription": "Enable/disable inlay hints for implicit property declarations.",
"scope": "resource"
},
"deno.inlayHints.functionLikeReturnTypes.enabled": {
"type": "boolean",
"default": false,
"markdownDescription": "Enable/disable inlay hints for implicit function return types.",
"scope": "resource"
},
"deno.inlayHints.enumMemberValues.enabled": {
"type": "boolean",
"default": false,
"markdownDescription": "Enable/disable inlay hints for enum values.",
"scope": "resource"
},
"deno.suggest.autoImports": {
"type": "boolean",
"default": true,
Expand Down Expand Up @@ -512,4 +570,4 @@
"esbuild": "^0.14.23",
"typescript": "^4.5.5"
}
}
}
4 changes: 2 additions & 2 deletions typescript-deno-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import type * as ts from "../node_modules/typescript/lib/tsserverlibrary";
// deno-lint-ignore no-explicit-any
type ReturnType<T = (...args: any) => any> = T extends // deno-lint-ignore no-explicit-any
(...args: any) => infer R ? R
: // deno-lint-ignore no-explicit-any
any;
// deno-lint-ignore no-explicit-any
: any;
/** Extract the parameter types from a maybe function. */
// deno-lint-ignore no-explicit-any
type Parameters<T = (...args: any) => any> = T extends // deno-lint-ignore no-explicit-any
Expand Down

0 comments on commit 2b34bab

Please sign in to comment.