Skip to content

Commit 11a70bd

Browse files
committed
Merge branch 'main' into sandy081/profiles-enable-web
2 parents 2a4e52e + 5ccf7c4 commit 11a70bd

File tree

26 files changed

+277
-121
lines changed

26 files changed

+277
-121
lines changed

extensions/markdown-language-features/extension.webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ module.exports = withDefaults({
1515
mainFields: ['module', 'main']
1616
},
1717
entry: {
18-
extension: './src/extension.node.ts',
18+
extension: './src/extension.ts',
1919
}
2020
});

extensions/markdown-language-features/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"engines": {
1111
"vscode": "^1.20.0"
1212
},
13-
"main": "./out/extension.node",
13+
"main": "./out/extension",
1414
"browser": "./dist/browser/extension",
1515
"categories": [
1616
"Programming Languages"

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@
8585
"vscode-proxy-agent": "^0.12.0",
8686
"vscode-regexpp": "^3.1.0",
8787
"vscode-textmate": "7.0.1",
88-
"xterm": "4.20.0-beta.5",
88+
"xterm": "4.20.0-beta.6",
8989
"xterm-addon-search": "0.10.0-beta.1",
9090
"xterm-addon-serialize": "0.8.0-beta.1",
9191
"xterm-addon-unicode11": "0.4.0-beta.3",
92-
"xterm-addon-webgl": "0.13.0-beta.2",
93-
"xterm-headless": "4.20.0-beta.5",
92+
"xterm-addon-webgl": "0.13.0-beta.3",
93+
"xterm-headless": "4.20.0-beta.6",
9494
"yauzl": "^2.9.2",
9595
"yazl": "^2.4.3"
9696
},

remote/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
"vscode-proxy-agent": "^0.12.0",
2525
"vscode-regexpp": "^3.1.0",
2626
"vscode-textmate": "7.0.1",
27-
"xterm": "4.20.0-beta.5",
27+
"xterm": "4.20.0-beta.6",
2828
"xterm-addon-search": "0.10.0-beta.1",
2929
"xterm-addon-serialize": "0.8.0-beta.1",
3030
"xterm-addon-unicode11": "0.4.0-beta.3",
31-
"xterm-addon-webgl": "0.13.0-beta.2",
32-
"xterm-headless": "4.20.0-beta.5",
31+
"xterm-addon-webgl": "0.13.0-beta.3",
32+
"xterm-headless": "4.20.0-beta.6",
3333
"yauzl": "^2.9.2",
3434
"yazl": "^2.4.3"
3535
},

remote/web/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"tas-client-umd": "0.1.6",
1212
"vscode-oniguruma": "1.6.1",
1313
"vscode-textmate": "7.0.1",
14-
"xterm": "4.20.0-beta.5",
14+
"xterm": "4.20.0-beta.6",
1515
"xterm-addon-search": "0.10.0-beta.1",
1616
"xterm-addon-unicode11": "0.4.0-beta.3",
17-
"xterm-addon-webgl": "0.13.0-beta.2"
17+
"xterm-addon-webgl": "0.13.0-beta.3"
1818
}
1919
}

remote/web/yarn.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ [email protected]:
7878
resolved "https://registry.yarnpkg.com/xterm-addon-unicode11/-/xterm-addon-unicode11-0.4.0-beta.3.tgz#f350184155fafd5ad0d6fbf31d13e6ca7dea1efa"
7979
integrity sha512-FryZAVwbUjKTmwXnm1trch/2XO60F5JsDvOkZhzobV1hm10sFLVuZpFyHXiUx7TFeeFsvNP+S77LAtWoeT5z+Q==
8080

81-
82-
version "0.13.0-beta.2"
83-
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.13.0-beta.2.tgz#f58a7a3641ad7c8ac82dd24cfb0165656ed9ac1c"
84-
integrity sha512-98tX0BkpD402RoCO6SyikUXpzCn9/OQhlXsRmM/kRFCxMWWofStWTXzCPhN0MjIx2IdGueDjCmnShhidwihErg==
85-
86-
87-
version "4.20.0-beta.5"
88-
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.20.0-beta.5.tgz#d707b0dcb477a554135fb767b24003fced079866"
89-
integrity sha512-KBWfk9UPBKRy662DVGGTZEcW1becEjYvlyWbn2hLj9h2gy6Q4EEEEbggJh8I7SGwdFizl+apHQGhEOZmFCA70w==
81+
82+
version "0.13.0-beta.3"
83+
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.13.0-beta.3.tgz#2b456c3105238e64b40a30787d6335f5f6f85abb"
84+
integrity sha512-DFGcXAolA0VTsOLIKcORxUOp/FTJdD/YiRzKVLARjgOycwVRKvW2L5Tge8Z7ysZ16sKfnV2vCXyonXYfUWozXw==
85+
86+
87+
version "4.20.0-beta.6"
88+
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.20.0-beta.6.tgz#3ed87ba383a5cf44284098278f714df7113e3e3c"
89+
integrity sha512-xJd6vyOuYo4Ht/hTY3DyXGIj0U6kHjr2vWQ1lRmearo3t7QKf7uqOAAfTLeWt/g1P8qe/r0DnsNTeag6vI9RVw==

remote/yarn.lock

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -803,20 +803,20 @@ [email protected]:
803803
resolved "https://registry.yarnpkg.com/xterm-addon-unicode11/-/xterm-addon-unicode11-0.4.0-beta.3.tgz#f350184155fafd5ad0d6fbf31d13e6ca7dea1efa"
804804
integrity sha512-FryZAVwbUjKTmwXnm1trch/2XO60F5JsDvOkZhzobV1hm10sFLVuZpFyHXiUx7TFeeFsvNP+S77LAtWoeT5z+Q==
805805

806-
807-
version "0.13.0-beta.2"
808-
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.13.0-beta.2.tgz#f58a7a3641ad7c8ac82dd24cfb0165656ed9ac1c"
809-
integrity sha512-98tX0BkpD402RoCO6SyikUXpzCn9/OQhlXsRmM/kRFCxMWWofStWTXzCPhN0MjIx2IdGueDjCmnShhidwihErg==
810-
811-
812-
version "4.20.0-beta.5"
813-
resolved "https://registry.yarnpkg.com/xterm-headless/-/xterm-headless-4.20.0-beta.5.tgz#edcff27eb6437d158e6aea2ed7658e783bee5641"
814-
integrity sha512-8SnVUsuNUrQ5P0XU/9Iau3uK7Tf8q/p0KHHwkwJXVxZDIlaDH9XKSs91U9BjJJE3sJgRxH4NSiDYR3vFLSFpxw==
815-
816-
817-
version "4.20.0-beta.5"
818-
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.20.0-beta.5.tgz#d707b0dcb477a554135fb767b24003fced079866"
819-
integrity sha512-KBWfk9UPBKRy662DVGGTZEcW1becEjYvlyWbn2hLj9h2gy6Q4EEEEbggJh8I7SGwdFizl+apHQGhEOZmFCA70w==
806+
807+
version "0.13.0-beta.3"
808+
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.13.0-beta.3.tgz#2b456c3105238e64b40a30787d6335f5f6f85abb"
809+
integrity sha512-DFGcXAolA0VTsOLIKcORxUOp/FTJdD/YiRzKVLARjgOycwVRKvW2L5Tge8Z7ysZ16sKfnV2vCXyonXYfUWozXw==
810+
811+
812+
version "4.20.0-beta.6"
813+
resolved "https://registry.yarnpkg.com/xterm-headless/-/xterm-headless-4.20.0-beta.6.tgz#bd016379e9fac47e5b8870d567cdf330cf6f49fc"
814+
integrity sha512-EV0V7pxMKI0OEcOCD+6vdXq6rBARr7dSN3PovTsZnDWg5dmvUb2eEmz6BTejJj3UVd/JXNEmEXM+tCh97rDCDg==
815+
816+
817+
version "4.20.0-beta.6"
818+
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.20.0-beta.6.tgz#3ed87ba383a5cf44284098278f714df7113e3e3c"
819+
integrity sha512-xJd6vyOuYo4Ht/hTY3DyXGIj0U6kHjr2vWQ1lRmearo3t7QKf7uqOAAfTLeWt/g1P8qe/r0DnsNTeag6vI9RVw==
820820

