File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
main/java/com/github/_1c_syntax/utils
test/java/com/github/_1c_syntax/utils Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,12 @@ private static String encodePath(String path) {
88
88
.replace (" " , "%20" )
89
89
.replace ("[" , "%91" )
90
90
.replace ("]" , "%93" )
91
+ .replace ("?" , "%3F" )
92
+ .replace ("{" , "%7B" )
93
+ .replace ("}" , "%7D" )
94
+ .replace (":" , "%3A" )
95
+ .replace ("\" " , "%22" )
96
+ .replace ("\\ " , "%5C" )
91
97
;
92
98
}
93
99
Original file line number Diff line number Diff line change @@ -148,4 +148,28 @@ void testUriFromStringWithBrackets() {
148
148
assertThat (uri .toString ()).doesNotContain ("[" );
149
149
assertThat (uri .toString ()).doesNotContain ("]" );
150
150
}
151
+
152
+ @ Test
153
+ void testUriFromGitLens () {
154
+ // given
155
+ var uriString = "gitlens://d5ff5b3/d%3A/git/repo/src/cf/Documents/Some/Ext/ObjectModule.bsl?%7B%22path%22%3A%22%2Fd%3A%2Fgit%2Frepo%2Fsrc%2Fcf%2FDocuments%2FSome%2FExt%2FObjectModule.bsl%22%2C%22ref%22%3A%22d5ff5b3c52bdd1f26f838944ec99f62346d2771b%22%2C%22repoPath%22%3A%22d%3A%2Fgit%2Frepo%22%7D" ;
156
+
157
+ // when
158
+ var uri = Absolute .uri (uriString );
159
+
160
+ // then
161
+ assertThat (uri .getPath ()).endsWith ("\" repoPath\" :\" d:/git/repo\" }" );
162
+ }
163
+
164
+ @ Test
165
+ void testUriFromGit () {
166
+ // given
167
+ var uriString = "git:/e%3A/user/repo/Some/Module.bsl?%7B%22path%22%3A%22e%3A%5C%5Cuser%5C%5Crepo%5C%5CSome%5C%5CModule.bsl%22%2C%22ref%22%3A%22~%22%7D" ;
168
+
169
+ // when
170
+ var uri = Absolute .uri (uriString );
171
+
172
+ // then
173
+ assertThat (uri .getPath ()).endsWith ("\" ref\" :\" ~\" }" );
174
+ }
151
175
}
You can’t perform that action at this time.
0 commit comments