From db0d3f089d019961b2f2b1eaca3cff0bba0612c7 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Mon, 6 Jul 2020 14:12:16 +0200 Subject: [PATCH] add stripped-down serverless extension editing --- .../extension-browser.webpack.config.js | 21 +++++++++++++++++++ .../extension.webpack.config.js | 2 +- extensions/extension-editing/package.json | 3 ++- .../src/extensionEditingBrowserMain.ts | 21 +++++++++++++++++++ .../{extension.ts => extensionEditingMain.ts} | 0 5 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 extensions/extension-editing/extension-browser.webpack.config.js create mode 100644 extensions/extension-editing/src/extensionEditingBrowserMain.ts rename extensions/extension-editing/src/{extension.ts => extensionEditingMain.ts} (100%) diff --git a/extensions/extension-editing/extension-browser.webpack.config.js b/extensions/extension-editing/extension-browser.webpack.config.js new file mode 100644 index 00000000000..1018f45a81a --- /dev/null +++ b/extensions/extension-editing/extension-browser.webpack.config.js @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +//@ts-check + +'use strict'; + +const withBrowserDefaults = require('../shared.webpack.config').browser; + +module.exports = withBrowserDefaults({ + context: __dirname, + entry: { + extension: './src/extensionEditingBrowserMain.ts' + }, + output: { + filename: 'extensionEditingBrowserMain.js' + } +}); + diff --git a/extensions/extension-editing/extension.webpack.config.js b/extensions/extension-editing/extension.webpack.config.js index 40996d0caf5..499fbf1405c 100644 --- a/extensions/extension-editing/extension.webpack.config.js +++ b/extensions/extension-editing/extension.webpack.config.js @@ -12,7 +12,7 @@ const withDefaults = require('../shared.webpack.config'); module.exports = withDefaults({ context: __dirname, entry: { - extension: './src/extension.ts', + extension: './src/extensionEditingMain.ts', }, externals: { '../../../product.json': 'commonjs ../../../product.json', diff --git a/extensions/extension-editing/package.json b/extensions/extension-editing/package.json index 75d77925b0d..bdd02d870a9 100644 --- a/extensions/extension-editing/package.json +++ b/extensions/extension-editing/package.json @@ -13,7 +13,8 @@ "onLanguage:markdown", "onLanguage:typescript" ], - "main": "./out/extension", + "main": "./out/extensionEditingMain", + "browser": "./dist/browser/extensionEditingBrowserMain", "scripts": { "compile": "gulp compile-extension:extension-editing", "watch": "gulp watch-extension:extension-editing" diff --git a/extensions/extension-editing/src/extensionEditingBrowserMain.ts b/extensions/extension-editing/src/extensionEditingBrowserMain.ts new file mode 100644 index 00000000000..16f4d5e7d0b --- /dev/null +++ b/extensions/extension-editing/src/extensionEditingBrowserMain.ts @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { PackageDocument } from './packageDocumentHelper'; + +export function activate(context: vscode.ExtensionContext) { + //package.json suggestions + context.subscriptions.push(registerPackageDocumentCompletions()); + +} + +function registerPackageDocumentCompletions(): vscode.Disposable { + return vscode.languages.registerCompletionItemProvider({ language: 'json', pattern: '**/package.json' }, { + provideCompletionItems(document, position, token) { + return new PackageDocument(document).provideCompletionItems(position, token); + } + }); +} diff --git a/extensions/extension-editing/src/extension.ts b/extensions/extension-editing/src/extensionEditingMain.ts similarity index 100% rename from extensions/extension-editing/src/extension.ts rename to extensions/extension-editing/src/extensionEditingMain.ts