Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Code is formatted incorrectly after code completion #987

Closed
pkukielka opened this issue Mar 6, 2024 · 1 comment · Fixed by #1005
Closed

bug: Code is formatted incorrectly after code completion #987

pkukielka opened this issue Mar 6, 2024 · 1 comment · Fixed by #1005
Assignees
Labels
bug Something isn't working

Comments

@pkukielka
Copy link
Contributor

Installation Information

Standard installation, all versions

Describe the bug

image
https://twitter.com/danaketh/status/1765117259234603500

Expected behavior

Could should always be formatted correctly

Additional context

IntelliJ formatting have separate action which we could just call after the completion is done.
We try to make sure we insert completion at the right position regarding surrounding text, but I guess it might not be 100% robust. Also it won't help for adjusting e.g. whole completion block to the project coding standard, and using IJ formatter would help there.

@pkukielka pkukielka added the bug Something isn't working label Mar 6, 2024
@taylorsperry
Copy link
Contributor

Similar report here https://github.com/sourcegraph/sourcegraph/issues/60590

(And thank you for beating me to creating this issue, @pkukielka !)

pkukielka added a commit that referenced this issue Mar 12, 2024
Fixes  #987

## Changes

Fixed formatting (previously non-existing) for single line completions,
simplified the code, and added the tests.

## Test plan

Automatic tests for formatter were added.
Additionally manual QA was done using `TESTING.MD` section `Single-line
autocomplete' and `Multi-line autocomplete`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants