forked from rome/tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rome_js_parser): EcmaScript @decorators rome#4252
Implement basic decorator cases for classes
- Loading branch information
1 parent
f6ada3a
commit 41265f0
Showing
207 changed files
with
6,795 additions
and
2,469 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use crate::prelude::*; | ||
use rome_js_syntax::JsDecorator; | ||
use rome_rowan::AstNode; | ||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatJsDecorator; | ||
impl FormatNodeRule<JsDecorator> for FormatJsDecorator { | ||
fn fmt_fields(&self, node: &JsDecorator, f: &mut JsFormatter) -> FormatResult<()> { | ||
format_verbatim_node(node.syntax()).fmt(f) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use crate::prelude::*; | ||
use rome_js_syntax::JsDecoratorList; | ||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatJsDecoratorList; | ||
impl FormatRule<JsDecoratorList> for FormatJsDecoratorList { | ||
type Context = JsFormatContext; | ||
fn fmt(&self, node: &JsDecoratorList, f: &mut JsFormatter) -> FormatResult<()> { | ||
f.join_with(&soft_line_break_or_space()) | ||
.entries(node.iter().formatted()) | ||
.finish() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.