diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0477b20b..2be816f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -59,7 +59,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: vscode-bitbake - path: client/yocto-bitbake*.vsix + path: ./yocto-bitbake*.vsix # Inspired by https://github.com/microsoft/vscode-platform-specific-sample/blob/a0192a21122dfa5c90934b006f027cdf4e4d892d/.github/workflows/ci.yml#L64C11-L64C11 MIT License publish-vsce: @@ -93,7 +93,7 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: npm run clean - - run: cd server && npm install + - run: npm install && npm run fetch:docs - run: cd server && npm pack - name: Archive server package uses: actions/upload-artifact@v4 diff --git a/.vscode/launch.json b/.vscode/launch.json index 9fa28637..139b1392 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,11 +8,12 @@ "request": "launch", "runtimeExecutable": "${execPath}", "args": [ - "--extensionDevelopmentPath=${workspaceRoot}/client" + "--extensionDevelopmentPath=${workspaceRoot}" ], "sourceMaps": true, "outFiles": [ "${workspaceRoot}/client/out/**/*.js", + "${workspaceRoot}/server/out/**/*.js" ], "preLaunchTask": "watch" @@ -23,12 +24,13 @@ "request": "launch", "runtimeExecutable": "${execPath}", "args": [ - "--extensionDevelopmentPath=${workspaceRoot}/client", + "--extensionDevelopmentPath=${workspaceRoot}", "--extensionDevelopmentKind=web" ], "sourceMaps": true, "outFiles": [ "${workspaceRoot}/client/out/**/*.js", + "${workspaceRoot}/server/out/**/*.js" ], "preLaunchTask": "watch" @@ -40,7 +42,7 @@ "port": 6010, "sourceMaps": true, "outFiles": [ - "${workspaceRoot}/client/server/**/*.js", + "${workspaceRoot}/server/out/**/*.js", ], "preLaunchTask": "watch" }, @@ -52,7 +54,7 @@ "sourceMaps": true, "outFiles": [ "${workspaceRoot}/client/out/**/*.js", - "${workspaceRoot}/client/server/**/*.js" + "${workspaceRoot}/server/out/**/*.js" ], "preLaunchTask": "compile", "console": "integratedTerminal" @@ -64,15 +66,15 @@ "request": "launch", "runtimeExecutable": "${execPath}", "args": [ - "--extensionDevelopmentPath=${workspaceRoot}/client", + "--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/integration-tests/out/index", "--disable-workspace-trust", "${workspaceRoot}/integration-tests/project-folder" ], "sourceMaps": true, "outFiles": [ - "${workspaceRoot}/*/out/**/*.js", - "${workspaceRoot}/client/server/**/*.js" + "${workspaceRoot}/client/out/**/*.js", + "${workspaceRoot}/server/out/**/*.js" ], "preLaunchTask": "compile", } diff --git a/.vscodeignore b/.vscodeignore new file mode 100644 index 00000000..7d32c856 --- /dev/null +++ b/.vscodeignore @@ -0,0 +1,13 @@ +__mocks__/ +.github/ +.vscode/ +integration-tests/ +resources/ +scripts/ +**/*.d.ts +**/__tests__ +test +src +**/*.map +tsconfig.* +.gitignore \ No newline at end of file diff --git a/client/CHANGELOG.md b/CHANGELOG.md similarity index 100% rename from client/CHANGELOG.md rename to CHANGELOG.md diff --git a/client/.vscodeignore b/client/.vscodeignore deleted file mode 100644 index 4a9c4402..00000000 --- a/client/.vscodeignore +++ /dev/null @@ -1,7 +0,0 @@ -**/*.d.ts -**/__tests__ -test -src -**/*.map -tsconfig.* -server/package_lock.json diff --git a/client/package.json b/client/package.json index 483130bd..c2591f9d 100644 --- a/client/package.json +++ b/client/package.json @@ -13,7 +13,6 @@ "license": "MIT", "version": "2.4.0", "publisher": "yocto-project", - "icon": "images/icon.png", "bugs": { "url": "https://github.com/yoctoproject/vscode-bitbake/issues" }, @@ -25,823 +24,10 @@ "engines": { "vscode": "^1.75.0" }, - "categories": [ - "Programming Languages" - ], - "activationEvents": [ - "workspaceContains:**/bblayers.conf", - "workspaceContains:**/*.bb" - ], - "main": "./out/extension", - "browser": "./out/extension-web", - "contributes": { - "languages": [ - { - "id": "bitbake", - "aliases": [ - "BitBake", - "bitbake" - ], - "extensions": [ - ".bb", - ".bbappend", - ".bbclass" - ], - "configuration": "./language-configuration.json", - "icon": { - "dark": "images/yocto-file-icon.svg", - "light": "images/yocto-file-icon.svg" - } - } - ], - "grammars": [ - { - "language": "bitbake", - "scopeName": "source.bb", - "path": "./syntaxes/bitbake.tmLanguage.json" - } - ], - "semanticTokenScopes": [ - { - "language": "bitbake", - "scopes": { - "operator.readonly": [ - "keyword.other.bitbake-operator.bb" - ] - } - } - ], - "configuration": { - "type": "object", - "title": "BitBake", - "properties": { - "bitbake.loggingLevel": { - "type": "string", - "enum": [ - "error", - "info", - "debug" - ], - "default": "error", - "markdownDescription": "Adjust the logging level: `error` for reporting only errors, `info` for displaying information useful to the user, and `debug` for the same information as `info,` but with additional debugging details." - }, - "bitbake.parseOnSave": { - "type": "boolean", - "default": true, - "description": "Activate parsing on save. When a recipe is saved, bitbake will automatically be run to parse it." - }, - "bitbake.eSDKMode": { - "type": "boolean", - "default": false, - "deprecationMessage": "eSDK mode is now automatically detected. This setting is deprecated and will be removed in a future release.", - "markdownDescription": "Activate eSDK only mode. This tells the extension that devtool is available but not bitbake, which will disable unavailable features. You should point the `bitbake.pathToEnvScript` setting to the environment script of the eSDK." - }, - "bitbake.pathToEnvScript": { - "type": "string", - "examples": [ - "${workspaceFolder}/sources/poky/oe-init-build-env" - ], - "markdownDescription": "Set the path to the environment script to configure the BitBake project. _(Optional)_, see the commandWrapper setting.\n\nExample: `${workspaceFolder}/sources/poky/oe-init-build-env`" - }, - "bitbake.pathToBuildFolder": { - "type": "string", - "examples": [ - "${workspaceFolder}/build" - ], - "description": "Set the build folder for the BitBake project. _(Optional)_, see the commandWrapper setting.\n\nExample: '${workspaceFolder}/build'" - }, - "bitbake.pathToBitbakeFolder": { - "type": "string", - "default": "${workspaceFolder}/sources/poky/bitbake", - "description": "Set the path to the BitBake folder. Used to provide Python embedded language features." - }, - "bitbake.commandWrapper": { - "type": "string", - "examples": [ - "docker run --rm -v ${workspaceFolder}:${workspaceFolder} crops/poky --workdir=${workspaceFolder} /bin/bash -c", - "kas shell -c", - "cqfd run", - "${workspaceFolder}/build.sh --" - ], - "markdownDescription": "An optional build tool command to wrap around BitBake commands.\n\nVarious tools provide ways to automatically configure the BitBake environment, or even call it inside containers. This option allows you to use them through this extension by wrapping around the bitbake invocation.\n\nThe resulting commands generated by this extension will be for example:\n\n `$ 'bitbake core-image-minimal'`\n\n `$ '. && bitbake core-image-minimal'`\n\nSee examples:\n\n`docker run --rm -v ${workspaceFolder}:${workspaceFolder} crops/poky --workdir=${workspaceFolder} /bin/bash -c`\n\n`kas shell -c`\n\n`cqfd run`\n\n`${workspaceFolder}/build.sh --`\n\nNote: Relative paths must be relative to the workingDirectory folder, where the command will be run." - }, - "bitbake.workingDirectory": { - "type": "string", - "default": "${workspaceFolder}", - "description": "Set the working directory for running BitBake command." - }, - "bitbake.shellEnv": { - "type": "object", - "default": {}, - "description": "Environment variables to set before running the BitBake command.", - "examples": [ - { - "BB_ENV_PASSTHROUGH": "SSTATE_DIR", - "SSTATE_DIR": "/mnt/yocto-sstate-cache" - } - ] - }, - "bitbake.sshTarget": { - "type": "string", - "markdownDescription": "Hostname or IP address of the SSH target for deploying recipes or SDK builds to a remote target. _(Optional)_\n\nExample: `root@192.168.0.50`\n\nAdditional SSH options must be defined through your SSH configuration file (`~/.ssh/config`).", - "examples": [ - "root@192.168.0.50" - ] - }, - "bitbake.sdkImage": { - "type": "string", - "markdownDescription": "SDK image to use for cross-compilation and debugging.\n\nExample: `core-image-minimal`", - "examples": "core-image-minimal" - }, - "bitbake.disableEmbeddedLanguagesFiles": { - "type": "boolean", - "markdownDescription": "Disables temporary files generated for BitBake's embedded languages. This action will turn off most features within Shell and Python regions of BitBake code. This is intended for users who don't want temporary files to be saved on their drive, or do not want to see the diagnostics of these temporary files polluting their 'PROBLEMS' tab. Please note a reload of VS Code might be required after activating or deactivating this setting for the full change to take effect.", - "default": false - }, - "bitbake.buildConfigurations": { - "type": "array", - "description": "Array of alternative configurations for starting bitbake. It can be useful to handle multiple build folders for multiple targets (MACHINE configurations). If an option is not defined, the value from the main configuration will be used.", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string", - "markdownDescription": "Name of the configuration." - }, - "pathToEnvScript": { - "type": "string", - "markdownDescription": "Sub-configuration specific setting to replace the main `pathToEnvScript`. See the `bitbake.pathToEnvScript` setting." - }, - "pathToBuildFolder": { - "type": "string", - "markdownDescription": "Sub-configuration specific setting to replace the main `pathToBuildFolder`. See the `bitbake.pathToBuildFolder` setting." - }, - "commandWrapper": { - "type": "string", - "markdownDescription": "Sub-configuration specific setting to replace the main `commandWrapper`. See the `bitbake.commandWrapper` setting." - }, - "workingDirectory": { - "type": "string", - "markdownDescription": "Sub-configuration specific setting to replace the main `workingDirectory`. See the `bitbake.workingDirectory` setting." - }, - "shellEnv": { - "type": "object", - "markdownDescription": "Sub-configuration specific setting to replace the main `shellEnv`. See the `bitbake.shellEnv` setting." - }, - "sshTarget": { - "type": "string", - "markdownDescription": "Sub-configuration specific setting to replace the main `sshTarget`. See the `bitbake.sshTarget` setting." - }, - "sdkImage": { - "type": "string", - "markdownDescription": "Sub-configuration specific setting to replace the main `sdkImage`. See the `bitbake.sdkImage` setting." - } - }, - "required": [ - "name" - ] - } - } - } - }, - "taskDefinitions": [ - { - "type": "bitbake", - "properties": { - "recipes": { - "description": "Bitbake recipe(s)", - "type": "array", - "items": { - "type": "string" - } - }, - "task": { - "type": "string", - "description": "Bitbake task to run (build by default)" - }, - "options": { - "type": "object", - "description": "Additional options to pass to the bitbake command", - "properties": { - "continue": { - "type": "boolean", - "description": "Continue as much as possible after an error (-k)" - }, - "force": { - "type": "boolean", - "description": "Force the specified targets/task to run (-f)." - }, - "parseOnly": { - "type": "boolean", - "description": "Run bitbake in parse-only mode (-p)." - } - } - }, - "specialCommand": { - "type": "string", - "description": "Special command to run instead of bitbake. Intended for internal use by the extension.", - "pattern": "^devtool\\s.*$" - } - } - } - ], - "problemMatchers": [ - { - "name": "bitbake-ParseError", - "source": "bitbake", - "owner": "bitbake", - "fileLocation": [ - "autoDetect", - "${cwd}" - ], - "pattern": [ - { - "regexp": "^.*ParseError (at|in) (.+?):(\\d+)?:? (unparsed line: '(.+)')$", - "file": 2, - "line": 3, - "message": 4, - "code": 5, - "column": 0 - } - ] - }, - { - "name": "bitbake-UnableToParse", - "source": "bitbake", - "owner": "bitbake", - "fileLocation": [ - "autoDetect", - "${cwd}" - ], - "pattern": { - "regexp": "(ERROR): (Unable to parse (.+))$", - "severity": 1, - "file": 3, - "message": 2, - "kind": "File" - } - }, - { - "name": "bitbake-Variable", - "source": "bitbake", - "owner": "bitbake", - "fileLocation": [ - "autoDetect", - "${cwd}" - ], - "pattern": { - "regexp": "(^Parsing recipes...)?(ERROR): (.+?): (.*?) file: (.+) line: (\\d+) (.*)$", - "file": 2, - "line": 5, - "severity": 1, - "message": 6 - } - }, - { - "name": "bitbake-non-existent-uri", - "source": "bitbake", - "owner": "bitbake", - "fileLocation": [ - "autoDetect", - "${cwd}" - ], - "pattern": { - "regexp": "(ERROR): (.+?): (.*non-existent-uri: file could not be found)$", - "file": 2, - "severity": 1, - "message": 3 - } - }, - { - "name": "bitbake-compilation-python-function", - "source": "bitbake", - "owner": "bitbake", - "fileLocation": [ - "autoDetect", - "${cwd}" - ], - "pattern": { - "regexp": "(ERROR): (.+): (Error in compiling python function) in (.*), line (\\d+):$", - "file": 2, - "severity": 1, - "line": 5, - "message": 3 - } - }, - { - "name": "bitbake-execution-error", - "source": "bitbake", - "owner": "bitbake", - "fileLocation": [ - "autoDetect", - "${cwd}" - ], - "pattern": { - "regexp": "(^Parsing recipes...)?(ERROR): (.+?): (.*):?$", - "file": 3, - "severity": 2, - "message": 4 - } - }, - { - "name": "bitbake-task-error", - "source": "bitbake", - "owner": "bitbake", - "fileLocation": [ - "autoDetect", - "${cwd}" - ], - "pattern": { - "regexp": "^(ERROR): Task \\((.*):(.*\\) .*)$", - "file": 2, - "message": 3, - "severity": 1 - } - } - ], - "commands": [ - { - "command": "bitbake.rescan-project", - "title": "BitBake: Rescan Project", - "description": "This command rescans the bitbake project.", - "icon": "$(refresh)" - }, - { - "command": "bitbake.pick-configuration", - "title": "BitBake: Pick configuration", - "description": "Select the active build configuration from the settings to use for bitbake commands." - }, - { - "command": "bitbake.build-recipe", - "title": "BitBake: Build recipe", - "description": "Build a recipe or an image.", - "icon": "$(gear)" - }, - { - "command": "bitbake.clean-recipe", - "title": "BitBake: Clean recipe", - "description": "Clean a recipe or an image (bitbake -c clean).", - "icon": "$(exclude)" - }, - { - "command": "bitbake.run-task", - "title": "BitBake: Run task for recipe", - "description": "Run a specific task for a bitbake recipe." - }, - { - "command": "bitbake.scan-recipe-env", - "title": "BitBake: Scan Recipe", - "description": "Run 'bitbake -e' on the chosen recipe to improve the language services such as hover definition" - }, - { - "command": "bitbake.open-recipe-workdir", - "title": "BitBake: Open recipe's workdir", - "description": "Open a recipe's workdir in VSCode.", - "icon": "$(file-symlink-directory)" - }, - { - "command": "bitbake.drop-recipe", - "title": "BitBake: Drop a recipe from the active workspace", - "description": "Stop watching or suggesting a recipe in bitbake commands.", - "icon": "$(close)" - }, - { - "command": "bitbake.watch-recipe", - "title": "BitBake: Add a recipe to the active workspace", - "icon": "$(add)", - "description": "Start watching or suggesting a recipe in bitbake commands." - }, - { - "command": "bitbake.drop-all-recipes", - "title": "BitBake: Drop all recipes from the active workspace", - "description": "Clear all recipes in the recipes view and from all command suggestions.", - "icon": "$(close-all)" - }, - { - "command": "bitbake.parse-recipes", - "title": "BitBake: Parse all recipes", - "description": "This command runs bitbake in parse-only mode." - }, - { - "command": "bitbake.start-toaster-in-browser", - "title": "BitBake: Start toaster in browser", - "description": "Start Toaster and reveal it in the browser.", - "icon": "$(preview)" - }, - { - "command": "bitbake.stop-toaster", - "title": "BitBake: Stop Toaster", - "description": "This stops Toaster by running `source toaster stop`.", - "icon": "$(stop-circle)" - }, - { - "command": "bitbake.devtool-modify", - "title": "BitBake: Devtool: Modify recipe", - "description": "Open a new devtool workspace to modify a recipe's sources.", - "icon": "$(add)" - }, - { - "command": "bitbake.devtool-ide-sdk", - "title": "BitBake: Devtool: Configure VSCode SDK", - "description": "Configure a devtool sources' workspace for cross-compilation and debugging." - }, - { - "command": "bitbake.devtool-sdk-fallback", - "title": "BitBake: Devtool: Configure devtool SDK fallback", - "description": "Configure a devtool sources' workspace to use `devtool build` and `devtool deploy-target` if `devtool ide-sdk` is not available." - }, - { - "command": "bitbake.devtool-open-workspace", - "title": "BitBake: Devtool: Open Workspace", - "description": "Open a devtool sources workspace in a new VSCode window.", - "icon": "$(file-symlink-directory)" - }, - { - "command": "bitbake.devtool-reset", - "title": "BitBake: Devtool: Reset", - "description": "Remove a devtool workspace.", - "icon": "$(trash)" - }, - { - "command": "bitbake.devtool-update", - "title": "BitBake: Devtool: Update recipe", - "description": "Update a recipe from a devtool workspace's modifications.", - "icon": "$(save-as)" - }, - { - "command": "bitbake.devtool-build", - "title": "Bitbake: Devtool: Build recipe", - "description": "Build a recipe through devtool.", - "icon": "$(gear)" - }, - { - "command": "bitbake.devtool-deploy", - "title": "Bitbake: Devtool: Deploy recipe", - "description": "Deploy a devtool package on an SSH target." - }, - { - "command": "bitbake.devtool-clean", - "title": "BitBake: Devtool: Clean recipe", - "description": "Clean a recipe using devtool.", - "icon": "$(exclude)" - }, - { - "command": "bitbake.terminal-profile", - "title": "BitBake: Open interactive terminal", - "description": "Open an interactive terminal with the bitbake environment." - }, - { - "command": "bitbake.recipe-devshell", - "title": "BitBake: Open recipe's devshell", - "description": "Open an interactive BitBake devshell for a recipe." - }, - { - "command": "bitbake.collapse-list", - "title": "BitBake: Collapse list", - "description": "Collapse the focused list of recipes or devtool workspaces.", - "icon": "$(collapse-all)" - } - ], - "viewsContainers": { - "activitybar": [ - { - "id": "bitbakeView", - "title": "Bitbake", - "icon": "images/yocto-view-icon.svg" - } - ] - }, - "views": { - "bitbakeView": [ - { - "id": "bitbakeRecipes", - "name": "Recipes Explorer", - "contextualTitle": "Recipes explorer", - "icon": "$(library)", - "when": "bitbake.active" - }, - { - "id": "devtoolWorkspaces", - "name": "Devtool Workspaces", - "contextualTitle": "Devtool workspaces", - "icon": "$(symbol-property)", - "when": "bitbake.active" - } - ] - }, - "submenus": [ - { - "id": "bitbake/main", - "label": "BitBake", - "icon": "$(ellipsis)" - }, - { - "id": "devtool/main", - "label": "BitBake", - "icon": "$(ellipsis)" - } - ], - "menus": { - "bitbake/main": [ - { - "command": "bitbake.build-recipe", - "group": "0@bitbake_build@0" - }, - { - "command": "bitbake.clean-recipe", - "group": "0@bitbake_build@1" - }, - { - "command": "bitbake.run-task", - "group": "0@bitbake_build@2" - }, - { - "command": "bitbake.drop-recipe", - "group": "0@bitbake_build@3" - }, - { - "command": "bitbake.scan-recipe-env", - "group": "1@bitbake_dev@0" - }, - { - "command": "bitbake.recipe-devshell", - "group": "1@bitbake_dev@1" - }, - { - "command": "bitbake.terminal-profile", - "group": "1@bitbake_dev@2" - }, - { - "command": "bitbake.open-recipe-workdir", - "group": "1@bitbake_dev@3" - }, - { - "command": "bitbake.start-toaster-in-browser", - "group": "1@bitbake_dev@4" - }, - { - "command": "bitbake.devtool-modify", - "group": "2@bitbake_devtool@0" - } - ], - "devtool/main": [ - { - "command": "bitbake.devtool-build", - "group": "0@devtool_build@0" - }, - { - "command": "bitbake.devtool-clean", - "group": "0@devtool_build@1" - }, - { - "command": "bitbake.devtool-deploy", - "group": "0@devtool_build@2" - }, - { - "command": "bitbake.devtool-open-workspace", - "group": "1@devtool_dev@0" - }, - { - "command": "bitbake.devtool-ide-sdk", - "group": "1@devtool_dev@1" - }, - { - "command": "bitbake.devtool-sdk-fallback", - "group": "1@devtool_dev@2" - }, - { - "command": "bitbake.terminal-profile", - "group": "1@devtool_dev@3" - }, - { - "command": "bitbake.devtool-update", - "group": "1@devtool_finalize@0" - }, - { - "command": "bitbake.devtool-reset", - "group": "1@devtool_finalize@1" - } - ], - "explorer/context": [ - { - "submenu": "bitbake/main", - "group": "bitbake", - "when": "resourceLangId == bitbake" - } - ], - "editor/context": [ - { - "submenu": "bitbake/main", - "group": "bitbake@0", - "when": "editorLangId == bitbake" - } - ], - "editor/title/context": [ - { - "submenu": "bitbake/main", - "group": "bitbake", - "when": "resourceLangId == bitbake" - } - ], - "view/title": [ - { - "command": "bitbake.watch-recipe", - "group": "navigation@0", - "when": "view == bitbakeRecipes" - }, - { - "command": "bitbake.rescan-project", - "group": "navigation@1", - "when": "view == bitbakeRecipes" - }, - { - "command": "bitbake.collapse-list", - "group": "navigation@2", - "when": "view == bitbakeRecipes" - }, - { - "command": "bitbake.drop-all-recipes", - "group": "navigation@3", - "when": "view == bitbakeRecipes" - }, - { - "submenu": "bitbake/main", - "group": "navigation@99", - "when": "view == bitbakeRecipes" - }, - { - "command": "bitbake.devtool-modify", - "group": "navigation@0", - "when": "view == devtoolWorkspaces" - }, - { - "command": "bitbake.rescan-project", - "group": "navigation@1", - "when": "view == devtoolWorkspaces" - }, - { - "submenu": "devtool/main", - "group": "navigation@99", - "when": "view == devtoolWorkspaces" - } - ], - "view/item/context": [ - { - "command": "bitbake.build-recipe", - "group": "inline@0", - "when": "viewItem == bitbakeRecipeCtx" - }, - { - "command": "bitbake.clean-recipe", - "group": "inline@1", - "when": "viewItem == bitbakeRecipeCtx" - }, - { - "command": "bitbake.drop-recipe", - "group": "inline@2", - "when": "viewItem == bitbakeRecipeCtx" - }, - { - "submenu": "bitbake/main", - "group": "inline@99", - "when": "viewItem == bitbakeRecipeCtx" - }, - { - "command": "bitbake.devtool-build", - "group": "inline@0", - "when": "viewItem == devtoolWorskpaceCtx" - }, - { - "command": "bitbake.devtool-update", - "group": "inline@1", - "when": "viewItem == devtoolWorskpaceCtx" - }, - { - "command": "bitbake.devtool-reset", - "group": "inline@2", - "when": "viewItem == devtoolWorskpaceCtx" - }, - { - "submenu": "devtool/main", - "group": "inline@99", - "when": "viewItem == devtoolWorskpaceCtx" - }, - { - "command": "bitbake.build-recipe", - "group": "0@bitbake_build@0", - "when": "viewItem == bitbakeRecipeCtx" - }, - { - "command": "bitbake.clean-recipe", - "group": "0@bitbake_build@1", - "when": "viewItem == bitbakeRecipeCtx" - }, - { - "command": "bitbake.run-task", - "group": "0@bitbake_build@2", - "when": "viewItem == bitbakeRecipeCtx" - }, - { - "command": "bitbake.drop-recipe", - "group": "0@bitbake_build@3", - "when": "viewItem == bitbakeRecipeCtx" - }, - { - "command": "bitbake.scan-recipe-env", - "group": "1@bitbake_dev@0", - "when": "viewItem == bitbakeRecipeCtx" - }, - { - "command": "bitbake.recipe-devshell", - "group": "1@bitbake_dev@1", - "when": "viewItem == bitbakeRecipeCtx" - }, - { - "command": "bitbake.terminal-profile", - "group": "1@bitbake_dev@2", - "when": "viewItem == bitbakeRecipeCtx" - }, - { - "command": "bitbake.open-recipe-workdir", - "group": "1@bitbake_dev@3", - "when": "viewItem == bitbakeRecipeCtx" - }, - { - "command": "bitbake.devtool-modify", - "group": "2@bitbake_devtool@0", - "when": "viewItem == bitbakeRecipeCtx" - }, - { - "command": "bitbake.devtool-build", - "group": "0@devtool_build@0", - "when": "viewItem == devtoolWorskpaceCtx" - - }, - { - "command": "bitbake.devtool-clean", - "group": "0@devtool_build@1", - "when": "viewItem == devtoolWorskpaceCtx" - - }, - { - "command": "bitbake.devtool-deploy", - "group": "0@devtool_build@2", - "when": "viewItem == devtoolWorskpaceCtx" - - }, - { - "command": "bitbake.devtool-open-workspace", - "group": "1@devtool_dev@0", - "when": "viewItem == devtoolWorskpaceCtx" - - }, - { - "command": "bitbake.devtool-ide-sdk", - "group": "1@devtool_dev@1", - "when": "viewItem == devtoolWorskpaceCtx" - - }, - { - "command": "bitbake.devtool-sdk-fallback", - "group": "1@devtool_dev@2", - "when": "viewItem == devtoolWorskpaceCtx" - - }, - { - "command": "bitbake.terminal-profile", - "group": "1@devtool_dev@3", - "when": "viewItem == devtoolWorskpaceCtx" - - }, - { - "command": "bitbake.devtool-update", - "group": "1@devtool_finalize@0", - "when": "viewItem == devtoolWorskpaceCtx" - - }, - { - "command": "bitbake.devtool-reset", - "group": "1@devtool_finalize@1", - "when": "viewItem == devtoolWorskpaceCtx" - - } - ] - }, - "terminal": { - "profiles": [ - { - "id": "bitbake.terminal", - "title": "bitbake" - } - ] - } - }, "scripts": { "test": "npm run test:grammar", "test:grammar": "vscode-tmgrammar-test ./test/grammars/test-cases/*.bb", - "snap-grammar": "vscode-tmgrammar-snap ./test/grammars/snaps/*.bb -u", - "vscode:prepublish": "npm install --omit=dev && cd ../server && npm install --omit=dev && npm run installServer", - "package": "npm run vscode:prepublish && vsce package" + "snap-grammar": "vscode-tmgrammar-snap ./test/grammars/snaps/*.bb -u" }, "dependencies": { "find": "^0.2.7", @@ -855,9 +41,5 @@ }, "workspaces": [ "src/lib" - ], - "vsce": { - "baseContentUrl": "https://github.com/yoctoproject/vscode-bitbake/raw/HEAD/client", - "baseImageUrl": "https://github.com/yoctoproject/vscode-bitbake/raw/HEAD/client" - } + ] } diff --git a/client/src/language/languageClient.ts b/client/src/language/languageClient.ts index 72e45beb..4aa9bad6 100644 --- a/client/src/language/languageClient.ts +++ b/client/src/language/languageClient.ts @@ -35,7 +35,7 @@ import { middlewareProvideReferences } from './middlewareReferences' import { RequestMethod } from '../lib/src/types/requests' export async function activateLanguageServer (context: ExtensionContext, bitBakeProjectScanner: BitBakeProjectScanner): Promise { - const serverModule = context.asAbsolutePath(path.join('server', 'src', 'server.js')) + const serverModule = context.asAbsolutePath(path.join('server', 'out', 'src', 'server.js')) // The debug options for the server // Use --inspect-brk instead of --inspect if you want to debug the server startup code const debugOptions = { execArgv: ['--nolazy', '--inspect=localhost:6010'] } diff --git a/integration-tests/src/runTest.ts b/integration-tests/src/runTest.ts index 05ac7cd7..3d491bf0 100644 --- a/integration-tests/src/runTest.ts +++ b/integration-tests/src/runTest.ts @@ -31,7 +31,7 @@ async function main (): Promise { ) // The folder containing the Extension Manifest package.json // Passed to `--extensionDevelopmentPath` - const extensionDevelopmentPath = path.resolve(__dirname, '../../client/') + const extensionDevelopmentPath = path.resolve(__dirname, '../../') // The path to the extension test runner script // Passed to --extensionTestsPath diff --git a/jest.config.js b/jest.config.js index bac1017c..2a4e2829 100644 --- a/jest.config.js +++ b/jest.config.js @@ -10,7 +10,7 @@ module.exports = { ], modulePathIgnorePatterns: [ "/.vscode-test", - "/client/server", + "/server/out", "/integration-tests", "/client/out" ], diff --git a/package-lock.json b/package-lock.json index 4d584e43..49acb9c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,9 +12,6 @@ "version": "2.4.0", "hasInstallScript": true, "license": "MIT", - "workspaces": [ - "client/src/lib" - ], "devDependencies": { "@types/glob": "^8.1.0", "@types/jest": "^29.5.5", @@ -37,11 +34,15 @@ "ts-jest": "^29.1.1", "typescript": "^5.1.3", "vscode-tmgrammar-test": "^0.1.2" + }, + "engines": { + "vscode": "^1.75.0" } }, "client": { "name": "bitbake", "version": "1.1.2", + "extraneous": true, "license": "MIT", "dependencies": { "@types/node": "^20.6.2", @@ -60,6 +61,7 @@ "client/src/lib": { "name": "vscode-bitbake-lib", "version": "2.4.0", + "extraneous": true, "license": "MIT", "engines": { "node": "*" @@ -7203,10 +7205,6 @@ "node": ">=10.12.0" } }, - "node_modules/vscode-bitbake-lib": { - "resolved": "client/src/lib", - "link": true - }, "node_modules/vscode-oniguruma": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", diff --git a/package.json b/package.json index 38ba160a..84c2b57c 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "yocto-bitbake", + "displayName": "Yocto Project BitBake", "description": "Extended Yocto Project and BitBake language support", "author": { "name": "Savoir-faire Linux", @@ -12,6 +13,7 @@ "license": "MIT", "version": "2.4.0", "publisher": "yocto-project", + "icon": "./client/images/icon.png", "bugs": { "url": "https://github.com/yoctoproject/vscode-bitbake/issues" }, @@ -20,15 +22,830 @@ "type": "git", "url": "https://github.com/yoctoproject/vscode-bitbake.git" }, + "engines": { + "vscode": "^1.75.0" + }, + "categories": [ + "Programming Languages" + ], + "activationEvents": [ + "workspaceContains:**/bblayers.conf", + "workspaceContains:**/*.bb" + ], + "main": "./client/out/extension", + "browser": "./client/out/extension-web", + "contributes": { + "languages": [ + { + "id": "bitbake", + "aliases": [ + "BitBake", + "bitbake" + ], + "extensions": [ + ".bb", + ".bbappend", + ".bbclass" + ], + "configuration": "./client/language-configuration.json", + "icon": { + "dark": "./client/images/yocto-file-icon.svg", + "light": "./client/images/yocto-file-icon.svg" + } + } + ], + "grammars": [ + { + "language": "bitbake", + "scopeName": "source.bb", + "path": "./client/syntaxes/bitbake.tmLanguage.json" + } + ], + "semanticTokenScopes": [ + { + "language": "bitbake", + "scopes": { + "operator.readonly": [ + "keyword.other.bitbake-operator.bb" + ] + } + } + ], + "configuration": { + "type": "object", + "title": "BitBake", + "properties": { + "bitbake.loggingLevel": { + "type": "string", + "enum": [ + "error", + "info", + "debug" + ], + "default": "error", + "markdownDescription": "Adjust the logging level: `error` for reporting only errors, `info` for displaying information useful to the user, and `debug` for the same information as `info,` but with additional debugging details." + }, + "bitbake.parseOnSave": { + "type": "boolean", + "default": true, + "description": "Activate parsing on save. When a recipe is saved, bitbake will automatically be run to parse it." + }, + "bitbake.eSDKMode": { + "type": "boolean", + "default": false, + "deprecationMessage": "eSDK mode is now automatically detected. This setting is deprecated and will be removed in a future release.", + "markdownDescription": "Activate eSDK only mode. This tells the extension that devtool is available but not bitbake, which will disable unavailable features. You should point the `bitbake.pathToEnvScript` setting to the environment script of the eSDK." + }, + "bitbake.pathToEnvScript": { + "type": "string", + "examples": [ + "${workspaceFolder}/sources/poky/oe-init-build-env" + ], + "markdownDescription": "Set the path to the environment script to configure the BitBake project. _(Optional)_, see the commandWrapper setting.\n\nExample: `${workspaceFolder}/sources/poky/oe-init-build-env`" + }, + "bitbake.pathToBuildFolder": { + "type": "string", + "examples": [ + "${workspaceFolder}/build" + ], + "description": "Set the build folder for the BitBake project. _(Optional)_, see the commandWrapper setting.\n\nExample: '${workspaceFolder}/build'" + }, + "bitbake.pathToBitbakeFolder": { + "type": "string", + "default": "${workspaceFolder}/sources/poky/bitbake", + "description": "Set the path to the BitBake folder. Used to provide Python embedded language features." + }, + "bitbake.commandWrapper": { + "type": "string", + "examples": [ + "docker run --rm -v ${workspaceFolder}:${workspaceFolder} crops/poky --workdir=${workspaceFolder} /bin/bash -c", + "kas shell -c", + "cqfd run", + "${workspaceFolder}/build.sh --" + ], + "markdownDescription": "An optional build tool command to wrap around BitBake commands.\n\nVarious tools provide ways to automatically configure the BitBake environment, or even call it inside containers. This option allows you to use them through this extension by wrapping around the bitbake invocation.\n\nThe resulting commands generated by this extension will be for example:\n\n `$ 'bitbake core-image-minimal'`\n\n `$ '. && bitbake core-image-minimal'`\n\nSee examples:\n\n`docker run --rm -v ${workspaceFolder}:${workspaceFolder} crops/poky --workdir=${workspaceFolder} /bin/bash -c`\n\n`kas shell -c`\n\n`cqfd run`\n\n`${workspaceFolder}/build.sh --`\n\nNote: Relative paths must be relative to the workingDirectory folder, where the command will be run." + }, + "bitbake.workingDirectory": { + "type": "string", + "default": "${workspaceFolder}", + "description": "Set the working directory for running BitBake command." + }, + "bitbake.shellEnv": { + "type": "object", + "default": {}, + "description": "Environment variables to set before running the BitBake command.", + "examples": [ + { + "BB_ENV_PASSTHROUGH": "SSTATE_DIR", + "SSTATE_DIR": "/mnt/yocto-sstate-cache" + } + ] + }, + "bitbake.sshTarget": { + "type": "string", + "markdownDescription": "Hostname or IP address of the SSH target for deploying recipes or SDK builds to a remote target. _(Optional)_\n\nExample: `root@192.168.0.50`\n\nAdditional SSH options must be defined through your SSH configuration file (`~/.ssh/config`).", + "examples": [ + "root@192.168.0.50" + ] + }, + "bitbake.sdkImage": { + "type": "string", + "markdownDescription": "SDK image to use for cross-compilation and debugging.\n\nExample: `core-image-minimal`", + "examples": "core-image-minimal" + }, + "bitbake.disableEmbeddedLanguagesFiles": { + "type": "boolean", + "markdownDescription": "Disables temporary files generated for BitBake's embedded languages. This action will turn off most features within Shell and Python regions of BitBake code. This is intended for users who don't want temporary files to be saved on their drive, or do not want to see the diagnostics of these temporary files polluting their 'PROBLEMS' tab. Please note a reload of VS Code might be required after activating or deactivating this setting for the full change to take effect.", + "default": false + }, + "bitbake.buildConfigurations": { + "type": "array", + "description": "Array of alternative configurations for starting bitbake. It can be useful to handle multiple build folders for multiple targets (MACHINE configurations). If an option is not defined, the value from the main configuration will be used.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "markdownDescription": "Name of the configuration." + }, + "pathToEnvScript": { + "type": "string", + "markdownDescription": "Sub-configuration specific setting to replace the main `pathToEnvScript`. See the `bitbake.pathToEnvScript` setting." + }, + "pathToBuildFolder": { + "type": "string", + "markdownDescription": "Sub-configuration specific setting to replace the main `pathToBuildFolder`. See the `bitbake.pathToBuildFolder` setting." + }, + "commandWrapper": { + "type": "string", + "markdownDescription": "Sub-configuration specific setting to replace the main `commandWrapper`. See the `bitbake.commandWrapper` setting." + }, + "workingDirectory": { + "type": "string", + "markdownDescription": "Sub-configuration specific setting to replace the main `workingDirectory`. See the `bitbake.workingDirectory` setting." + }, + "shellEnv": { + "type": "object", + "markdownDescription": "Sub-configuration specific setting to replace the main `shellEnv`. See the `bitbake.shellEnv` setting." + }, + "sshTarget": { + "type": "string", + "markdownDescription": "Sub-configuration specific setting to replace the main `sshTarget`. See the `bitbake.sshTarget` setting." + }, + "sdkImage": { + "type": "string", + "markdownDescription": "Sub-configuration specific setting to replace the main `sdkImage`. See the `bitbake.sdkImage` setting." + } + }, + "required": [ + "name" + ] + } + } + } + }, + "taskDefinitions": [ + { + "type": "bitbake", + "properties": { + "recipes": { + "description": "Bitbake recipe(s)", + "type": "array", + "items": { + "type": "string" + } + }, + "task": { + "type": "string", + "description": "Bitbake task to run (build by default)" + }, + "options": { + "type": "object", + "description": "Additional options to pass to the bitbake command", + "properties": { + "continue": { + "type": "boolean", + "description": "Continue as much as possible after an error (-k)" + }, + "force": { + "type": "boolean", + "description": "Force the specified targets/task to run (-f)." + }, + "parseOnly": { + "type": "boolean", + "description": "Run bitbake in parse-only mode (-p)." + } + } + }, + "specialCommand": { + "type": "string", + "description": "Special command to run instead of bitbake. Intended for internal use by the extension.", + "pattern": "^devtool\\s.*$" + } + } + } + ], + "problemMatchers": [ + { + "name": "bitbake-ParseError", + "source": "bitbake", + "owner": "bitbake", + "fileLocation": [ + "autoDetect", + "${cwd}" + ], + "pattern": [ + { + "regexp": "^.*ParseError (at|in) (.+?):(\\d+)?:? (unparsed line: '(.+)')$", + "file": 2, + "line": 3, + "message": 4, + "code": 5, + "column": 0 + } + ] + }, + { + "name": "bitbake-UnableToParse", + "source": "bitbake", + "owner": "bitbake", + "fileLocation": [ + "autoDetect", + "${cwd}" + ], + "pattern": { + "regexp": "(ERROR): (Unable to parse (.+))$", + "severity": 1, + "file": 3, + "message": 2, + "kind": "File" + } + }, + { + "name": "bitbake-Variable", + "source": "bitbake", + "owner": "bitbake", + "fileLocation": [ + "autoDetect", + "${cwd}" + ], + "pattern": { + "regexp": "(^Parsing recipes...)?(ERROR): (.+?): (.*?) file: (.+) line: (\\d+) (.*)$", + "file": 2, + "line": 5, + "severity": 1, + "message": 6 + } + }, + { + "name": "bitbake-non-existent-uri", + "source": "bitbake", + "owner": "bitbake", + "fileLocation": [ + "autoDetect", + "${cwd}" + ], + "pattern": { + "regexp": "(ERROR): (.+?): (.*non-existent-uri: file could not be found)$", + "file": 2, + "severity": 1, + "message": 3 + } + }, + { + "name": "bitbake-compilation-python-function", + "source": "bitbake", + "owner": "bitbake", + "fileLocation": [ + "autoDetect", + "${cwd}" + ], + "pattern": { + "regexp": "(ERROR): (.+): (Error in compiling python function) in (.*), line (\\d+):$", + "file": 2, + "severity": 1, + "line": 5, + "message": 3 + } + }, + { + "name": "bitbake-execution-error", + "source": "bitbake", + "owner": "bitbake", + "fileLocation": [ + "autoDetect", + "${cwd}" + ], + "pattern": { + "regexp": "(^Parsing recipes...)?(ERROR): (.+?): (.*):?$", + "file": 3, + "severity": 2, + "message": 4 + } + }, + { + "name": "bitbake-task-error", + "source": "bitbake", + "owner": "bitbake", + "fileLocation": [ + "autoDetect", + "${cwd}" + ], + "pattern": { + "regexp": "^(ERROR): Task \\((.*):(.*\\) .*)$", + "file": 2, + "message": 3, + "severity": 1 + } + } + ], + "commands": [ + { + "command": "bitbake.rescan-project", + "title": "BitBake: Rescan Project", + "description": "This command rescans the bitbake project.", + "icon": "$(refresh)" + }, + { + "command": "bitbake.pick-configuration", + "title": "BitBake: Pick configuration", + "description": "Select the active build configuration from the settings to use for bitbake commands." + }, + { + "command": "bitbake.build-recipe", + "title": "BitBake: Build recipe", + "description": "Build a recipe or an image.", + "icon": "$(gear)" + }, + { + "command": "bitbake.clean-recipe", + "title": "BitBake: Clean recipe", + "description": "Clean a recipe or an image (bitbake -c clean).", + "icon": "$(exclude)" + }, + { + "command": "bitbake.run-task", + "title": "BitBake: Run task for recipe", + "description": "Run a specific task for a bitbake recipe." + }, + { + "command": "bitbake.scan-recipe-env", + "title": "BitBake: Scan Recipe", + "description": "Run 'bitbake -e' on the chosen recipe to improve the language services such as hover definition" + }, + { + "command": "bitbake.open-recipe-workdir", + "title": "BitBake: Open recipe's workdir", + "description": "Open a recipe's workdir in VSCode.", + "icon": "$(file-symlink-directory)" + }, + { + "command": "bitbake.drop-recipe", + "title": "BitBake: Drop a recipe from the active workspace", + "description": "Stop watching or suggesting a recipe in bitbake commands.", + "icon": "$(close)" + }, + { + "command": "bitbake.watch-recipe", + "title": "BitBake: Add a recipe to the active workspace", + "icon": "$(add)", + "description": "Start watching or suggesting a recipe in bitbake commands." + }, + { + "command": "bitbake.drop-all-recipes", + "title": "BitBake: Drop all recipes from the active workspace", + "description": "Clear all recipes in the recipes view and from all command suggestions.", + "icon": "$(close-all)" + }, + { + "command": "bitbake.parse-recipes", + "title": "BitBake: Parse all recipes", + "description": "This command runs bitbake in parse-only mode." + }, + { + "command": "bitbake.start-toaster-in-browser", + "title": "BitBake: Start toaster in browser", + "description": "Start Toaster and reveal it in the browser.", + "icon": "$(preview)" + }, + { + "command": "bitbake.stop-toaster", + "title": "BitBake: Stop Toaster", + "description": "This stops Toaster by running `source toaster stop`.", + "icon": "$(stop-circle)" + }, + { + "command": "bitbake.devtool-modify", + "title": "BitBake: Devtool: Modify recipe", + "description": "Open a new devtool workspace to modify a recipe's sources.", + "icon": "$(add)" + }, + { + "command": "bitbake.devtool-ide-sdk", + "title": "BitBake: Devtool: Configure VSCode SDK", + "description": "Configure a devtool sources' workspace for cross-compilation and debugging." + }, + { + "command": "bitbake.devtool-sdk-fallback", + "title": "BitBake: Devtool: Configure devtool SDK fallback", + "description": "Configure a devtool sources' workspace to use `devtool build` and `devtool deploy-target` if `devtool ide-sdk` is not available." + }, + { + "command": "bitbake.devtool-open-workspace", + "title": "BitBake: Devtool: Open Workspace", + "description": "Open a devtool sources workspace in a new VSCode window.", + "icon": "$(file-symlink-directory)" + }, + { + "command": "bitbake.devtool-reset", + "title": "BitBake: Devtool: Reset", + "description": "Remove a devtool workspace.", + "icon": "$(trash)" + }, + { + "command": "bitbake.devtool-update", + "title": "BitBake: Devtool: Update recipe", + "description": "Update a recipe from a devtool workspace's modifications.", + "icon": "$(save-as)" + }, + { + "command": "bitbake.devtool-build", + "title": "Bitbake: Devtool: Build recipe", + "description": "Build a recipe through devtool.", + "icon": "$(gear)" + }, + { + "command": "bitbake.devtool-deploy", + "title": "Bitbake: Devtool: Deploy recipe", + "description": "Deploy a devtool package on an SSH target." + }, + { + "command": "bitbake.devtool-clean", + "title": "BitBake: Devtool: Clean recipe", + "description": "Clean a recipe using devtool.", + "icon": "$(exclude)" + }, + { + "command": "bitbake.terminal-profile", + "title": "BitBake: Open interactive terminal", + "description": "Open an interactive terminal with the bitbake environment." + }, + { + "command": "bitbake.recipe-devshell", + "title": "BitBake: Open recipe's devshell", + "description": "Open an interactive BitBake devshell for a recipe." + }, + { + "command": "bitbake.collapse-list", + "title": "BitBake: Collapse list", + "description": "Collapse the focused list of recipes or devtool workspaces.", + "icon": "$(collapse-all)" + } + ], + "viewsContainers": { + "activitybar": [ + { + "id": "bitbakeView", + "title": "Bitbake", + "icon": "./client/images/yocto-view-icon.svg" + } + ] + }, + "views": { + "bitbakeView": [ + { + "id": "bitbakeRecipes", + "name": "Recipes Explorer", + "contextualTitle": "Recipes explorer", + "icon": "$(library)", + "when": "bitbake.active" + }, + { + "id": "devtoolWorkspaces", + "name": "Devtool Workspaces", + "contextualTitle": "Devtool workspaces", + "icon": "$(symbol-property)", + "when": "bitbake.active" + } + ] + }, + "submenus": [ + { + "id": "bitbake/main", + "label": "BitBake", + "icon": "$(ellipsis)" + }, + { + "id": "devtool/main", + "label": "BitBake", + "icon": "$(ellipsis)" + } + ], + "menus": { + "bitbake/main": [ + { + "command": "bitbake.build-recipe", + "group": "0@bitbake_build@0" + }, + { + "command": "bitbake.clean-recipe", + "group": "0@bitbake_build@1" + }, + { + "command": "bitbake.run-task", + "group": "0@bitbake_build@2" + }, + { + "command": "bitbake.drop-recipe", + "group": "0@bitbake_build@3" + }, + { + "command": "bitbake.scan-recipe-env", + "group": "1@bitbake_dev@0" + }, + { + "command": "bitbake.recipe-devshell", + "group": "1@bitbake_dev@1" + }, + { + "command": "bitbake.terminal-profile", + "group": "1@bitbake_dev@2" + }, + { + "command": "bitbake.open-recipe-workdir", + "group": "1@bitbake_dev@3" + }, + { + "command": "bitbake.start-toaster-in-browser", + "group": "1@bitbake_dev@4" + }, + { + "command": "bitbake.devtool-modify", + "group": "2@bitbake_devtool@0" + } + ], + "devtool/main": [ + { + "command": "bitbake.devtool-build", + "group": "0@devtool_build@0" + }, + { + "command": "bitbake.devtool-clean", + "group": "0@devtool_build@1" + }, + { + "command": "bitbake.devtool-deploy", + "group": "0@devtool_build@2" + }, + { + "command": "bitbake.devtool-open-workspace", + "group": "1@devtool_dev@0" + }, + { + "command": "bitbake.devtool-ide-sdk", + "group": "1@devtool_dev@1" + }, + { + "command": "bitbake.devtool-sdk-fallback", + "group": "1@devtool_dev@2" + }, + { + "command": "bitbake.terminal-profile", + "group": "1@devtool_dev@3" + }, + { + "command": "bitbake.devtool-update", + "group": "1@devtool_finalize@0" + }, + { + "command": "bitbake.devtool-reset", + "group": "1@devtool_finalize@1" + } + ], + "explorer/context": [ + { + "submenu": "bitbake/main", + "group": "bitbake", + "when": "resourceLangId == bitbake" + } + ], + "editor/context": [ + { + "submenu": "bitbake/main", + "group": "bitbake@0", + "when": "editorLangId == bitbake" + } + ], + "editor/title/context": [ + { + "submenu": "bitbake/main", + "group": "bitbake", + "when": "resourceLangId == bitbake" + } + ], + "view/title": [ + { + "command": "bitbake.watch-recipe", + "group": "navigation@0", + "when": "view == bitbakeRecipes" + }, + { + "command": "bitbake.rescan-project", + "group": "navigation@1", + "when": "view == bitbakeRecipes" + }, + { + "command": "bitbake.collapse-list", + "group": "navigation@2", + "when": "view == bitbakeRecipes" + }, + { + "command": "bitbake.drop-all-recipes", + "group": "navigation@3", + "when": "view == bitbakeRecipes" + }, + { + "submenu": "bitbake/main", + "group": "navigation@99", + "when": "view == bitbakeRecipes" + }, + { + "command": "bitbake.devtool-modify", + "group": "navigation@0", + "when": "view == devtoolWorkspaces" + }, + { + "command": "bitbake.rescan-project", + "group": "navigation@1", + "when": "view == devtoolWorkspaces" + }, + { + "submenu": "devtool/main", + "group": "navigation@99", + "when": "view == devtoolWorkspaces" + } + ], + "view/item/context": [ + { + "command": "bitbake.build-recipe", + "group": "inline@0", + "when": "viewItem == bitbakeRecipeCtx" + }, + { + "command": "bitbake.clean-recipe", + "group": "inline@1", + "when": "viewItem == bitbakeRecipeCtx" + }, + { + "command": "bitbake.drop-recipe", + "group": "inline@2", + "when": "viewItem == bitbakeRecipeCtx" + }, + { + "submenu": "bitbake/main", + "group": "inline@99", + "when": "viewItem == bitbakeRecipeCtx" + }, + { + "command": "bitbake.devtool-build", + "group": "inline@0", + "when": "viewItem == devtoolWorskpaceCtx" + }, + { + "command": "bitbake.devtool-update", + "group": "inline@1", + "when": "viewItem == devtoolWorskpaceCtx" + }, + { + "command": "bitbake.devtool-reset", + "group": "inline@2", + "when": "viewItem == devtoolWorskpaceCtx" + }, + { + "submenu": "devtool/main", + "group": "inline@99", + "when": "viewItem == devtoolWorskpaceCtx" + }, + { + "command": "bitbake.build-recipe", + "group": "0@bitbake_build@0", + "when": "viewItem == bitbakeRecipeCtx" + }, + { + "command": "bitbake.clean-recipe", + "group": "0@bitbake_build@1", + "when": "viewItem == bitbakeRecipeCtx" + }, + { + "command": "bitbake.run-task", + "group": "0@bitbake_build@2", + "when": "viewItem == bitbakeRecipeCtx" + }, + { + "command": "bitbake.drop-recipe", + "group": "0@bitbake_build@3", + "when": "viewItem == bitbakeRecipeCtx" + }, + { + "command": "bitbake.scan-recipe-env", + "group": "1@bitbake_dev@0", + "when": "viewItem == bitbakeRecipeCtx" + }, + { + "command": "bitbake.recipe-devshell", + "group": "1@bitbake_dev@1", + "when": "viewItem == bitbakeRecipeCtx" + }, + { + "command": "bitbake.terminal-profile", + "group": "1@bitbake_dev@2", + "when": "viewItem == bitbakeRecipeCtx" + }, + { + "command": "bitbake.open-recipe-workdir", + "group": "1@bitbake_dev@3", + "when": "viewItem == bitbakeRecipeCtx" + }, + { + "command": "bitbake.devtool-modify", + "group": "2@bitbake_devtool@0", + "when": "viewItem == bitbakeRecipeCtx" + }, + { + "command": "bitbake.devtool-build", + "group": "0@devtool_build@0", + "when": "viewItem == devtoolWorskpaceCtx" + + }, + { + "command": "bitbake.devtool-clean", + "group": "0@devtool_build@1", + "when": "viewItem == devtoolWorskpaceCtx" + + }, + { + "command": "bitbake.devtool-deploy", + "group": "0@devtool_build@2", + "when": "viewItem == devtoolWorskpaceCtx" + + }, + { + "command": "bitbake.devtool-open-workspace", + "group": "1@devtool_dev@0", + "when": "viewItem == devtoolWorskpaceCtx" + + }, + { + "command": "bitbake.devtool-ide-sdk", + "group": "1@devtool_dev@1", + "when": "viewItem == devtoolWorskpaceCtx" + + }, + { + "command": "bitbake.devtool-sdk-fallback", + "group": "1@devtool_dev@2", + "when": "viewItem == devtoolWorskpaceCtx" + + }, + { + "command": "bitbake.terminal-profile", + "group": "1@devtool_dev@3", + "when": "viewItem == devtoolWorskpaceCtx" + + }, + { + "command": "bitbake.devtool-update", + "group": "1@devtool_finalize@0", + "when": "viewItem == devtoolWorskpaceCtx" + + }, + { + "command": "bitbake.devtool-reset", + "group": "1@devtool_finalize@1", + "when": "viewItem == devtoolWorskpaceCtx" + + } + ] + }, + "terminal": { + "profiles": [ + { + "id": "bitbake.terminal", + "title": "bitbake" + } + ] + } + }, "scripts": { - "postinstall": "cd server && npm install && cd ../client && npm install", + "postinstall": "cd server && npm install && cd ../client && npm install && cd ..", "fetch": "npm run fetch:poky && npm run fetch:docs", "fetch:docs": "sh scripts/fetch-docs.sh", "fetch:poky": "sh scripts/fetch-poky.sh", - "compile": "npm run installServer && tsc -b", - "watch": "npm run installServer && tsc -b -w", - "installServer": "cd server && npm run installServer", - "package": "cd client && npm run package", + "compile": "tsc -b", + "postcompile": "cp -r ./server/resources ./server/tree-sitter-bitbake.wasm ./server/out", + "watch": "tsc -b -w && npm run postcompile", + "vscode:prepublish": "cd server && npm install --omit=dev && cd ../client && npm install --omit=dev && cd ..", + "package": "vsce package", "clean:server": "rm -fr ./server/node_modules ./client/server ./server/out ./server/resources server/tsconfig.tsbuildinfo server/.vscode-test server/*.tgz", "clean:client": "rm -fr ./client/node_modules ./client/out client/tsconfig.tsbuildinfo client/.vscode-test client/*.vsix", "clean:lib": "rm -fr ./lib/node_modules", @@ -62,7 +879,8 @@ "typescript": "^5.1.3", "vscode-tmgrammar-test": "^0.1.2" }, - "workspaces": [ - "client/src/lib" - ] + "vsce": { + "baseContentUrl": "https://github.com/yoctoproject/vscode-bitbake/raw/HEAD/client", + "baseImageUrl": "https://github.com/yoctoproject/vscode-bitbake/raw/HEAD/client" + } } diff --git a/server/package.json b/server/package.json index 653daedf..6515dadc 100644 --- a/server/package.json +++ b/server/package.json @@ -26,9 +26,7 @@ "web-tree-sitter": "^0.20.8" }, "scripts": { - "prepack": "../scripts/fetch-docs.sh && tsc --outDir out && cp -r ./resources ./tree-sitter-bitbake.wasm out/", - "installServer": "installServerIntoExtension ../client ./package.json ./tsconfig.json && npm run installServerResources", - "installServerResources": "cp -r ./resources ./tree-sitter-bitbake.wasm ../client/server/" + "prepack": "cd .. && npm run compile" }, "devDependencies": { "@types/glob": "^8.1.0", diff --git a/server/tsconfig.json b/server/tsconfig.json index 7f303b6e..871ef386 100644 --- a/server/tsconfig.json +++ b/server/tsconfig.json @@ -5,7 +5,7 @@ "moduleResolution": "node", "sourceMap": true, "rootDir": ".", - "outDir": "../client/server", + "outDir": "out", "strict": true, "esModuleInterop": true, "skipLibCheck": true,