Skip to content
This repository has been archived by the owner on Feb 22, 2021. It is now read-only.

Duplicate entries in xref #81

Closed
dontcallmedom opened this issue Dec 10, 2020 · 2 comments
Closed

Duplicate entries in xref #81

dontcallmedom opened this issue Dec 10, 2020 · 2 comments

Comments

@dontcallmedom
Copy link
Contributor

Using e.g. {{MessagePort/postMessage()}} is reported as ambiguous when used in ReSpec, despite this being a well-defined single definition.

I think because xref provides both an argument-full and an argument-less version of the method, it appears duplicated in search results, and thus raises an error when used in ReSpec.

xref should de-duplicate methods in that situation.

@sidvishnoi
Copy link
Owner

sidvishnoi commented Dec 10, 2020

Relevant code that causes this issue:

if (termData.type === 'method' && /\(.+\)/.test(term)) {
// add another entry without the arguments
const methodWithoutArgs = term.replace(/\(.+\)/, '()');
if (!data[methodWithoutArgs]) data[methodWithoutArgs] = [];
data[methodWithoutArgs].push(termData);
}

xref should de-duplicate methods in that situation.

What should be the correct de-duplication behavior in case of {{MessagePort/postMessage()}}? We've postMessage(message, transfer), postMessage(message, options) converting into postMessage(). The present solution is to be explicit. Should we remove postMessage() and keep only explicit versions?

@sidvishnoi
Copy link
Owner

Moved to speced/respec-web-services#153

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants