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

Open
dmitrysonder opened this issue Dec 25, 2024 · 0 comments · May be fixed by #236941
Open

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

dmitrysonder opened this issue Dec 25, 2024 · 0 comments · May be fixed by #236941
Assignees

Comments

@dmitrysonder
Copy link

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

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 a pull request may close this issue.

2 participants