-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
JavaScript and Node.js walkthrough #157965
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a great start!
For determining if node is on the users's system, I think you'll have to use child_process
to check. Hopefully we can catch the majority of installs. Here's an example of how we find git
:
vscode/extensions/git/src/git.ts
Line 80 in 81e6a02
function findGitDarwin(onValidate: (path: string) => boolean): Promise<IGit> { |
extensions/typescript-language-features/resources/walkthroughs/htmlFileWithScriptTag.html
Outdated
Show resolved
Hide resolved
@mjbvz seems fine but then I have to do that every time the extension is activated, right? It seems wasteful to spawn that process the first time a |
Actually, I seem to be having some trouble getting the walkthrough wired up with that. I'll push up my new changes in a minute but the current state is this: I've defined a new command // extensions/typescript-language-features/src/commands/jsWalkthrough.ts
// ...
export class NodeInstallationFoundCommand {
public static readonly id = 'javascript-walkthrough.commands.nodeInstallationFound';
public readonly id = 'javascript-walkthrough.commands.nodeInstallationFound';
public execute() {
vscode.window.showInformationMessage('yay it happened');
}
} and registered it // extensions/typescript-language-features/src/commands/index.ts
// ...
commandManager.register(new NodeInstallationFoundCommand()); and fired the command after it's registered and after I check for if Node exists. // extensions/typescript-language-features/src/extension.ts
// ...
hasNode().then(
async (isInstalled) => {
if (isInstalled) {
await vscode.commands.executeCommand('javascript-walkthrough.commands.nodeInstallationFound');
vscode.window.showInformationMessage('it is installed :)');
}
else {
vscode.window.showErrorMessage('it aint installed :(');
}
}
); When the extension gets activated, I do see the information message; however, in the walkthrough I have an {
"id": "walkthroughs.jsWelcome.downloadNode.forMacOrWindows",
"title": "%walkthroughs.jsWelcome.downloadNode.forMacOrWindows.title%",
"description": "%walkthroughs.jsWelcome.downloadNode.forMacOrWindows.description%",
"media": {
"markdown": "resources/walkthroughs/TODO.md"
},
"when": "isWindows || isMac",
"completionEvents": [
"onLink:https://nodejs.org/en/download/",
"onCommand:javascript-walkthrough.commands.nodeInstallationFound"
]
}, but it doesn't seem like that step is marked as completed. Anything obvious I'm doing wrong? |
Hey all, here's the current status. First, the walkthrough just has 4 steps now
The notable stuff on each step is
I will need assets for each step, along with a walkthrough icon which should probably use the JS community logo, the Node.js logo, or both. I've created some tentative assets, which I derived from the Python walkthrough, but they don't appear aligned, so I need some help on that. I don't expect this to go into the August release at this point, but the sooner the better. |
I'll add the assets to this PR this week 👍 |
Updated icon and SVGs CleanShot.2022-09-02.at.09.55.04.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The icon.png file is used in VS Code's extension UI. I think it would be confusing to use a js
specific one for the JS/TS language features extension
That's fair. I'll replace with something less specific. |
Huh - is there no way to provide an alternative icon for a walkthrough? (@lramos15) |
Not sure I understand the question, what do you mean by alternative icon @DanielRosenwasser |
If I understood correctly I think he means that these icons are currently both using the same source icon. I.e. you can't use a different icon for a walkthrough vs. the extension itself. |
That's correct - but I don't think we should block this PR over the icon. I would rather begin experimenting here, and in the future use a different icon if walkthroughs eventually do support their own icons. |
I figured it would be worth opening a new PR for this one.
The feedback I got on #151665 was effectively to scope things down and make a walkthrough that's just Node.js and JavaScript. Doing that brings some parity with other languages like Python and reduces the need to introduce HTML, at the expense of losing the convenience of the browser and web development.
Fixes microsoft/TypeScript#48489
Ticks a box off on #144062
Here's the current TODOs, with some specific callouts that I'd appreciate some input on.
node
isn't present on the terminal. Should I?