-
Notifications
You must be signed in to change notification settings - Fork 8
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
Moved from JSDoc to type declarations for options objects #51
Conversation
…s in `uxp` module, fixes #49
I actually wanted to do that, but it got marked as a syntax error. Here is a screenshot of the corresponding linting output of the TypeScript playground (https://www.typescriptlang.org/play/):
Noted. I'll fix that tomorrow 😉 Edit: Correction – I've just fixed it 😆 |
I am so confused as to why this isn't being tagged as a syntax error in VSCode. 😖 Looks like it's time to start running suggestions through the Playground first! How about that
|
Wow – I didn't know It also means that this renders great in WebStorm: Is there some sort of real "spec" (like the JSDoc stuff above) where I can take a look at what's actually supported? The thing is that if there isn't, we simply have to use some subset that fits most platforms (and could argue about every tag that's in JSDoc) 😆... The thing is that this is kind of a "decision of principle" (if that's something one can say in English). We can either use the smallest subset (which would only include From what I've seen, also VSCode kind of supports the default tag (in the same way it does the param one): At the same time, VSCode doesn't appear to support the All in all, I think we have to "draw the line" of which things to use somewhere. If this doesn't get interpreted correctly, a developer sees
which should be possible to understand (and therefore fine with me). At the same time, in some editors (like WebStorm), this adds benefits. Therefore, I'd argue that the usage of Please don't get me wrong here: I'm totally open for doing things like that, but I do believe that it's a decision where there's no right or wrong (based on the reasoning above) and therefore, that this has to be a decision of which direction the typings should take. This, of course, isn't something I'll do based on the suggestion of one person. |
Just to explain why this is kind of a big thing for me: This wouldn't be a problem for me – this really isn't about ego – but I just want to explain why this is more fundamental to me than just "removing" the Edit: On the second read, this sounds much more "emotional" and "extreme" than it was intended to be. |
Honestly, it's been a bit of a crazy ride figuring out which JSDoc tags do and don't work with TypeScript. I used to start by looking at the JSDoc documentation, but quickly found that it lead to broken IntelliSense or frustrating time lost trying to get some JavaScript-side type assertion working. Annoyingly, this page used to have a decent writeup of supported JSDoc tags. It now points to this page which, right when you need it most, points right back at the first one:
Honestly, I think this may all be related to Microsoft's TSDoc efforts - they're probably sick and tired of the ambiguity around which JSDoc tags are supported and exactly how to support them. That all said, Google did pop up this page which looks to be very recently maintained. Of note is that the Unsupported tags list at the bottom includes several that are used in tech that will or already purport to conform to TSDoc standards.
That's pretty sweet! I guess this is one of those situations that is leading MS to push for a standard - so tech developers can provide a consistent experience across tools.
Yup. It's a total PITA. The best list I've found is this one. [The API Extractor tool (also by MS) is built for generating documentation from TypeScript source files.] There is also this list though I'm not sure where the
I guess. There's the lists I've just pointed out as well as the fact that MarkDown in the comments seems to be fairly universally supported. This includes code blocks and ordered/unordered lists. I did a test a few days ago to see if I could get one of the "Information warning" blocks into the IntelliSense and it worked fine with a bit of MarkDown spice.
It does to an extent. I ran a quick test and noticed that typing No idea why
Hmm... it may be the case that TSDoc is ahead of the game. The
I agree. It's why I specifically "recommended" not using
If you feel strongly about it then it seems the answer is "Yup, I considered it but I think In no way do I intend to elbow my way in and demand conformance to an as-yet inflight spec! Apologies if I came off that way. 😔 My intention was merely to raise a concern and provide options. Regardless, thanks for your efforts in maintaining these typings! |
No apology necessary – I also don't think it came off that way. I just wanted to make it clear how (and – more importantly – why) I feel about his as I do. Thank you for bringing this up. As I said, my concern is what the community wants for this, and for the community to voice an opinion, it is important that it gets brought up. At the same time, I think it's important to be transparent about how I think about it (trying to keep the typings as consistent as possible) and "how far" I can go while still being honest (to myself) and therefore able to maintain the repo. I think that for now, I'll stick with For this Pull Request, however, I think we can agree to leave it the way it is now. I'll probably create an issue (+ a label for "to be discussed") tomorrow to see how everyone else thinks about it and have a place for searching for an optimal (if there is one) solution for everyone, but for now, I'll call it a day 🙂 |
To just make it a bit more transparent (and kind of a TL;DR version) what's the issue for me here 🙂 : |
Sounds great to me!
Awesome. That would be great. As mentioned in this comment, it looks like the TypeScript-recognized list of JSDoc tags is here. That "looks" is emphasized because the explanation seems to suggest that it's context-sensitive (emphasis mine):
What we haven't clearly stated yet is the context for the JSDoc tags we've been discussing: JavaScript or TypeScript? It appears that in a TypeScript context, JSDoc tags may simply be "comment text". Consider the following code in a TypeScript context: /** @type {number} */
let test = "hey"; The code snippet above does not produce an error in a TypeScript file, treating the What this all suggests to me right now is that JSDoc is not a thing that the TypeScript language (read: the language server) actually cares about. Indeed, upon closer inspection, it appears that VSCode interprets the JSDocs in the comments itself when performing certain helpful actions (the standard IntelliSense feautres)! And this is where TSDoc comes in:
It seems that TSDoc may eventually present us with a standardized set of tags to use for consistent tooling, but we're not there yet. As such, I think opening a "future discussions" issue to track developments around TSDoc is a great idea. [Side note: TSDoc has an RFC for a
Yes. Please do! Specifically, I'd like to rescind my suggestion to remove |
Ok. With that, we should be ready to merge this. I'll wait until the end of today and if there are no vetos, I'll merge it. I'll also open the issue for future discussions regarding this later today (I didn't get to doing so yesterday since I had to take my cat to the vet – no worries, she'll be fine – but I'll do it later today). |
- Moved shell class declaration to `uxp.d.ts`
Discussion about |
As requested by @ericdrobinson in the issue mentioned above – thanks for your input 👍