File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Extension/src/LanguageServer Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -386,6 +386,13 @@ export class CppSettings extends Settings {
386386 public get commentContinuationPatterns ( ) : ( string | CommentPattern ) [ ] {
387387 const value : any = super . Section . get < any > ( "commentContinuationPatterns" ) ;
388388 if ( this . isArrayOfCommentContinuationPatterns ( value ) ) {
389+ // Needs to be sorted with longer patterns first so it takes precedence and
390+ // doesn't apply the shorter pattern if it's a prefix (e.g. // matching ///).
391+ value . sort ( ( a : string | CommentPattern , b : string | CommentPattern ) => {
392+ const aStr : string = isString ( a ) ? a : a . begin ;
393+ const bStr : string = isString ( b ) ? b : b . begin ;
394+ return bStr . length - aStr . length ;
395+ } ) ;
389396 return value ;
390397 }
391398 const setting = getRawSetting ( "C_Cpp.commentContinuationPatterns" , true ) ;
You can’t perform that action at this time.
0 commit comments