Make sure we decode path components for md path completions

Fixes #145447
This commit is contained in:
Matt Bierner
2022-03-22 16:58:04 -07:00
parent 5a2acb7773
commit 82c70007a3
3 changed files with 27 additions and 2 deletions

View File

@@ -151,4 +151,20 @@ suite('Markdown path completion provider', () => {
assert.ok(completions.some(x => x.insertText === 'file%20with%20space.md'), 'Has encoded path completion');
});
test('Should complete paths for path with encoded spaces', async () => {
const completions = await getCompletionsAtCursor(workspaceFile('new.md'), joinLines(
`[](./sub%20with%20space/${CURSOR})`
));
assert.ok(completions.some(x => x.insertText === 'file.md'), 'Has file from space');
});
test('Should complete definition path for path with encoded spaces', async () => {
const completions = await getCompletionsAtCursor(workspaceFile('new.md'), joinLines(
`[def]: ./sub%20with%20space/${CURSOR}`
));
assert.ok(completions.some(x => x.insertText === 'file.md'), 'Has file from space');
});
});