File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 7171 "type" : " boolean" ,
7272 "default" : true ,
7373 "description" : " Removes the leading ./ character when the path is pointing to a parent folder."
74+ },
75+ "relativePath.omitParts" : {
76+ "type" : " arary" ,
77+ "default" : [
78+ " \\ /index$"
79+ ],
80+ "description" : " Omit path parts by matched Regular Expressions"
7481 }
7582 }
7683 }
Original file line number Diff line number Diff line change @@ -211,6 +211,12 @@ class RelativePath {
211211 relativeUrl = relativeUrl . substring ( 2 , relativeUrl . length ) ;
212212 }
213213
214+ if ( this . _configuration . omitParts ) {
215+ this . _configuration . omitParts . forEach ( omitRegexp => {
216+ relativeUrl = relativeUrl . replace ( new RegExp ( omitRegexp ) , '' ) ;
217+ } ) ;
218+ }
219+
214220 window . activeTextEditor . edit (
215221 ( editBuilder : TextEditorEdit ) => {
216222 let position : Position = window . activeTextEditor . selection . end ;
You can’t perform that action at this time.
0 commit comments