fsharp
fsharp copied to clipboard
Copilot indentation
I have been enjoying using copilot with F#. It writes routine code really well.
Copilot fails to indent code properly when starting on an empty line with the cursor indented.
A typical case is:
- Write some code and press return. The F# editor place the cursor on a reasonable line although no actual spaces are added yet.
- Copilot makes a suggestion in grey.
- Press tab. This inserts the suggestion, but the first line of the suggestion doesn't have the indent.
This gif shows copilot correctly writing a serializer line, but 1. with incorrect spacing in normal use, 2. with incorrect spacing after manually moving the cursor to the start of the line, 3. with correct spacing after manually typing in spaces before accepting.
@0101 Did we get any asnwer from the copilot/editor team on why does it behave the way it does?
No. They know about it but didn't look into it or give us access to the source so we could investigate ourselves, so at the moment it's stuck.
A workaround is to type space, backspace, tab instead of just tab.
Might be worth noting this originally worked perfectly fine, somewhere along the way an update messed things up.
JSON and YAML have the same issue
FYI this bug has been assigned to someone on the Copilot team.
Seems to be working with VS Version 17.9.0 Preview 3.0