-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Doc comments highlight improvements + closing auto-insertion #5109
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #5109 +/- ##
==========================================
- Coverage 86.94% 86.94% -0.01%
==========================================
Files 561 562 +1
Lines 44962 44968 +6
Branches 6913 6919 +6
==========================================
+ Hits 39094 39099 +5
- Misses 5868 5869 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
src/mode/c_cpp.js
Outdated
var CStyleFoldMode = require("./folding/cstyle").FoldMode; | ||
|
||
var Mode = function() { | ||
this.HighlightRules = c_cppHighlightRules; | ||
|
||
this.$outdent = new MatchingBraceOutdent(); | ||
this.$behaviour = new CstyleBehaviour(); | ||
this.$behaviour = new CstyleBehaviour({closeDocComment: true}); |
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.
where do we need this to be false? maybe it would be better to make it true by default?
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.
I am not sure if this would be the right approach. For example, Python uses this.$behaviour = this.$defaultBehaviour;
, which is essentially a generic CStyleBehaviour
. However, Python itself employs a different syntax for docstrings, without using /**
. It would work as expected because I check if the state is doc-start
, but I am not sure if making closeDocComment: true
the default setting is the correct approach in general.
}, | ||
"start": [ | ||
{ | ||
token: ["comment.doc.tag", "text", "lparen.doc"], |
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.
should this be in generic doc_comment highlight rules or specific to js and ts?
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.
You are right, this seems should be specific to js and ts
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.
But also most of languages doesn't have specific tags starting with @ , which were in DocCommentHighlightRules
before I changed it, what should I do with it?
src/mode/edifact.js
Outdated
|
||
var Mode = function() { | ||
|
||
this.HighlightRules = EdifactHighlightRules; | ||
this.$behaviour = new CstyleBehaviour(); |
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 we still need these instead of relying on default?
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.
We could rely on default
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.
Replaced all new CstyleBehaviour()
to default ones
…auto-closing doc comments
…er document comments
0e2ec91
to
536939d
Compare
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.