Skip to content

Refactor: Event Names Consistency. Use EventType constants everywhere if possible #236939

@dmitrysonder

Description

@dmitrysonder

Description:
In the VSCode codebase, event types like 'mouseup', 'contextmenu', etc., are often hardcoded instead of using predefined constants such as those in dom.EventType

Proposed Solution:
Replace hardcoded event names with the corresponding constants available in EventType.

For example:

// Current usage:
dom.addDisposableListener(target, 'mouseup', callback);

// Suggested usage:
dom.addDisposableListener(target, dom.EventType.MOUSE_UP, callback);

Issue found in files:

src/vs/editor/browser/editorDom.ts
src/vs/workbench/electron-sandbox/parts/titlebar/titlebarPart.ts

Metadata

Metadata

Assignees

Labels

insiders-releasedPatch has been released in VS Code Insiders

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions