Skip to content

Commit db87bea

Browse files
authored
Simplify Testing in Codespaces #6
2 parents a646398 + 88813c0 commit db87bea

File tree

4 files changed

+38
-26
lines changed

4 files changed

+38
-26
lines changed

.devcontainer/devcontainer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "LiquidJava Extension Dev",
2+
"name": "LiquidJava Demo",
33
"image": "mcr.microsoft.com/devcontainers/javascript-node:20",
44
"customizations": {
55
"vscode": {
@@ -13,5 +13,6 @@
1313
"version": "21"
1414
}
1515
},
16-
"postAttachCommand": "bash ./setup.sh"
16+
"workspaceFolder": "/workspaces/liquidjava-examples/examples/demo",
17+
"postAttachCommand": "cd ../../ && bash setup.sh && cd ./examples/demo"
1718
}

README.md

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,21 @@ For more information about LiquidJava, visit our [website](https://catarinagambo
88

99
## Development Environment Setup
1010
🚀 Check the following video on the setup:
11-
![Video of the steps above](./figs/steps2.gif)
11+
![Video of the steps below](./figs/steps2.gif)
1212

1313
### Setup Instructions
1414

15-
#### Option 1: Using Codespaces or Dev Containers (Recommended)
15+
#### Option 1: Using Codespaces (Recommended)
1616

17-
1. Open the repository in GitHub Codespaces or use VS Code's "Remote-Containers: Open Folder in Container" command.
18-
2. Install the extension: View → Extensions → Click on the "..." (More Actions) button → Install from VSIX → `/workspaces/liquidjava-examples/extension/liquid-java-0.0.15.vsix`.
19-
3. After the information that the extension is activated, do `Ctrl + Shift + P` and write `Developer: Reload Window `
20-
5. Open examples: File → Open Folder → `examples/demo/src/`.
21-
6. You can try changing the example to see an error appear.
22-
7. If needed, reload window again using `Developer: Reload Window `.
17+
- To use Codespaces, make sure you’re logged in to GitHub, click the button below, select `4-core`, and then press `Create codespace`. The codespace will open in your browser and will automatically install the LiquidJava extension shortly after.
2318

19+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/CatarinaGamboa/liquidjava-examples)
2420

25-
#### Extension Activation
21+
#### Option 2: Using Dev Containers
2622

27-
- The extension may take some time to be activated. While a small wheel in the bottom right of VS Code window is spinning, the extension is being loaded.
28-
- The extension will only activate when opening a Java project with the liquidjava-api.jar present.
29-
23+
- If you prefer to test it locally, you can use VS Code's Dev Containers. Make sure you have Docker and the Dev Containers extension installed in VS Code and use the "Remote-Containers: Open Folder in Container" command. Then, run the `setup.sh` script to install the extension.
3024

31-
#### Option 2: Manual Setup
25+
#### Option 3: Manual Setup
3226

3327
If the automatic setup didn't work correctly, follow these manual steps:
3428

@@ -55,17 +49,22 @@ If the automatic setup didn't work correctly, follow these manual steps:
5549
code --install-extension extension/liquid-java-0.0.15.vsix
5650
```
5751

58-
4. Ensure the redhat extension for [Language Support for Java™](https://marketplace.visualstudio.com/items?itemName=redhat.java) is installed and enabled.
52+
4. Ensure the Red Hat extension for [Language Support for Java™](https://marketplace.visualstudio.com/items?itemName=redhat.java) is installed and enabled.
5953

60-
5. Open examples:
61-
- Go to File → Open Folder → examples/demo/src/
54+
5. Open the examples:
55+
- Go to File → Open Folder → examples/demo
6256
- Or use the terminal:
6357
```bash
6458
code examples/demo/src/
6559
```
6660

6761
### Troubleshooting
6862

63+
#### Extension Activation
64+
65+
- The extension will only activate when opening a Java project with the `liquidjava-api.jar` present in the workspace.
66+
- If the extension doesn't activate properly, do `Ctrl + Shift + P` and run `Developer: Reload Window`.
67+
6968
#### VSIX File Issues
7069

7170
If you see "End of central directory record signature not found" or similar errors:
@@ -80,17 +79,16 @@ If you see "End of central directory record signature not found" or similar erro
8079
cat ./extension/liquid-java-0.0.15.vsix | head
8180
```
8281

83-
8482
## Working with the Extension
8583

8684
1. Ensure your project is correctly set up with the `liquidjava-api.jar`.
8785
2. When opening a Java file, the extension will automatically verify your LiquidJava annotations.
8886
3. Errors will be highlighted directly in your code editor.
87+
4. An item in the status bar at the bottom left of the editor indicates the extension's current state. You can check the extension logs by clicking on it.
8988

9089
## Download JARs
9190

92-
`examples/demo/lib` folder contains the api jar that you can use in your projects.
93-
91+
`examples/demo/lib` folder contains the API jar necessary to run LiquidJava.
9492

9593
## Examples
9694
```

extension/liquid-java-0.0.15.vsix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:f50a6b69bba572d93307ad9b632a0bde81403191488add5507f09c20b496559e
3-
size 137035339
2+
oid sha256:64ef446a47ddf814049c569dbc11039ac5e08b005a8cf3a5a5bb909b75864c95
3+
size 209253467

setup.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/bash
22

3+
# Check if extension is already installed
4+
if code --list-extensions | grep -q "liquid-java" 2>/dev/null; then
5+
echo "✅ LiquidJava extension already installed!"
6+
exit 0
7+
fi
8+
39
# Setup script for LiquidJava development environment
410
echo "🚀 Starting LiquidJava development environment setup..."
511

@@ -38,6 +44,13 @@ else
3844
find . -type d -maxdepth 2 | sort
3945
fi
4046

41-
echo "🎉 Setup complete! Please follow these manual steps:"
42-
echo "1. Install the extension: View → Extensions → ... → Install from VSIX → extension/liquid-java-0.0.15.vsix"
43-
echo "2. Open examples: File → Open Folder → examples/demo/src/"
47+
# Install extension
48+
echo "🔧 Installing LiquidJava VSCode extension..."
49+
code --install-extension ./extension/liquid-java-0.0.15.vsix
50+
if [ $? -eq 0 ]; then
51+
echo "✅ Extension installed successfully"
52+
else
53+
echo "❌ Failed to install the extension"
54+
fi
55+
56+
echo "🎉 Setup complete!"

0 commit comments

Comments
 (0)