File tree Expand file tree Collapse file tree 2 files changed +29
-13
lines changed Expand file tree Collapse file tree 2 files changed +29
-13
lines changed Original file line number Diff line number Diff line change 52
52
"minItems" : 1 ,
53
53
"uniqueItems" : true ,
54
54
"description" : " Multiple folders"
55
+ },
56
+ "laravel_goto_view.extensions" : {
57
+ "type" : " object" ,
58
+ "default" : {
59
+ "default" : " .blade.php"
60
+ },
61
+ "items" : {
62
+ "type" : " string"
63
+ },
64
+ "minItems" : 1 ,
65
+ "uniqueItems" : true ,
66
+ "description" : " Multiple extensions"
55
67
}
56
68
}
57
69
}
Original file line number Diff line number Diff line change @@ -15,27 +15,31 @@ export function getFilePaths(text:string, document:TextDocument): any {
15
15
let result = [ ] ;
16
16
if ( text . indexOf ( "::" ) != - 1 ) {
17
17
let info = text . split ( '::' ) ;
18
- let showPath = config . folders [ info [ 0 ] ] + "/" + info [ 1 ] . replace ( / \. / g, '/' ) + ".blade.php" ;
19
- let filePath = workspaceFolder + showPath ;
20
- if ( fs . existsSync ( filePath ) ) {
21
- result . push ( {
22
- "name" : info [ 0 ] ,
23
- "showPath" : showPath ,
24
- "fileUri" : Uri . file ( filePath )
25
- } ) ;
26
- }
27
- } else {
28
- for ( let item in config . folders ) {
29
- let showPath = config . folders [ item ] + "/" + text . replace ( / \. / g, '/' ) + ".blade.php" ;
18
+ for ( let extension in config . extensions ) {
19
+ let showPath = config . folders [ info [ 0 ] ] + "/" + info [ 1 ] . replace ( / \. / g, '/' ) + config . extensions [ extension ] ;
30
20
let filePath = workspaceFolder + showPath ;
31
21
if ( fs . existsSync ( filePath ) ) {
32
22
result . push ( {
33
- "name" : item ,
23
+ "name" : info [ 0 ] ,
34
24
"showPath" : showPath ,
35
25
"fileUri" : Uri . file ( filePath )
36
26
} ) ;
37
27
}
38
28
}
29
+ } else {
30
+ for ( let item in config . folders ) {
31
+ for ( let extension in config . extensions ) {
32
+ let showPath = config . folders [ item ] + "/" + text . replace ( / \. / g, '/' ) + config . extensions [ extension ] ;
33
+ let filePath = workspaceFolder + showPath ;
34
+ if ( fs . existsSync ( filePath ) ) {
35
+ result . push ( {
36
+ "name" : item ,
37
+ "showPath" : showPath ,
38
+ "fileUri" : Uri . file ( filePath )
39
+ } ) ;
40
+ }
41
+ }
42
+ }
39
43
}
40
44
41
45
return result ;
You can’t perform that action at this time.
0 commit comments