Skip to content

Commit

Permalink
Enable inlay hints for VSCode (#1020)
Browse files Browse the repository at this point in the history
## 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

<img width="648" alt="Screen Shot 2024-03-12 at 10 23 07 AM" src="https://github.com/Khan/webapp/assets/1044413/3df98a50-4d2d-42f9-9e8a-4de4c796ebc4">

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: #1020
  • Loading branch information
kevinbarabash authored Mar 14, 2024
1 parent b88e89f commit 62e4f13
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .changeset/little-dingos-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
17 changes: 16 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

0 comments on commit 62e4f13

Please sign in to comment.