From fe8d06b94a1e3540f9c903b32a05237ec650ecda Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Sat, 24 Feb 2024 11:29:24 -0600 Subject: [PATCH] Add Pop Open The Quick Fix Window as a VS Code TIL --- README.md | 3 ++- vscode/pop-open-the-quick-fix-window.md | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 vscode/pop-open-the-quick-fix-window.md diff --git a/README.md b/README.md index 64fa023..b1d52a7 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186). -_1374 TILs and counting..._ +_1375 TILs and counting..._ --- @@ -1576,6 +1576,7 @@ _1374 TILs and counting..._ - [Advance Through Search Results](vscode/advance-through-search-results.md) - [Enable Breadcrumbs For Version 1.26 Release](vscode/enable-breadcrumbs-for-version-126-release.md) - [Open An Integrated Terminal Window](vscode/open-an-integrated-terminal-window.md) +- [Pop Open The Quick Fix Window](vscode/pop-open-the-quick-fix-window.md) - [Step Through Project-Wide Search Results](vscode/step-through-project-wide-search-results.md) - [Toggle Between Terminals](vscode/toggle-between-terminals.md) diff --git a/vscode/pop-open-the-quick-fix-window.md b/vscode/pop-open-the-quick-fix-window.md new file mode 100644 index 0000000..a7815a8 --- /dev/null +++ b/vscode/pop-open-the-quick-fix-window.md @@ -0,0 +1,21 @@ +# Pop Open The Quick Fix Window + +Often when I see a red squiggly in VS Code, it is because I'm missing an import +for entity in my code. I have a couple options. + +1. I could scroll to the top of the file and manually add the import to my list + of imports. +2. I can mouse over the offending function to see the error, carefully mouse + over to _Quick Fix_ link, and get at the quick fix list that way. + +There is a better third way. + +Once my cursor (not the just the mouse pointer) is on the offending item, I can +hit `Cmd+.`. That directly pops open the Quick Fix window with focus on the +first item in that window. I can navigate to the fix I want and hit enter. + +Another thing to keep in mind. As you're typing out an un-imported entity, if +VS Code knows about it, it will show it as an auto-complete option with the +package it comes from. If you tab-out the one you want, not only will it fill +in the rest of the entity name, but it will also auto-add the import at the top +of your file.