mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 10:08:49 +01:00
scheme and path or authoriy are mandated, fixes #2341
This commit is contained in:
@@ -75,6 +75,32 @@ suite('workspace-namespace', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test('openTextDocument, uri scheme/auth/path', function() {
|
||||
|
||||
let registration = workspace.registerTextDocumentContentProvider('sc', {
|
||||
provideTextDocumentContent() {
|
||||
return 'SC';
|
||||
}
|
||||
});
|
||||
|
||||
return Promise.all([
|
||||
workspace.openTextDocument(Uri.parse('sc://auth')).then(doc => {
|
||||
assert.equal(doc.uri.authority, 'auth');
|
||||
assert.equal(doc.uri.path, '');
|
||||
}),
|
||||
workspace.openTextDocument(Uri.parse('sc:///path')).then(doc => {
|
||||
assert.equal(doc.uri.authority, '');
|
||||
assert.equal(doc.uri.path, '/path');
|
||||
}),
|
||||
workspace.openTextDocument(Uri.parse('sc://auth/path')).then(doc => {
|
||||
assert.equal(doc.uri.authority, 'auth');
|
||||
assert.equal(doc.uri.path, '/path');
|
||||
})
|
||||
]).then(() => {
|
||||
registration.dispose();
|
||||
});
|
||||
})
|
||||
|
||||
test('events: onDidOpenTextDocument, onDidChangeTextDocument, onDidSaveTextDocument', () => {
|
||||
return createRandomFile().then(file => {
|
||||
let disposables = [];
|
||||
|
||||
Reference in New Issue
Block a user