-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(project-type): context-menu example commands enablement configu…
…red + README.md updated
- Loading branch information
1 parent
24493f5
commit 50c905c
Showing
2 changed files
with
30 additions
and
11 deletions.
There are no files selected for viewing
27 changes: 16 additions & 11 deletions
27
examples/vscode-artifact-management-context-menus/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,38 @@ | ||
# Example VSCode Extension using workspace instance | ||
# Example of vscode extension using conditional operator to enable the extension's command | ||
|
||
An example demonstrating using VSCode [conditional `in` operator](https://code.visualstudio.com/api/references/when-clause-contexts#in-conditional-operator) | ||
in conjunction with custom contexts created using `@sap/artifact-managment` project type information. | ||
|
||
TODO: finish description | ||
|
||
## pre-requisites | ||
|
||
- **Nodejs**: An `active` or `maintenance` version. | ||
- **Yarn**: version 1.x | ||
- CAP Development Kit `npm install -g @sap/cds-dk` (must be **globally** installed). | ||
- **pnpm**: version >= 6.x | ||
|
||
## Initial setup | ||
|
||
In commandline/shell at the **root** of this monorepo: | ||
|
||
1. `yarn`. | ||
2. `yarn compile`. | ||
1. `pnpm i`. | ||
2. `pnpm compile`. | ||
|
||
In "Main" VSCode window: | ||
|
||
1. `File` --> `Open Folder...` and select this mono repo's **root**. | ||
2. go to `Run and Debug` tab, | ||
3. select the launch configuration called `Run Toolkit with Project Type Context Menus Example` in the dropdown. | ||
3. select the launch configuration called `Run Toolkit with Artifact-Management Context Menus Example` in the dropdown. | ||
4. click the `Start Debugging` green run icon. | ||
|
||
In the newly opened VSCode "Extension Development Host" Window: | ||
|
||
1. `File` -> `Open Folder` -> select the `samples/cap-project` folder under the root of this repo. | ||
2. Open the output panel: `View` -> `Output` | ||
3. Select `SAP OSS.project_using_workspace_api_instance` in the dropdown menu. | ||
4. Inspect the printed `@sap/artifact-managment` project type hierarchy. | ||
2. 'Add Folder to Workspace...' -> select the `samples/openui5` folder. | ||
3. Open the output panel: `View` -> `Output` | ||
4. Select `vscode-using-workspace-api` in the dropdown menu. | ||
5. Inspect the printed `@sap/artifact-managment` project type hierarchy. | ||
|
||
## Inspecting the context dependent commands | ||
|
||
1. Select the `openui5` folder in the workspace explorer and right click on it --> you should see the `Deploy UI5 Application` menu appear in the context menu that opens. | ||
2. Navigate to `openui5` --> `webapp` --> `manifest.json`. Select and right click on it --> this time you should see the two menus `Deploy UI5 Application` and `Edit UI5 Manifest` appears in the context menu that opens. | ||
3. Select the `cap-project` folder in the workspace explorer and right click on it --> you should see the `Preview LCAP Application` menu appear in the context menu that opens. | ||
4. Right click on another file in other project --> the mentioned context menus should not appear. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters