@@ -15,7 +15,7 @@ export function validateFilePaths(textDocument: TextDocument): Diagnostic[] {
1515 const pattern =
1616 / (?: \/ \* .* ?(? = \* \/ ) ) | ( \t * (?: S c r i p t P a t h | I n c l u d e F i l e | L o g o F i l e | F i l e P a t h | S k i n F i l e ) \s * = \s * ) ( .* ?) (? = (?: $ | \/ \/ | \/ \* | (?: \s + (?: \/ \/ .* | \/ \* .* ) ) ) ) / dgms;
1717
18- const commentPattern = / ( \/ \/ [ ^ \n ] * \n ) | ( \/ \* .* ? \* \/ ) / dgms;
18+ const commentPattern = / ( \/ \/ [ ^ \n ] * [ \r \n ] ) | ( \/ \* .* ( \* \/ ) ) / dgms;
1919 const commentRanges = text . matchAll ( commentPattern ) ;
2020
2121 let m : RegExpExecArray | null ;
@@ -27,21 +27,29 @@ export function validateFilePaths(textDocument: TextDocument): Diagnostic[] {
2727 ( m = pattern . exec ( text ) ) &&
2828 problems < configService . globalSettings . maxNumberOfProblems
2929 ) {
30+ console . log ( m ) ;
3031 let skip = false ;
31- for ( const comment of commentRanges ) {
32- if ( ! ( comment . index && comment . length ) ) {
32+ for ( const comment of text . matchAll ( commentPattern ) ) {
33+ console . log ( 'Comment:' , comment ) ;
34+ if ( ! comment . index ) {
35+ console . log ( 'no index' ) ;
36+
3337 continue ;
3438 }
39+
3540 skip =
36- ( comment . index < m . index && comment . index + comment . length > m . index ) ||
37- ( comment . index > m . index && comment . index < m . index + m . length ) ;
38- }
41+ ( comment . index <= m . index &&
42+ comment . index + comment [ 0 ] . length >= m . index ) ||
43+ ( comment . index >= m . index && comment . index <= m . index + m [ 0 ] . length ) ;
3944
40- if ( skip ) {
41- continue ;
45+ console . log ( 'Skip: ' , skip ) ;
46+ if ( skip ) {
47+ break ;
48+ }
4249 }
50+
4351 const normalizedPath = m [ 2 ] ? normalize ( m [ 2 ] . trim ( ) ) : null ;
44- if ( normalizedPath && ! checkIfPathExists ( normalizedPath ) ) {
52+ if ( ! skip && normalizedPath && ! checkIfPathExists ( normalizedPath ) ) {
4553 problems ++ ;
4654 const diagnostic : Diagnostic = {
4755 severity : DiagnosticSeverity . Error ,
0 commit comments