[go: up one dir, main page]

Skip to content

Apply consistent defaults to Web IDE and Single File Editor

Release notes

Problem to solve

The default behavior of the Web IDE and Single File Editor are inconsistent. Specifically around how they handle trailing newline characters.

Proposal

Evaluate the default behavior of both editors and make them consistent. This will be blocked by our implementation of .editorconfig values in the Single File Editor (Editor Lite) but once that work is completed, we would want the Web IDE and Single File Editor to behave consistently by default.

Behavior Web IDE default SFE default
Add newline at end of file

Approach

From the comments

In general, the rough implementation plan could look like:

  • create a new extension for the Source Editor
  • take out the .editorconfig functionality out of app/assets/javascripts/ide/components/repo_editor.vue and move it into the new extension adapting it to work in the stateless env (we don't have access to the WebIDE's state here)
  • use the extension in WebIDE (repo_editor.vue) and in the blob edit (app/assets/javascripts/blob_edit/edit_blob.js)

Testing

This can potentially break some E2E tests that manipulate content within editors. Please run package-and-qa and notify the SET in case of any failures - we will need to fix it within the same MR.

Edited by Anastasia McDonald