dotnet / dotnet/fsharp

Copilot indentation

Open
#15,676 7 comments 3 reactions 1 assignee Claimed by @0101 View on GitHub
AI-thinks-windows-only Area-VS-Editor Bug Impact-Medium Tracking-External
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 22h
Merged PRs (30d)
144

Description

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.

![CopilotTabsFsharpIssue](https://github.com/dotnet/fsharp/assets/19760720/23564e3c-4c08-47fb-89b9-21b25c358f2a)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.