@@ -19,6 +19,10 @@ export class DocommentDomainCSharp extends DocommentDomain {
19
19
/* @override */
20
20
public IsTriggerDocomment ( ) : boolean {
21
21
22
+ // NG: KeyCode is EMPTY
23
+ const isEmpty : boolean = this . _vsCodeApi . IsEmptyContentChanges ( this . _event ) ;
24
+ if ( isEmpty ) return false ;
25
+
22
26
// NG: KeyCode is NOT '/' or Enter
23
27
const activeChar : string = this . _vsCodeApi . ReadCharAtCurrent ( ) ;
24
28
if ( activeChar == null ) return false ;
@@ -36,16 +40,15 @@ export class DocommentDomainCSharp extends DocommentDomain {
36
40
// NG: Line is NOT /// (NG: ////)
37
41
const activeLine : string = this . _vsCodeApi . ReadLineAtCurrent ( ) ;
38
42
if ( activeLine == null ) return false ;
43
+
39
44
if ( isSlashKey ) {
40
- const isDocComment : boolean = SyntacticAnalysisCSharp . IsDocCommentStrict ( activeLine ) ;
41
- if ( ! isDocComment ) return false ;
45
+ if ( ! SyntacticAnalysisCSharp . IsDocCommentStrict ( activeLine ) ) return false ;
42
46
43
47
// NG: '/' => Insert => Event => ' /// '
44
48
if ( SyntacticAnalysisCSharp . IsDoubleDocComment ( activeLine ) ) return false ;
45
49
}
46
50
if ( this . _isEnterKey ) {
47
- const isDocComment : boolean = SyntacticAnalysisCSharp . IsDocComment ( activeLine ) ;
48
- if ( ! isDocComment ) return false ;
51
+ if ( ! SyntacticAnalysisCSharp . IsDocComment ( activeLine ) ) return false ;
49
52
}
50
53
51
54
// NG: Position is NOT ///
@@ -146,7 +149,7 @@ export class DocommentDomainCSharp extends DocommentDomain {
146
149
case CodeType . Comment :
147
150
return '/// ' ;
148
151
case CodeType . None :
149
- return ''
152
+ return '' ;
150
153
default :
151
154
return '' ;
152
155
}
@@ -170,7 +173,7 @@ export class DocommentDomainCSharp extends DocommentDomain {
170
173
const replaceSelection = this . _vsCodeApi . GetSelectionByPosition ( anchor , active ) ;
171
174
this . _vsCodeApi . ReplaceText ( replaceSelection , docomment ) ;
172
175
} else {
173
- const insertPosition : Position = this . _vsCodeApi . ShiftPositionChar ( position , 1 )
176
+ const insertPosition : Position = this . _vsCodeApi . ShiftPositionChar ( position , 1 ) ;
174
177
this . _vsCodeApi . InsertText ( insertPosition , docomment ) ;
175
178
}
176
179
}
0 commit comments