Skip to content

Commit 64b1ab2

Browse files
authored
Merge pull request #4 from isnandar1471/feature/initial-release
fix(workflow) & feat(contextmenu)
2 parents f50b52a + 164bb2a commit 64b1ab2

File tree

7 files changed

+78
-23
lines changed

7 files changed

+78
-23
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,27 +48,35 @@ jobs:
4848
echo "skip_tag=false" >> $GITHUB_OUTPUT
4949
fi
5050
51+
- name: Exit if tag already exists
52+
if: steps.tag_check.outputs.skip_release == 'true'
53+
run: exit 0
54+
55+
- name: Package VS Code Extension
56+
run: npx vsce package
57+
58+
- name: Publish to VS Code Marketplace
59+
run: npx vsce publish --pat ${{ secrets.VSCE_TOKEN }}
60+
61+
- name: Get .vsix filename
62+
id: vsix
63+
run: |
64+
FILE=$(ls *.vsix | head -n 1)
65+
echo "file=$FILE" >> $GITHUB_OUTPUT
66+
5167
- name: Create Git tag
52-
if: steps.tag_check.outputs.skip_tag == 'false'
5368
run: |
5469
git config user.name "github-actions"
5570
git config user.email "[email protected]"
5671
git tag v${{ steps.meta.outputs.version }}
5772
git push origin v${{ steps.meta.outputs.version }}
5873
59-
- name: Package VS Code Extension
60-
run: npx vsce package -o ${{ steps.meta.outputs.vsix_file }}
61-
6274
- name: Upload VSIX to GitHub Release
6375
uses: softprops/action-gh-release@v2
6476
with:
6577
tag_name: v${{ steps.meta.outputs.version }}
66-
files: ${{ steps.meta.outputs.vsix_file }}
67-
68-
- name: Publish to VS Code Marketplace
69-
run: npx vsce publish ${{ steps.meta.outputs.vsix_file }} --pat ${{ secrets.VSCE_PAT }}
78+
files: ${{ steps.vsix.outputs.file }}
7079

7180
- name: Post release summary
7281
run: |
7382
echo "✅ Extension v${{ steps.meta.outputs.version }} released and published to the VS Code Marketplace."
74-
echo "🔗 GitHub Release: https://github.com/${{ github.repository }}/releases/tag/v${{ steps.meta.outputs.version }}"

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ jobs:
3030
- name: Install dependencies
3131
run: npm install
3232

33+
- name: Run linter
34+
run: npm run lint
35+
3336
- name: Setup headless display (Linux only)
3437
if: runner.os == 'Linux'
3538
run: |

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.0.2] -2025-07-27
9+
10+
### Added
11+
- Support for executing commands via the editor context menu
12+
13+
### Changed
14+
- Improved project documentation
15+
- Enhanced GitHub Actions workflows
16+
817
## [0.0.1] -2025-07-27
918

1019
- Initial release

README.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,42 @@ Easily convert indentation (tabs <-> spaces) on specific lines or the whole file
88

99
## Installation
1010

11-
You can install Selective Indent from the [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/) or using the command line:
11+
You can install Selective Indent from the [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=isnandar1471.vscode-selective-indent) or using the command line:
1212

1313
```bash
14-
code --install-extension your-publisher-id.selective-indent
14+
code --install-extension isnandar1471.vscode-selective-indent
1515
```
1616

17-
> Replace `your-publisher-id.selective-indent` with the actual identifier once published.
18-
1917
---
2018

2119
## Demo
2220

23-
![Demo](./assets/demo.gif)
21+
- With Command Pallete
22+
23+
![Demo Command Pallete](./assets/demo-command-pallete.gif)
24+
25+
- With Context Menu
26+
27+
![Demo Context Menu](./assets/demo-context-menu.gif)
28+
29+
---
30+
31+
## Features
32+
33+
- Convert indentation between tabs and spaces
34+
- Supports converting selected lines or entire file
35+
- Accessible from the Command Palette and context menu
2436

2537
---
2638

2739
## Commands
2840

2941
| Command | Description |
3042
| ----------------------------------------------------------------- | --------------------------------------------- |
31-
| `vscode-selective-indent.convertSelectedLinesIndentationToSpaces` | Convert selected lines' indentation to spaces |
32-
| `vscode-selective-indent.convertSelectedLinesIndentationToTabs` | Convert selected lines' indentation to tabs |
33-
| `vscode-selective-indent.convertAllLinesIndentationToSpaces` | Convert all lines' indentation to spaces |
34-
| `vscode-selective-indent.convertAllLinesIndentationToTabs` | Convert all lines' indentation to tabs |
43+
| `vscode-selective-indent.convertSelectedLinesIndentationToSpaces` | Convert selected lines indentation to spaces |
44+
| `vscode-selective-indent.convertSelectedLinesIndentationToTabs` | Convert selected lines indentation to tabs |
45+
| `vscode-selective-indent.convertAllLinesIndentationToSpaces` | Convert all lines indentation to spaces |
46+
| `vscode-selective-indent.convertAllLinesIndentationToTabs` | Convert all lines indentation to tabs |
3547

3648
---
3749

@@ -51,5 +63,5 @@ Available in [`./LICENSE`](./LICENSE)
5163

5264
```bash
5365
npm install -g @vscode/vsce
54-
vsce publish <major|minor|patch>
66+
vsce publish
5567
```
File renamed without changes.

assets/demo-context-menu.gif

566 KB
Loading

package.json

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Selective Indent",
44
"description": "Easily convert indentation (tabs <-> spaces) on specific lines or the whole file in VSCode.",
55
"publisher": "isnandar1471",
6-
"version": "0.0.1",
6+
"version": "0.0.2",
77
"icon": "assets/icon.png",
88
"galleryBanner": {
99
"color": "#1e1e1e",
@@ -45,16 +45,39 @@
4545
"command": "vscode-selective-indent.convertAllLinesIndentationToTabs",
4646
"title": "Selective Indent: Convert All Lines Indentation to Tabs"
4747
}
48-
]
48+
],
49+
"menus": {
50+
"editor/context": [
51+
{
52+
"command": "vscode-selective-indent.convertAllLinesIndentationToSpaces",
53+
"when": "editorTextFocus",
54+
"group": "vscode-selective-indent@1"
55+
},
56+
{
57+
"command": "vscode-selective-indent.convertAllLinesIndentationToTabs",
58+
"when": "editorTextFocus",
59+
"group": "vscode-selective-indent@2"
60+
},
61+
{
62+
"command": "vscode-selective-indent.convertSelectedLinesIndentationToSpaces",
63+
"when": "editorHasSelection",
64+
"group": "vscode-selective-indent@3"
65+
},
66+
{
67+
"command": "vscode-selective-indent.convertSelectedLinesIndentationToTabs",
68+
"when": "editorHasSelection",
69+
"group": "vscode-selective-indent@4"
70+
}
71+
]
72+
}
4973
},
5074
"scripts": {
5175
"vscode:prepublish": "npm run compile",
5276
"compile": "tsc -p ./",
5377
"watch": "tsc -watch -p ./",
5478
"pretest": "npm run compile && npm run lint",
5579
"lint": "eslint src",
56-
"test": "vscode-test",
57-
"deploy": "vsce publish"
80+
"test": "vscode-test"
5881
},
5982
"devDependencies": {
6083
"@types/mocha": "^10.0.10",

0 commit comments

Comments
 (0)