Given var, like <var>details</var>, it would be nice to be able to give the var a data type, so then you could do:
1. Let |details:IDLContainerType| be whatever...
2. Set |details.id| to some value.
3. Invoke |details.doThing()|.
As we know details is IDLContainerType, then it could auto link id to IDLContainerType's id member or attribute. Similarly with step 3, we could link the method on IDLContainerType.
We could also come up with a syntax for defining vars.
The same applies with internal slots. We need to be able to say that an internal slot is for a particular interface.
```Given:
When getting, the id attribute returns this
PaymentRequest's [[details]].
"PaymentDetailsInit.id">id.
Should be able write:
<p>
When getting, the <a>id</a> attribute returns the context object's
{{{PaymentRequest.[[details]].id}}}.
</p>
Or even:
When getting, the id attribute returns this PaymentRequest's {{{[[details]].id}}}.
We can't link [[\details]] unless we know the type. We will eventually know this from WebIDL itself.
interface Foo {
slotOrSomething SomeType [[InternalSlot]];
}
```
Hey @marcoscaceres ✋ . Wanted to be back at respec. 😄 Would this be good to start with 😅 ?
@shikhar-scs welcome back! Awesome shirt, btw! 🦊🤘 Be really cool if you wanted to work on this.
It depends on https://github.com/w3c/respec/issues/1811 getting fixed tho. @sidvishnoi, what's your plan for that one? Do you want to give some pointers to @shikhar-scs?
As an aside, what would be really cool would be to show the data-idl-type when the user hovers over a matching variable. Like Visual Studio does when you hover over things:

Awesome shirt, btw! 🦊🤘
Lol, thanks for sending it though 😅 .
It depends on #1811 getting fixed tho.
Then, should I go to #1811 first ?
Do you want to give some pointers to @shikhar-scs?
Yeah @sidvishnoi this would be great. I'll look into hover too once I get started with this. 😄
Then, should I go to #1811 first ?
Yeah, might be worth having a look - but coordinate with @sidvishnoi, because he might have a patch in the works already.
For a bit more background, @sidvishnoi built a very basic parser for that "{{{" "}}}" syntax. But it's not working quite right yet. The code is very small/elegant, so hopefully easy to see what it's doing:
https://github.com/w3c/respec/blob/develop/src/core/inline-idl-parser.js
That then gets used here:
https://github.com/w3c/respec/blob/develop/src/core/inlines.js#L81
Might be good to familiarize yourself with those bits of the code tho. We've also thrown around the idea of having a "real" parser... if you are feeling brave, take a look at:
We could formalize the actual micro language and then use the above to produce the syntax tree.
Hi @shikhar-scs, @marcoscaceres 👋 Got mid-semester exams here so involved there. Will be back on Saturday/Sunday.
I do not currently have much idea on how to fix #1811. _Something_ needs to be done in core/link-to-dfn
and core/inline-idl-parser@idlStringToHtml (I need to get back into ReSpec!). core/link-to-dfn.js#L82 is definitely a wrong way to make things work™.
I'll be working on #1811 on Saturday/Sunday. If @shikhar-scs wants to take a look before that, please feel free.
Sure I'll dig a bit and see what I can find 👍
@marcoscaceres Can I work on this? I would like to start with some real coding with this one.
@yatri1609 sure! Take a look at using bubble.js for the hover to show the data type.
https://github.com/krasimir/bubble.js
@marcoscaceres How about using the title attribute itself or some regular CSS+JS events if title isn't enough? I'm not sure if we should add another library here even though it's tiny.
Agree. I should have said, “something like” bubblejs. Starting with title attribute could work, though something a bit prettier would be nice.
@marcoscaceres Yeah I had a look at the bubblejs we can surely start with something like that at a smaller scale and then scale up.
sounds like a plan :)
@marcoscaceres Sorry I had a accident so wasn't able to work, but now since I am well I will like to get back on this if @sidvishnoi you aren't working on this?
@yatri1609 Oh. We hope you're good now.
I'm having exams so I won't be working on this till 17th. We have done some work on "giving var a type" part where we essentially re-wrote the inline-idl parser. So feel free to check it out in https://github.com/w3c/respec/pull/1848
Once that is done, we will fix the xref part and you can take the data type on hover part (See: https://github.com/w3c/respec/issues/1804#issuecomment-432538635)
@sidvishnoi Yeah I'm good now, Sure I will start looking at how we can have the data type hovering part
(I'm away until next week, unfortunately - will try to respond soon)
Can I work on this one? No one is assigned but it seems people were working on this one. Is this still open?
@Swapnilr1 See https://github.com/w3c/respec/issues/1804#issuecomment-444866639
It's still active (and high priority) but we're not able to make time for it. We can have you on "show data type on hover" part once we're done with #1848
I think we can probably support <var data-type> without #1848. Then #1848 can leverage this.
@marcoscaceres @sidvishnoi zi want to work on this. Let me try this.
Correct... need to do the auto linking part. I was unsure if we should just close this bug and start a new one.
Would be cleaner to start a new thread.