821821
yallist@^4.0.0:
822822
version "4.0.0"

src/vs/platform/terminal/common/terminalEnvironment.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,26 @@ export function escapeNonWindowsPath(path: string): string {
1212
newPath = newPath.replace(bannedChars, '');
1313
return `'${newPath}'`;
1414
}
15+
16+
/**
17+
* Collapses the user's home directory into `~` if it exists within the path, this gives a shorter
18+
* path that is more suitable within the context of a terminal.
19+
*/
20+
export function collapseTildePath(path: string | undefined, userHome: string | undefined, separator: string): string {
21+
if (!path) {
22+
return '';
23+
}
24+
if (!userHome) {
25+
return path;
26+
}
27+
// Trim the trailing separator from the end if it exists
28+
if (userHome.match(/[\/\\]$/)) {
29+
userHome = userHome.slice(0, userHome.length - 1);
30+
}
31+
const normalizedPath = path.replace(/\\/g, '/').toLowerCase();
32+
const normalizedUserHome = userHome.replace(/\\/g, '/').toLowerCase();
33+
if (!normalizedPath.includes(normalizedUserHome)) {
34+
return path;
35+
}
36+
return `~${separator}${path.slice(userHome.length + 1)}`;
37+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import { strictEqual } from 'assert';
7+
import { collapseTildePath } from 'vs/platform/terminal/common/terminalEnvironment';
8+
9+
suite('terminalEnvironment', () => {
10+
suite('collapseTildePath', () => {
11+
test('should return empty string for a falsy path', () => {
12+
strictEqual(collapseTildePath('', '/foo', '/'), '');
13+
strictEqual(collapseTildePath(undefined, '/foo', '/'), '');
14+
});
15+
test('should return path for a falsy user home', () => {
16+
strictEqual(collapseTildePath('/foo', '', '/'), '/foo');
17+
strictEqual(collapseTildePath('/foo', undefined, '/'), '/foo');
18+
});
19+
test('should not collapse when user home isn\'t present', () => {
20+
strictEqual(collapseTildePath('/foo', '/bar', '/'), '/foo');
21+
strictEqual(collapseTildePath('C:\\foo', 'C:\\bar', '\\'), 'C:\\foo');
22+
});
23+
test('should collapse with Windows separators', () => {
24+
strictEqual(collapseTildePath('C:\\foo\\bar', 'C:\\foo', '\\'), '~\\bar');
25+
strictEqual(collapseTildePath('C:\\foo\\bar', 'C:\\foo\\', '\\'), '~\\bar');
26+
strictEqual(collapseTildePath('C:\\foo\\bar\\baz', 'C:\\foo\\', '\\'), '~\\bar\\baz');
27+
strictEqual(collapseTildePath('C:\\foo\\bar\\baz', 'C:\\foo', '\\'), '~\\bar\\baz');
28+
});
29+
test('should collapse mixed case with Windows separators', () => {
30+
strictEqual(collapseTildePath('c:\\foo\\bar', 'C:\\foo', '\\'), '~\\bar');
31+
strictEqual(collapseTildePath('C:\\foo\\bar\\baz', 'c:\\foo', '\\'), '~\\bar\\baz');
32+
});
33+
test('should collapse with Posix separators', () => {
34+
strictEqual(collapseTildePath('/foo/bar', '/foo', '/'), '~/bar');
35+
strictEqual(collapseTildePath('/foo/bar', '/foo/', '/'), '~/bar');
36+
strictEqual(collapseTildePath('/foo/bar/baz', '/foo', '/'), '~/bar/baz');
37+
strictEqual(collapseTildePath('/foo/bar/baz', '/foo/', '/'), '~/bar/baz');
38+
});
39+
});
40+
});

0 commit comments

Comments
 (0)