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

feat(commands): add insertFinalNewLine #241126

Merged
merged 4 commits into from
Feb 19, 2025

Conversation

SunsetTechuila
Copy link
Contributor

resolves #241075

@SunsetTechuila

This comment was marked as outdated.

@SunsetTechuila SunsetTechuila force-pushed the insertfinalnewline-command branch from 7550f46 to 457892a Compare February 19, 2025 05:59
@SunsetTechuila SunsetTechuila marked this pull request as ready for review February 19, 2025 06:00
@alexdima alexdima requested a review from Copilot February 19, 2025 14:56

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This pull request introduces a new command that automatically inserts a final new line into the text model if one isn’t present. Key changes include:

  • Implementation of the InsertFinalNewLineCommand, which computes and applies the edit operation for inserting the final new line.
  • Addition of the InsertFinalNewLineAction that integrates the command into the editor action framework.
  • Registration of the new command in the global editor module through an updated import in editor.all.ts.

Changes

File Description
src/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLineCommand.ts Contains the logic to insert a final new line if required.
src/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.ts Defines the editor action that triggers the final new line insertion command.
src/vs/editor/editor.all.ts Registers the new final new line command with the editor.

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more

@vs-code-engineering vs-code-engineering bot added this to the February 2025 milestone Feb 19, 2025
@alexdima alexdima enabled auto-merge (squash) February 19, 2025 14:58
@alexdima alexdima merged commit df7858b into microsoft:main Feb 19, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a editor.action.insertFinalNewLine command
3 participants