Skip to content

Conversation

@c-claeys
Copy link
Contributor

@c-claeys c-claeys commented Jun 26, 2024

I noticed that in src/vs/workbench/services/preferences/browser/preferencesService.ts CoreEditingCommands.LineBreakInsert.runEditorCommand is called twice with a null accessor, as well as in src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts.

Goto def took me to the abstract EditorCommand.runEditorCommand where this is allowed. However, find all implementations shows many cases which suggest narrower (non-null) typing. .runEditorCommand may be type-checked against this abstract implementation (see the aforementioned goto def) which can lead to disconnects between function calls and implementations.

I've updated this typing to be more consistent. I expect the | undefined -> | null changes to be essentially no-ops. The cases where I've introduced early returns, optional chaining, etc. I tried to follow local norms.

Copy link
Member

@alexdima alexdima left a comment

Choose a reason for hiding this comment

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

Thank you and apologies for the slow turn-around time!

@vs-code-engineering vs-code-engineering bot added this to the July 2025 milestone Jul 15, 2025
@alexdima alexdima enabled auto-merge (squash) July 15, 2025 17:56
@alexdima alexdima merged commit f1c597b into microsoft:main Jul 15, 2025
17 checks passed
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Aug 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants