-
Notifications
You must be signed in to change notification settings - Fork 75
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
Grouping all comments in a chain at the beginning of it #708
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { | ||
util: { addDanglingComment } | ||
} = require('prettier'); | ||
|
||
function handleMemberAccessComments( | ||
text, | ||
precedingNode, | ||
enclosingNode, | ||
followingNode, | ||
comment | ||
) { | ||
if (enclosingNode && enclosingNode.type === 'MemberAccess') { | ||
addDanglingComment(enclosingNode, comment); | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
module.exports = handleMemberAccessComments; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this file be called also |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,59 @@ contract MemberAccess { | |
path, | ||
address(this, aoeu, aoeueu, aoeu) | ||
); | ||
|
||
// Comment before chain | ||
game. | ||
// CONFIG | ||
config. | ||
// Comment 1 | ||
// Comment 2 | ||
resolveWindow. | ||
// Comment 3 | ||
functionCall(/* inside function comment */). | ||
// Comment 4 | ||
array[/* inside array comment */ 1]. | ||
// Comment 5 | ||
call{value: 10, gas: 800}(); | ||
|
||
|
||
// Comment before chain | ||
game. | ||
// CONFIG | ||
config. | ||
// Comment 1 | ||
// Comment 2 | ||
resolveWindow. | ||
// Comment 3 | ||
functionCall(/* inside function comment */). | ||
// Comment 4 | ||
array[/* inside array comment */ 1]. | ||
// Comment 5 | ||
endOfChain; | ||
|
||
|
||
// Comment before chain | ||
game. | ||
// CONFIG | ||
config. | ||
// Comment 1 | ||
// Comment 2 | ||
resolveWindow. | ||
// Comment 3 | ||
functionCall(/* inside function comment */). | ||
// Comment 4 | ||
endOfChain; | ||
|
||
|
||
// Comment before chain | ||
game. | ||
// CONFIG | ||
config. | ||
// Comment 1 | ||
// Comment 2 | ||
resolveWindow. | ||
// Comment 3 | ||
endOfChain; | ||
} | ||
} | ||
|
||
|
@@ -195,6 +248,59 @@ contract MemberAccess { | |
path, | ||
address(this, aoeu, aoeueu, aoeu) | ||
); | ||
|
||
// Comment before chain | ||
// CONFIG | ||
// Comment 1 | ||
// Comment 2 | ||
// Comment 3 | ||
// Comment 4 | ||
// Comment 5 | ||
Comment on lines
+252
to
+258
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this what we would like to achieve? Move all the comments above the chain? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll give it a try |
||
game | ||
.config | ||
.resolveWindow | ||
.functionCall() /* inside function comment */ | ||
.array[ | ||
/* inside array comment */ | ||
1 | ||
] | ||
.call{value: 10, gas: 800}(); | ||
|
||
// Comment before chain | ||
// CONFIG | ||
// Comment 1 | ||
// Comment 2 | ||
// Comment 3 | ||
// Comment 4 | ||
// Comment 5 | ||
game | ||
.config | ||
.resolveWindow | ||
.functionCall() /* inside function comment */ | ||
.array[ | ||
/* inside array comment */ | ||
1 | ||
] | ||
.endOfChain; | ||
|
||
// Comment before chain | ||
// CONFIG | ||
// Comment 1 | ||
// Comment 2 | ||
// Comment 3 | ||
// Comment 4 | ||
game | ||
.config | ||
.resolveWindow | ||
.functionCall() /* inside function comment */ | ||
.endOfChain; | ||
|
||
// Comment before chain | ||
// CONFIG | ||
// Comment 1 | ||
// Comment 2 | ||
// Comment 3 | ||
game.config.resolveWindow.endOfChain; | ||
} | ||
} | ||
|
||
|
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.
not all these params have been used; maybe pass an object into the function instead of all these params?