Code completions are not shown complete on the VSCode UI because extension sends the json payload with CRLF line endings
Checklist
-
I'm using the latest version of the extension (see the latest version in the right column of this page) - Extension version: Put your extension version here
-
I'm using the latest Visual Studio 2022 version (find the latest version here) - Visual Studio 2022 version: Put your Visual Studio 2022 version here
-
I'm using a supported version of GitLab (see README for the supported version) - GitLab version: Put your GitLab version here, or say "happens on
gitlab.com"
- GitLab version: Put your GitLab version here, or say "happens on
Summary
Code completion is showing incomplete results on VSCode IDE is used when VSCode doesn't enforce LF line endings because the payload has CLRF line endings.
Steps to reproduce
- Use the API to generate code completions.
- In the
current_file.content_above_cursorandcurrent_file.content_below_cursoruse\r\ninstead of\n. - Response generated is partial and not complete
- Alternatively, use VSCode with CLRF line endings.
What is the current bug behavior?
Code suggestions are incomplete
What is the expected correct behavior?
Code suggestions should be complete even when CLRF line endings used in VSCode.
Relevant logs and/or screenshots
Workaround
Configure VS Code to use Unix line endings by default:
- Open Settings (Ctrl + ,).
- Search for "End of Line".
- Set "Files: Eol" to \n (LF).