mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Fix md references not checking authority
Simply compare by string for now
This commit is contained in:
parent
a56c9f10b7
commit
b4b7380576
|
@ -162,7 +162,7 @@ export class MdReferencesProvider extends Disposable implements vscode.Reference
|
|||
const references: MdReference[] = [];
|
||||
|
||||
for (const link of allLinksInWorkspace) {
|
||||
if (link.href.kind === 'external' && link.href.uri.scheme === sourceLink.href.uri.scheme && link.href.uri.path === sourceLink.href.uri.path) {
|
||||
if (link.href.kind === 'external' && link.href.uri.toString() === sourceLink.href.uri.toString()) {
|
||||
const isTriggerLocation = sourceLink.source.resource.fsPath === link.source.resource.fsPath && sourceLink.source.hrefRange.isEqual(link.source.hrefRange);
|
||||
references.push({
|
||||
kind: 'link',
|
||||
|
|
|
@ -361,7 +361,7 @@ suite('markdown: find all references', () => {
|
|||
);
|
||||
});
|
||||
|
||||
test('Should consider paths when finding references to http uri', async () => {
|
||||
test('Should consider authority, scheme and paths when finding references to http uri', async () => {
|
||||
const uri = workspacePath('doc.md');
|
||||
const doc = new InMemoryDocument(uri, joinLines(
|
||||
`[1](http://example.com/cat)`,
|
||||
|
@ -369,6 +369,8 @@ suite('markdown: find all references', () => {
|
|||
`[3](http://example.com/dog)`,
|
||||
`[4](http://example.com/cat/looong)`,
|
||||
`[5](http://example.com/cat)`,
|
||||
`[6](http://other.com/cat)`,
|
||||
`[7](https://example.com/cat)`,
|
||||
));
|
||||
|
||||
const refs = await getReferences(doc, new vscode.Position(0, 13), new InMemoryWorkspaceMarkdownDocuments([doc]));
|
||||
|
|
Loading…
Reference in a new issue