From cfc01197555cb14a0d2d3463b331ce41de5733be Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 14 Sep 2022 23:26:22 -0700 Subject: [PATCH] Revert "JavaScript and Node.js walkthrough" (#160959) Revert "JavaScript and Node.js walkthrough (#157965)" This reverts commit 0cbcb1b1ab485cc7a16ca918728e600e41dbb29b. --- build/filters.js | 1 - .../media/icon.png | Bin 6203 -> 2181 bytes .../typescript-language-features/package.json | 55 +----- .../package.nls.json | 22 +-- .../walkthroughs/create-a-js-file.svg | 41 ---- .../resources/walkthroughs/debug-and-run.svg | 107 ---------- .../walkthroughs/install-node-js.svg | 84 -------- .../resources/walkthroughs/learn-more.svg | 109 ---------- .../src/commands/index.ts | 4 - .../src/commands/jsWalkthrough.ts | 187 ------------------ .../src/extension.browser.ts | 6 +- .../src/extension.ts | 6 +- 12 files changed, 4 insertions(+), 618 deletions(-) delete mode 100644 extensions/typescript-language-features/resources/walkthroughs/create-a-js-file.svg delete mode 100644 extensions/typescript-language-features/resources/walkthroughs/debug-and-run.svg delete mode 100644 extensions/typescript-language-features/resources/walkthroughs/install-node-js.svg delete mode 100644 extensions/typescript-language-features/resources/walkthroughs/learn-more.svg delete mode 100644 extensions/typescript-language-features/src/commands/jsWalkthrough.ts diff --git a/build/filters.js b/build/filters.js index 03eb06f2eb2..daddf2ed350 100644 --- a/build/filters.js +++ b/build/filters.js @@ -82,7 +82,6 @@ module.exports.indentationFilter = [ '!test/monaco/out/**', '!test/smoke/out/**', '!extensions/typescript-language-features/test-workspace/**', - '!extensions/typescript-language-features/resources/walkthroughs/**', '!extensions/markdown-math/notebook-out/**', '!extensions/vscode-api-tests/testWorkspace/**', '!extensions/vscode-api-tests/testWorkspace2/**', diff --git a/extensions/typescript-language-features/media/icon.png b/extensions/typescript-language-features/media/icon.png index 1bdda21844c51e56c5f5e2689271b720666069ab..013843b544d640304f4303b33eae3b3068698c75 100644 GIT binary patch literal 2181 zcmYk8eLR!vAIGoTy@x!k4Lx~kbds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y^!Q-hk$ut`ow^9OzNI?7jI+#VU=P{)=MUcH$e>L7?~AlE6FtydJOCr>C6 zKoQjAxae5#d>aK!w7{s-iF5wSQJA8W*3*^%!mkQm;MfO=gv7a<9~)w`iGvsKYGsku z;nS~YHk9|;CFt*R*wGBCN)TDwL+4}Gs5jl;7JP|6IJLluL=$cp>jhCSe)!$p7JcB1 z3G4^YeG+NF^MKv$u`j~xY~O~+%>#=b<7d;47I3|I%5XHClq4MOBa^0yVAGSQWX8Br zghIOu^A%Uxys<6ZAG|XHg2kc(xsYg;JfjLOv(^tbg4GB{ANsMedwPFW+E;#<7n?7o zp5z_!gF6@>-M^-%{``9?0)@>Pc=5vWfEOo{T34&6*7q=4vSM@97-nJFbGnrL(t=C2 zaPZCq%91{XhF(GG(Q5Ty%&qeG%M&WB)rR~+$#q6og0MKB#P&{wRJA_B(}L(|1$b07 z5$vWE$3{2Ex}>MGOEA>lmo(7h{lMA6Say?IURT`+DOc~JQYW^#ihk4 zw_swPXTb|w2kTeQyww@1J~bpEdT%j diff --git a/extensions/typescript-language-features/package.json b/extensions/typescript-language-features/package.json index 2c46f4ccda8..15a96456934 100644 --- a/extensions/typescript-language-features/package.json +++ b/extensions/typescript-language-features/package.json @@ -68,8 +68,7 @@ "onCommand:typescript.fileReferences", "onCommand:typescript.goToSourceDefinition", "onTaskType:typescript", - "onLanguage:jsonc", - "onWalkthrough:nodejsWelcome" + "onLanguage:jsonc" ], "main": "./out/extension", "browser": "./dist/browser/extension", @@ -1525,58 +1524,6 @@ } ] } - ], - "walkthroughs": [ - { - "id": "nodejsWelcome", - "title": "%walkthroughs.nodejsWelcome.title%", - "description": "%walkthroughs.nodejsWelcome.description%", - "when": "false", - "steps": [ - { - "id": "walkthroughs.nodejsWelcome.downloadNode.forMacOrWindows", - "title": "%walkthroughs.nodejsWelcome.downloadNode.forMacOrWindows.title%", - "description": "%walkthroughs.nodejsWelcome.downloadNode.forMacOrWindows.description%", - "media": { - "svg": "resources/walkthroughs/install-node-js.svg" - }, - "when": "isWindows || isMac" - }, - { - "id": "walkthroughs.nodejsWelcome.downloadNode.forLinux", - "title": "%walkthroughs.nodejsWelcome.downloadNode.forLinux.title%", - "description": "%walkthroughs.nodejsWelcome.downloadNode.forLinux.description%", - "media": { - "svg": "resources/walkthroughs/install-node-js.svg" - }, - "when": "isLinux" - }, - { - "id": "walkthroughs.nodejsWelcome.makeJsFile", - "title": "%walkthroughs.nodejsWelcome.makeJsFile.title%", - "description": "%walkthroughs.nodejsWelcome.makeJsFile.description%", - "media": { - "svg": "resources/walkthroughs/create-a-js-file.svg" - } - }, - { - "id": "walkthroughs.nodejsWelcome.debugJsFile", - "title": "%walkthroughs.nodejsWelcome.debugJsFile.title%", - "description": "%walkthroughs.nodejsWelcome.debugJsFile.description%", - "media": { - "svg": "resources/walkthroughs/debug-and-run.svg" - } - }, - { - "id": "walkthroughs.nodejsWelcome.learnMoreAboutJs", - "title": "%walkthroughs.nodejsWelcome.learnMoreAboutJs.title%", - "description": "%walkthroughs.nodejsWelcome.learnMoreAboutJs.description%", - "media": { - "svg": "resources/walkthroughs/learn-more.svg" - } - } - ] - } ] }, "repository": { diff --git a/extensions/typescript-language-features/package.nls.json b/extensions/typescript-language-features/package.nls.json index 49291d123ba..03752b1f095 100644 --- a/extensions/typescript-language-features/package.nls.json +++ b/extensions/typescript-language-features/package.nls.json @@ -191,25 +191,5 @@ "typescript.findAllFileReferences": "Find File References", "typescript.goToSourceDefinition": "Go to Source Definition", "configuration.suggest.classMemberSnippets.enabled": "Enable/disable snippet completions for class members. Requires using TypeScript 4.5+ in the workspace", - "configuration.suggest.objectLiteralMethodSnippets.enabled": "Enable/disable snippet completions for methods in object literals. Requires using TypeScript 4.7+ in the workspace", - - "walkthroughs.nodejsWelcome.title": "Get started with JavaScript and Node.js", - "walkthroughs.nodejsWelcome.description": "Make the most of Visual Studio Code's first-class JavaScript experience.", - - "walkthroughs.nodejsWelcome.downloadNode.forMacOrWindows.title": "Install Node.js", - "walkthroughs.nodejsWelcome.downloadNode.forMacOrWindows.description": "Node.js is an easy way to run JavaScript code. You can use it to quickly build command-line apps and servers. It also comes with npm, a package manager which makes reusing and sharing JavaScript code easy.\n[Install Node.js](https://nodejs.org/en/download/)", - - "walkthroughs.nodejsWelcome.downloadNode.forLinux.title": "Install Node.js", - "walkthroughs.nodejsWelcome.downloadNode.forLinux.description": "Node.js is an easy way to run JavaScript code. You can use it to quickly build command-line apps and servers. It also comes with npm, a package manager which makes reusing and sharing JavaScript code easy.\n[Install Node.js](https://nodejs.org/en/download/package-manager/)", - - "walkthroughs.nodejsWelcome.makeJsFile.title": "Create a JavaScript File", - "walkthroughs.nodejsWelcome.makeJsFile.description": "Let's write our first JavaScript file. We'll have to create a new file and save it with the ``.js`` extension at the end of the file name.\n[Create a JavaScript File](command:javascript-walkthrough.commands.createJsFile)", - - "walkthroughs.nodejsWelcome.debugJsFile.title": "Run and Debug your JavaScript", - "walkthroughs.nodejsWelcome.debugJsFile.description": "Once you've installed Node.js, you can run JavaScript programs at a terminal by entering ``node your-file-name.js``\nAnother easy way to run Node.js programs is by using VS Code's debugger which lets you run your code, pause at different points, and help you understand what's going on step-by-step.\n[Start Debugging](command:javascript-walkthrough.commands.debugJsFile)", - "walkthroughs.nodejsWelcome.debugJsFile.altText": "Debug and run your JavaScript code in Node.js with Visual Studio Code.", - - "walkthroughs.nodejsWelcome.learnMoreAboutJs.title": "Explore More", - "walkthroughs.nodejsWelcome.learnMoreAboutJs.description": "Want to get more comfortable with JavaScript, Node.js, and VS Code? Be sure to check out our docs!\nWe've got lots of resources for learning [JavaScript](https://code.visualstudio.com/docs/nodejs/working-with-javascript) and [Node.js](https://code.visualstudio.com/docs/nodejs/nodejs-tutorial).\n\n[Learn More](https://code.visualstudio.com/docs/nodejs/nodejs-tutorial)", - "walkthroughs.nodejsWelcome.learnMoreAboutJs.altText": "Learn more about JavaScript and Node.js in Visual Studio Code." + "configuration.suggest.objectLiteralMethodSnippets.enabled": "Enable/disable snippet completions for methods in object literals. Requires using TypeScript 4.7+ in the workspace" } diff --git a/extensions/typescript-language-features/resources/walkthroughs/create-a-js-file.svg b/extensions/typescript-language-features/resources/walkthroughs/create-a-js-file.svg deleted file mode 100644 index c9602e32ca5..00000000000 --- a/extensions/typescript-language-features/resources/walkthroughs/create-a-js-file.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extensions/typescript-language-features/resources/walkthroughs/debug-and-run.svg b/extensions/typescript-language-features/resources/walkthroughs/debug-and-run.svg deleted file mode 100644 index 0fc4d754047..00000000000 --- a/extensions/typescript-language-features/resources/walkthroughs/debug-and-run.svg +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/extensions/typescript-language-features/resources/walkthroughs/install-node-js.svg b/extensions/typescript-language-features/resources/walkthroughs/install-node-js.svg deleted file mode 100644 index 2009e9ad5fe..00000000000 --- a/extensions/typescript-language-features/resources/walkthroughs/install-node-js.svg +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/extensions/typescript-language-features/resources/walkthroughs/learn-more.svg b/extensions/typescript-language-features/resources/walkthroughs/learn-more.svg deleted file mode 100644 index ea2e78bdd30..00000000000 --- a/extensions/typescript-language-features/resources/walkthroughs/learn-more.svg +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extensions/typescript-language-features/src/commands/index.ts b/extensions/typescript-language-features/src/commands/index.ts index 4a1675654cb..4b6f8d36ac3 100644 --- a/extensions/typescript-language-features/src/commands/index.ts +++ b/extensions/typescript-language-features/src/commands/index.ts @@ -10,7 +10,6 @@ import { PluginManager } from '../utils/plugins'; import { CommandManager } from './commandManager'; import { ConfigurePluginCommand } from './configurePlugin'; import { JavaScriptGoToProjectConfigCommand, TypeScriptGoToProjectConfigCommand } from './goToProjectConfiguration'; -import { CreateNewJSFileCommand, DebugJsFileCommand, JsWalkthroughState } from './jsWalkthrough'; import { LearnMoreAboutRefactoringsCommand } from './learnMoreAboutRefactorings'; import { OpenTsServerLogCommand } from './openTsServerLog'; import { ReloadJavaScriptProjectsCommand, ReloadTypeScriptProjectsCommand } from './reloadProject'; @@ -23,7 +22,6 @@ export function registerBaseCommands( lazyClientHost: Lazy, pluginManager: PluginManager, activeJsTsEditorTracker: ActiveJsTsEditorTracker, - jsWalkthroughState: JsWalkthroughState ): void { commandManager.register(new ReloadTypeScriptProjectsCommand(lazyClientHost)); commandManager.register(new ReloadJavaScriptProjectsCommand(lazyClientHost)); @@ -35,6 +33,4 @@ export function registerBaseCommands( commandManager.register(new ConfigurePluginCommand(pluginManager)); commandManager.register(new LearnMoreAboutRefactoringsCommand()); commandManager.register(new TSServerRequestCommand(lazyClientHost)); - commandManager.register(new CreateNewJSFileCommand(jsWalkthroughState)); - commandManager.register(new DebugJsFileCommand(jsWalkthroughState)); } diff --git a/extensions/typescript-language-features/src/commands/jsWalkthrough.ts b/extensions/typescript-language-features/src/commands/jsWalkthrough.ts deleted file mode 100644 index 1a1f5d34e20..00000000000 --- a/extensions/typescript-language-features/src/commands/jsWalkthrough.ts +++ /dev/null @@ -1,187 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as vscode from 'vscode'; -import * as nls from 'vscode-nls'; -import * as cp from 'child_process'; - -import { Disposable } from '../utils/dispose'; - -const localize = nls.loadMessageBundle(); - -export async function nodeWasResolvable(): Promise { - let execStr: string; - switch (process.platform) { - case 'win32': - execStr = 'where node'; - break; - case 'aix': - case 'cygwin': - case 'darwin': - case 'freebsd': - case 'haiku': - case 'linux': - case 'netbsd': - case 'openbsd': - case 'sunos': - execStr = 'which node'; - break; - default: - return false; - } - - return new Promise(resolve => { - cp.exec(execStr, { windowsHide: true }, err => { - resolve(!err); - }); - }); -} - -export class JsWalkthroughState extends Disposable { - exampleJsDocument: vscode.TextDocument | undefined = undefined; - - override dispose() { - this.exampleJsDocument = undefined; - } -} - -export class CreateNewJSFileCommand { - public static readonly id = 'javascript-walkthrough.commands.createJsFile'; - public readonly id = CreateNewJSFileCommand.id; - - constructor(private walkthroughState: JsWalkthroughState) { } - - public execute() { - createNewJSFile(this.walkthroughState); - } -} - -export class DebugJsFileCommand { - public static readonly id = 'javascript-walkthrough.commands.debugJsFile'; - public readonly id = DebugJsFileCommand.id; - - constructor(private walkthroughState: JsWalkthroughState) { } - - public execute() { - debugJsFile(this.walkthroughState); - } -} - -export class NodeInstallationFoundCommand { - public static readonly id = 'javascript-walkthrough.commands.nodeInstallationFound'; - public readonly id = NodeInstallationFoundCommand.id; - public execute() { } -} - -async function createNewJSFile(walkthroughState: JsWalkthroughState) { - const newFile = await vscode.workspace.openTextDocument({ - language: 'javascript', - content: `// Write a message to the console.\nconsole.log('hello world!');\n`, - }); - walkthroughState.exampleJsDocument = newFile; - return vscode.window.showTextDocument(newFile, vscode.ViewColumn.Beside); -} - -async function debugJsFile(walkthroughState: JsWalkthroughState) { - const hasNode = await nodeWasResolvable(); - if (!hasNode) { - const reloadResponse = localize('reloadWindowForNode', 'Reload VS Code'); - const debugAnywayResponse = localize('nodeNotFoundDebugAnyway', 'Try Debugging Anyway'); - const dismissResponse = localize('nodeNotFoundDismissDialog', 'Dismiss'); - const response = await vscode.window.showErrorMessage( - // The message - localize('noNodeInstallFound', 'We couldn\'t find Node.js on this computer. If you just installed it, you might need to reload VS Code.'), - // The options - reloadResponse, - debugAnywayResponse, - dismissResponse, - ); - - if (response === undefined || response === dismissResponse) { - return; - } - if (response === reloadResponse) { - vscode.commands.executeCommand('workbench.action.reloadWindow'); - return; - } - } - tryDebugRelevantDocument(walkthroughState.exampleJsDocument, 'javascript', ['.mjs', '.js'], () => createNewJSFile(walkthroughState)); -} - -type DocSearchResult = - | { kind: 'visible'; editor: vscode.TextEditor } - | { kind: 'hidden'; uri: vscode.Uri } - | { kind: 'not-found' }; - -async function tryDebugRelevantDocument(lastDocument: vscode.TextDocument | undefined, languageId: string, languageExtensions: [string, ...string[]], createFileAndFocus: () => Promise): Promise { - let searchResult!: DocSearchResult; - for (const languageExtension of languageExtensions) { - searchResult = tryFindRelevantDocument(lastDocument, languageId, languageExtension); - if (searchResult.kind !== 'not-found') { - break; - } - } - - let editor: vscode.TextEditor; - // If not, make one. - switch (searchResult.kind) { - case 'visible': - // Focus if necessary. - editor = searchResult.editor; - if (vscode.window.activeTextEditor !== editor) { - await vscode.window.showTextDocument(editor.document, { - viewColumn: vscode.ViewColumn.Beside, - }); - } - break; - case 'hidden': - editor = await vscode.window.showTextDocument(searchResult.uri, { - viewColumn: vscode.ViewColumn.Beside, - }); - break; - case 'not-found': - editor = await createFileAndFocus(); - break; - } - - await Promise.all([ - vscode.commands.executeCommand('workbench.action.debug.start'), - vscode.commands.executeCommand('workbench.debug.action.focusRepl'), - ]); - -} - -/** Tries to find a relevant {@link vscode.TextEditor} or a {@link vscode.Uri} for an open document */ -function tryFindRelevantDocument(lastDocument: vscode.TextDocument | undefined, languageId: string, languageExtension: string): DocSearchResult { - let editor: vscode.TextEditor | undefined; - - // Try to find the document created from the last step. - if (lastDocument) { - editor = vscode.window.visibleTextEditors.find(editor => editor.document === lastDocument); - } - - // If we couldn't find that, find a visible document with the desired language. - editor ??= vscode.window.visibleTextEditors.find(editor => editor.document.languageId === languageId); - if (editor) { - return { - kind: 'visible', - editor, - }; - } - - // If we still couldn't find that, find a possibly not-visible document. - for (const tabGroup of vscode.window.tabGroups.all) { - for (const tab of tabGroup.tabs) { - if (tab.input instanceof vscode.TabInputText && tab.input.uri.path.endsWith(languageExtension)) { - return { - kind: 'hidden', - uri: tab.input.uri, - }; - } - } - } - - return { kind: 'not-found' }; -} diff --git a/extensions/typescript-language-features/src/extension.browser.ts b/extensions/typescript-language-features/src/extension.browser.ts index 16440a77fb3..06b650d2375 100644 --- a/extensions/typescript-language-features/src/extension.browser.ts +++ b/extensions/typescript-language-features/src/extension.browser.ts @@ -7,7 +7,6 @@ import * as vscode from 'vscode'; import { Api, getExtensionApi } from './api'; import { CommandManager } from './commands/commandManager'; import { registerBaseCommands } from './commands/index'; -import { JsWalkthroughState } from './commands/jsWalkthrough'; import { createLazyClientHost, lazilyActivateClient } from './lazyClientHost'; import { noopRequestCancellerFactory } from './tsServer/cancellation'; import { noopLogDirectoryProvider } from './tsServer/logDirectoryProvider'; @@ -52,9 +51,6 @@ export function activate( const activeJsTsEditorTracker = new ActiveJsTsEditorTracker(); context.subscriptions.push(activeJsTsEditorTracker); - const jsWalkthroughState = new JsWalkthroughState(); - context.subscriptions.push(jsWalkthroughState); - const versionProvider = new StaticVersionProvider( new TypeScriptVersion( TypeScriptVersionSource.Bundled, @@ -74,7 +70,7 @@ export function activate( onCompletionAccepted.fire(item); }); - registerBaseCommands(commandManager, lazyClientHost, pluginManager, activeJsTsEditorTracker, jsWalkthroughState); + registerBaseCommands(commandManager, lazyClientHost, pluginManager, activeJsTsEditorTracker); // context.subscriptions.push(task.register(lazyClientHost.map(x => x.serviceClient))); diff --git a/extensions/typescript-language-features/src/extension.ts b/extensions/typescript-language-features/src/extension.ts index c6a0d907200..b803afab057 100644 --- a/extensions/typescript-language-features/src/extension.ts +++ b/extensions/typescript-language-features/src/extension.ts @@ -8,7 +8,6 @@ import * as vscode from 'vscode'; import { Api, getExtensionApi } from './api'; import { CommandManager } from './commands/commandManager'; import { registerBaseCommands } from './commands/index'; -import { JsWalkthroughState } from './commands/jsWalkthrough'; import { ExperimentationService } from './experimentationService'; import { createLazyClientHost, lazilyActivateClient } from './lazyClientHost'; import { nodeRequestCancellerFactory } from './tsServer/cancellation.electron'; @@ -39,9 +38,6 @@ export function activate( const activeJsTsEditorTracker = new ActiveJsTsEditorTracker(); context.subscriptions.push(activeJsTsEditorTracker); - const jsWalkthroughState = new JsWalkthroughState(); - context.subscriptions.push(jsWalkthroughState); - const lazyClientHost = createLazyClientHost(context, onCaseInsensitiveFileSystem(), { pluginManager, commandManager, @@ -55,7 +51,7 @@ export function activate( onCompletionAccepted.fire(item); }); - registerBaseCommands(commandManager, lazyClientHost, pluginManager, activeJsTsEditorTracker, jsWalkthroughState); + registerBaseCommands(commandManager, lazyClientHost, pluginManager, activeJsTsEditorTracker); // Currently no variables in use. new ExperimentationService(context);