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

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

Closed
dmitrysonder opened this issue Dec 25, 2024 · 0 comments · Fixed by #236941
Closed
Assignees
Labels
unreleased Patch has not yet been released in VS Code Insiders
Milestone

Comments

@dmitrysonder
Copy link
Contributor

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

@vs-code-engineering vs-code-engineering bot added the unreleased Patch has not yet been released in VS Code Insiders label Jan 6, 2025
@vs-code-engineering vs-code-engineering bot added this to the January 2025 milestone Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unreleased Patch has not yet been released in VS Code Insiders
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants