diff --git a/.vscode/launch.json b/.vscode/launch.json index 2506014c71..669e566005 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,14 +1,41 @@ { "version": "0.2.0", "configurations": [ + { + "type": "chrome", + "request": "attach", + "name": "Attach to Chrome", + "port": 9222, + "webRoot": "${workspaceFolder}" + }, + { + "name": "LSP Server", + "type": "node", + "request": "launch", + "args": [ + "${workspaceFolder}/Composer/packages/tools/language-servers/language-generation/demo/src/server.ts" + ], + "runtimeArgs": [ + "--nolazy", + "-r", + "${workspaceFolder}/Composer/node_modules/ts-node/register" + ], + "sourceMaps": true, + "cwd": "${workspaceFolder}/Composer/packages/tools/language-servers/language-generation/demo/src", + "protocol": "inspector", + }, { "type": "node", "request": "launch", "name": "Server: Launch", - "args": ["./build/server.js"], + "args": [ + "./build/server.js" + ], "preLaunchTask": "server: build", "restart": true, - "outFiles": ["./build/*"], + "outFiles": [ + "./build/*" + ], "envFile": "${workspaceFolder}/Composer/packages/server/.env", "outputCapture": "std", "cwd": "${workspaceFolder}/Composer/packages/server" @@ -20,8 +47,14 @@ "name": "Jest Debug", "program": "${workspaceRoot}/Composer/node_modules/jest/bin/jest", "stopOnEntry": false, - "args": ["--runInBand", "--env=jsdom", "--config=jest.config.js"], - "runtimeArgs": ["--inspect-brk"], + "args": [ + "--runInBand", + "--env=jsdom", + "--config=jest.config.js" + ], + "runtimeArgs": [ + "--inspect-brk" + ], "cwd": "${workspaceRoot}/Composer/packages/server", "sourceMaps": true, "console": "integratedTerminal" diff --git a/Composer/jest.config.js b/Composer/jest.config.js index 32b10b6b50..da2165fe69 100644 --- a/Composer/jest.config.js +++ b/Composer/jest.config.js @@ -41,5 +41,6 @@ module.exports = { '/packages/extensions/visual-designer', '/packages/lib/code-editor', '/packages/lib/shared', + '/packages/tools/language-servers/language-generation', ], }; diff --git a/Composer/package.json b/Composer/package.json index 21b3b3df5e..52a879a14e 100644 --- a/Composer/package.json +++ b/Composer/package.json @@ -13,16 +13,20 @@ "packages/extensions", "packages/extensions/*", "packages/lib", - "packages/lib/*" + "packages/lib/*", + "packages/tools", + "packages/tools/language-servers", + "packages/tools/language-servers/*" ], "scripts": { "build": "node scripts/begin.js && yarn build:prod", - "build:prod": "yarn build:lib && yarn build:extensions && yarn build:server && yarn build:client", - "build:dev": "yarn build:lib && yarn build:extensions", + "build:prod": "yarn build:dev && yarn build:server && yarn build:client", + "build:dev": "yarn build:tools && yarn build:lib && yarn build:extensions", "build:lib": "yarn workspace @bfc/libs build:all", "build:extensions": "yarn workspace @bfc/extensions build:all", "build:server": "yarn workspace @bfc/server build", "build:client": "yarn workspace @bfc/client build", + "build:tools": "yarn workspace @bfc/tools build:all", "start": "cross-env NODE_ENV=production PORT=3000 yarn start:server", "startall": "concurrently --kill-others-on-fail \"npm:runtime\" \"npm:start\"", "start:dev": "concurrently \"npm:start:client\" \"npm:start:server:dev\"", diff --git a/Composer/packages/client/config/webpack.config.js b/Composer/packages/client/config/webpack.config.js index 0a98e430f2..f56da750fe 100644 --- a/Composer/packages/client/config/webpack.config.js +++ b/Composer/packages/client/config/webpack.config.js @@ -228,6 +228,10 @@ module.exports = function(webpackEnv) { // `web` extension prefixes have been added for better support // for React Native Web. extensions: paths.moduleFileExtensions.map(ext => `.${ext}`), + alias: { + // Support lsp code editor + vscode: require.resolve('monaco-languageclient/lib/vscode-compatibility'), + }, plugins: [ // Adds support for installing with Plug'n'Play, leading to faster installs and adding // guards against forgotten dependencies and such. @@ -402,7 +406,7 @@ module.exports = function(webpackEnv) { plugins: [ new MonacoWebpackPlugin({ // available options are documented at https://github.com/Microsoft/monaco-editor-webpack-plugin#options - languages: ['markdown', 'botbuilderlg', 'json'], + languages: ['markdown', 'json'], }), // Generates an `index.html` file with the