File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -109,9 +109,23 @@ function getSourcedPathInfoFromNode({
109109 }
110110
111111 if ( argumentNode . type === 'string' || argumentNode . type === 'raw_string' ) {
112+ const stringContents = argumentNode . text . slice ( 1 , - 1 )
112113 if ( argumentNode . namedChildren . length === 0 ) {
113114 return {
114- sourcedPath : argumentNode . text . slice ( 1 , - 1 ) ,
115+ sourcedPath : stringContents ,
116+ }
117+ } else if ( argumentNode . namedChildren . length === 1 ) {
118+ const [ variableNode ] = argumentNode . namedChildren
119+ if (
120+ variableNode . type == 'simple_expansion' ||
121+ variableNode . type == 'expansion'
122+ ) {
123+ const variableText = `${ variableNode . text } `
124+ if ( stringContents . startsWith ( variableText + '/' ) ) {
125+ return {
126+ sourcedPath : '.' + stringContents . slice ( variableText . length ) ,
127+ }
128+ }
115129 }
116130 }
117131 }
You can’t perform that action at this time.
0 commit comments