-
-
Notifications
You must be signed in to change notification settings - Fork 192
Emmet Integration #2105
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
Emmet Integration #2105
Conversation
|
| if (newEditor) { | ||
| // Add listener to new editor | ||
| newEditor.off("change", handleKeyEvent); | ||
| newEditor.on("keydown", handleKeyEvent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
off, then on is usually used to prevent event handler leaks. so always do editor.off(someEvent, handler) and then editor.on(someEvent, handler)
| } | ||
| if (newEditor) { | ||
| // Add listener to new editor | ||
| newEditor.off("change", handleKeyEvent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why both change and keydown handler?
| } | ||
|
|
||
| if (fileType === "css" || fileType === "scss" || fileType === "less") { | ||
| return { syntax: "css", type: "stylesheet" }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do verify that they share the same syntax code and not a specific less syntax is present.
| const fileType = editor.document.getLanguage().getId(); | ||
|
|
||
| if (fileType === "html") { | ||
| return { syntax: "html", type: "markup" }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verify that emmenct can be used for php/jsp and other html like languages. Consider those languages too.



This PR adds built-in Emmet support to Phoenix.
Expands Emmet abbreviation on Tab key press.
Places the cursor at the correct position after expansion, in a manner that users can directly start typing.
Preserves indentation to match the surrounding code.
Untitled.video.-.Made.with.Clipchamp.4.mp4