feat(commands): add insertFinalNewLine#241126
Merged
alexdima merged 4 commits intomicrosoft:mainfrom Feb 19, 2025
SunsetTechuila:insertfinalnewline-command
Merged
feat(commands): add insertFinalNewLine#241126alexdima merged 4 commits intomicrosoft:mainfrom SunsetTechuila:insertfinalnewline-command
insertFinalNewLine#241126alexdima merged 4 commits intomicrosoft:mainfrom
SunsetTechuila:insertfinalnewline-command
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Contributor
There was a problem hiding this comment.
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
alexdima
approved these changes
Feb 19, 2025
aeschli
approved these changes
Feb 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves #241075