for me the feature was disabled and i enabled it by clicking on "open in VS Code " button in this link
https://docs.github.com/en/copilot/how-tos/get-code-suggestions/get-ide-code-suggestions