Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core/inlines): make variables context aware #1848

Closed
wants to merge 33 commits into from
Closed

Conversation

marcoscaceres
Copy link
Member

This is a work in progress

@marcoscaceres
Copy link
Member Author

@sidvishnoi would like to chat about this. I have some ideas and could use your help.

@sidvishnoi sidvishnoi added this to High priority in ReSpec Maintenance Oct 8, 2018
@sidvishnoi
Copy link
Member

@marcoscaceres Removing {{{ Dictionary["member"] }}} syntax would work fine for referencing local IDL as we will be matching it up with local pre.idl (maybe a Map), but it would break the external references (in core/xref) as we would have no way to tell the xref API that we're looking for a dict-member. Or am I missing something?

@marcoscaceres
Copy link
Member Author

@marcoscaceres Removing {{{ Dictionary["member"] }}} syntax would work fine for referencing local IDL as we will be matching it up with local pre.idl (maybe a Map), but it would break the external references (in core/xref) as we would have no way to tell the xref API that we're looking for a dict-member. Or am I missing something?

All IDL containers are uniquely named, so the distinction between dictionary and interface is kinda an optimization. So, if we make the the micro-syntax for both the same, then it only becomes a user detail that one is a dictionary and another is an interface.

That is:

 {{{ DictionaryWhatever }}}
 {{{ DictionaryWhatever.memberWhatever }}}

@sidvishnoi sidvishnoi mentioned this pull request Dec 6, 2018
const types = [];
if (isIDL) {
if (elem.dataset.xrefType) {
types.push(...elem.dataset.xrefType.split("|"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will let us support treating attribute and dict-member the same

@@ -547,7 +547,7 @@ describe("Core — xref", () => {
expect(link2.href).toEqual(
expectedLinks.get("PermissionStatus.[[query]]")
);
expect(link2.textContent).toEqual("[[query]]");
expect(link2.textContent).toEqual("query");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need a thought here

@marcoscaceres
Copy link
Member Author

I think we should beta test this with Payment Request a bit.

sidvishnoi and others added 3 commits March 16, 2019 22:47
Co-Authored-By: marcoscaceres <marcos@marcosc.com>
Fix: get parent's data-link-for context if available
Fix: Disambiguate based on shortname or spec
Update tests and test data
}
if (splitted.length > 1 && !result.method) {
result.attribute = splitted.pop();
const methodRegex = /(\w+)\((.*)\)$/;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should move these regex outside this function maybe

sidvishnoi added a commit that referenced this pull request Apr 13, 2019
- Remove special syntax for dict-member
- Treat attribute and dict-member same way
- Borrow inline-idl-parser from #1848
- Update tests
sidvishnoi added a commit that referenced this pull request Apr 13, 2019
- Remove special syntax for dict-member
- Treat attribute and dict-member same way
- Borrow inline-idl-parser from #1848
- Add support for enum and enum-value
- Update tests
@sidvishnoi sidvishnoi deleted the data-var branch December 12, 2019 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
ReSpec Maintenance
High priority
Development

Successfully merging this pull request may close these issues.

None yet

2 participants