@@ -15,7 +15,7 @@ export function validateFilePaths(textDocument: TextDocument): Diagnostic[] {
15
15
const pattern =
16
16
/ (?: \/ \* .* ?(? = \* \/ ) ) | ( \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;
17
17
18
- const commentPattern = / ( \/ \/ [ ^ \n ] * \n ) | ( \/ \* .* ? \* \/ ) / dgms;
18
+ const commentPattern = / ( \/ \/ [ ^ \n ] * [ \r \n ] ) | ( \/ \* .* ( \* \/ ) ) / dgms;
19
19
const commentRanges = text . matchAll ( commentPattern ) ;
20
20
21
21
let m : RegExpExecArray | null ;
@@ -27,21 +27,29 @@ export function validateFilePaths(textDocument: TextDocument): Diagnostic[] {
27
27
( m = pattern . exec ( text ) ) &&
28
28
problems < configService . globalSettings . maxNumberOfProblems
29
29
) {
30
+ console . log ( m ) ;
30
31
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
+
33
37
continue ;
34
38
}
39
+
35
40
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 ) ;
39
44
40
- if ( skip ) {
41
- continue ;
45
+ console . log ( 'Skip: ' , skip ) ;
46
+ if ( skip ) {
47
+ break ;
48
+ }
42
49
}
50
+
43
51
const normalizedPath = m [ 2 ] ? normalize ( m [ 2 ] . trim ( ) ) : null ;
44
- if ( normalizedPath && ! checkIfPathExists ( normalizedPath ) ) {
52
+ if ( ! skip && normalizedPath && ! checkIfPathExists ( normalizedPath ) ) {
45
53
problems ++ ;
46
54
const diagnostic : Diagnostic = {
47
55
severity : DiagnosticSeverity . Error ,
0 commit comments