From 62e4f131849a0db3637ca0087feadd53774b165d Mon Sep 17 00:00:00 2001 From: Kevin Barabash Date: Thu, 14 Mar 2024 13:57:06 -0400 Subject: [PATCH] Enable inlay hints for VSCode (#1020) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary: Inlay hints can be useful at see the types for things without having to hover over everything. They can also be useful in understand what args are being passed as what params especially when the args are literals. This PR enables all of the inlay hints in our .vscode/settings.json. In order to see the inlay hints developers must press and hold Ctrl-Opt at the same time otherwise they're not visible. If developers want to customize this behaviour they can do so in their User settings.json for VSCode. Issue: None ## Test plan: - open a .ts file in VSCode - press Ctrl-Opt - see all of the inlay hints Screen Shot 2024-03-12 at 10 23 07 AM Author: kevinbarabash Reviewers: jeresig Required Reviewers: Approved By: jeresig Checks: ✅ codecov/project, ✅ Test (macos-latest, 20.x), ✅ CodeQL, ✅ Lint, typecheck, and coverage check (ubuntu-latest, 20.x), ✅ gerald, ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ Analyze (javascript), ⏭️ dependabot Pull Request URL: https://github.com/Khan/wonder-stuff/pull/1020 --- .changeset/little-dingos-travel.md | 2 ++ .vscode/settings.json | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .changeset/little-dingos-travel.md diff --git a/.changeset/little-dingos-travel.md b/.changeset/little-dingos-travel.md new file mode 100644 index 00000000..a845151c --- /dev/null +++ b/.changeset/little-dingos-travel.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.vscode/settings.json b/.vscode/settings.json index 58fe1d53..51a0c28a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -17,5 +17,20 @@ }, "todo-tree.filtering.excludeGlobs": [ "**/dist/**", - ] + ], + + // Inlay Hints + "editor.inlayHints.enabled": "offUnlessPressed", + "javascript.inlayHints.enumMemberValues.enabled": true, + "javascript.inlayHints.functionLikeReturnTypes.enabled": true, + "javascript.inlayHints.parameterNames.enabled": "all", + "javascript.inlayHints.parameterTypes.enabled": true, + "javascript.inlayHints.propertyDeclarationTypes.enabled": true, + "javascript.inlayHints.variableTypes.enabled": true, + "typescript.inlayHints.enumMemberValues.enabled": true, + "typescript.inlayHints.functionLikeReturnTypes.enabled": true, + "typescript.inlayHints.parameterNames.enabled": "all", + "typescript.inlayHints.parameterTypes.enabled": true, + "typescript.inlayHints.propertyDeclarationTypes.enabled": true, + "typescript.inlayHints.variableTypes.enabled": true, } \ No newline at end of file