pxt
pxt copied to clipboard
Add helpful information about creating an extension when adding a new .ts file
Experimenting with the idea of giving a helpful start for extensions when creating a new .ts file. Otherwise it's pretty hard to find documentation on extension writing.
What do you guys think? @pelikhan , @jwunderl , @shakao , @riknoll ?
Definitely pro this
One thing is that a lot of the time when I look at user extensions they end up throwing things just in main - which is fine, but they wouldn't ever see this then, or maybe would only see it after working through the initial stuff / finding it themselves. Maybe this could be the initial comment in main.ts if you create a github repo project as well? But that project starts in blocks view, so maybe not.
At first I thought it might get a bit annoying on every file, but then I remembered I always just ctrl+a > delete to clear the initial comment anyway so it's really no different that way.
Maybe use a block comment for the code section that needs to be uncommented? I'm not certain the difference between the extra comment you need to remove and normal comment attributes will be obvious at first - e.g. might try to remove comments and leave a line starting with %?
There is already a template for custom.ts to show how do custom blocks. We should have a single template probably.
But it’s also incredibly annoying and people won’t know if they can just delete. I think the dialog that lets you name the file should also have few templates to pick from instead.
From: Joey Wunderlich [email protected] Sent: Saturday, May 2, 2020 12:55:06 PM To: microsoft/pxt [email protected] Cc: Peli de Halleux [email protected]; Mention [email protected] Subject: Re: [microsoft/pxt] Add helpful information about creating an extension when adding a new .ts file (#6958)
Definitely pro this
One thing is that a lot of the time when I look at user extensions they end up throwing things just in main - which is fine, but they wouldn't ever see this then, or maybe would only see it after working through the initial stuff / finding it themselves. Maybe this could be the initial comment in main.ts if you create a github repo project as well? But that project starts in blocks view, so maybe not.
At first I thought it might get a bit annoying on every file, but then I remembered I always just ctrl+a > delete to clear the initial comment anyway so it's really no different that way.
Maybe use a block comment for the code section that needs to be uncommented? I'm not certain the difference between the extra comment you need to remove and normal comment attributes will be obvious at first - e.g. might try to remove comments and leave a line starting with %?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fpxt%2Fpull%2F6958%23issuecomment-623005381&data=02%7C01%7Cjhalleux%40microsoft.com%7Ca13a2fda17014898596b08d7eed2b638%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637240461080699201&sdata=eskzgg7VQjTA2erNx00vNjfIhj%2FEAc92Z1cIH4VzuOE%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAA73QKPNSEAYCA6ISGBE4FDRPR3BVANCNFSM4MXZXJVQ&data=02%7C01%7Cjhalleux%40microsoft.com%7Ca13a2fda17014898596b08d7eed2b638%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637240461080709197&sdata=LT2DUz17IsZveodMKlF09amfGlxuZ8AC99QcP%2FjFj0A%3D&reserved=0.
ooh i really like the idea of choosing a template when you make a new file! maybe to somewhat combat the main.ts issue we could have a link to the extension docs in the github view "release zone" as well...
Awesome, yes I agree a template choice during file creation seems ideal.
Then my question is how does anyone know to add a file.. Maybe when the explorer is collapsed, there is some button or hint about adding more files
It is an advanced scenario so it is ok to keep it hidden. We don’t have great support for multiple files.