Title is supposed to read "#file", not "File". HN reformatted it.
I was mostly using Copilot for boilerplate until I discovered #file. It vastly improves the quality/types of code that Copilot can generate.
How it works:
- Type #file into Copilot Chat as part of your message. A dropdown pops up.
- Start typing the name of a file.
- It fuzzy searches the filenames in your workspace.
- Press Enter to select a file.
- Copilot reads its contents into its context.
The real power here is in including multiple files, which you can do by using #file multiple times in a single message.
Copilot can write entire classes this way with some decent prompts and enough context. Of course you still need to code review and test it. But it's much closer to the promise of an engineering assistant than without.
I'm sure this is old news to many using Copilot, but just wanted to share.