Skip to content

Commit 87a6216

Browse files
committed
fix: update regex patterns in token finder and expand selection tests
- Modified regex patterns in `findToken` to correctly handle hyphens and dots. - Adjusted test patterns in `expandSelection.advanced.test.ts` to match updated regex. - Updated assertions in `expandSelection.test.ts` to ensure line expansion is correctly identified. - Cleaned up unnecessary variable assignments in tests for clarity. chore: add GitHub Actions workflow for publishing extension - Created a new workflow file to automate the publishing process to the VS Code Marketplace upon release. chore: add ESLint configuration for TypeScript - Introduced ESLint configuration to enforce coding standards and improve code quality across the project. - Configured rules for TypeScript files and test files, including naming conventions and unused variable checks. refactor: update tsconfig.json to exclude .vscode-test directory - Adjusted the TypeScript configuration to ensure the `.vscode-test` directory is excluded from compilation.
1 parent 3df6373 commit 87a6216

File tree

12 files changed

+1277
-1676
lines changed

12 files changed

+1277
-1676
lines changed

.eslintrc.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish Extension
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '20'
18+
19+
- name: Setup pnpm
20+
uses: pnpm/action-setup@v4
21+
with:
22+
version: 10.12.1
23+
24+
- name: Install dependencies
25+
run: pnpm install
26+
27+
- name: Build extension
28+
run: pnpm build
29+
30+
- name: Publish to VS Code Marketplace
31+
run: pnpm publish
32+
env:
33+
VSCE_PAT: ${{ secrets.VSCE_PAT }}

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Generic Expand Selection
22

3-
[![Test](https://github.com/danztran/vscode-generic-expand-selection/actions/workflows/test.yml/badge.svg)](https://github.com/danztran/vscode-generic-expand-selection/actions/workflows/test.yml)
3+
[![Test](https://github.com/dandehoon/vscode-generic-expand-selection/actions/workflows/test.yml/badge.svg)](https://github.com/dandehoon/vscode-generic-expand-selection/actions/workflows/test.yml)
44

55
Intelligently expand and retract text selections using smart scope detection. This extension provides progressive text selection that understands code structure and naturally expands to logical boundaries.
66

@@ -88,7 +88,3 @@ pnpm run vscode:install
8888
## License
8989

9090
MIT License
91-
92-
## Repository
93-
94-
[GitHub Repository](https://github.com/danztran/vscode-generic-expand-selection)

esbuild.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const esbuild = require('esbuild');
1+
import esbuild from 'esbuild';
22

33
const production = process.argv.includes('--production');
44
const watch = process.argv.includes('--watch');

eslint.config.js

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import js from '@eslint/js';
2+
import tsPlugin from '@typescript-eslint/eslint-plugin';
3+
import tsParser from '@typescript-eslint/parser';
4+
5+
const rules = {
6+
'@typescript-eslint/naming-convention': 'warn',
7+
'@/semi': ['warn', 'always'],
8+
'curly': 'warn',
9+
'eqeqeq': 'warn',
10+
'no-throw-literal': 'warn',
11+
'no-unused-vars': ['error', { varsIgnorePattern: '^_' }],
12+
'semi': 'off',
13+
};
14+
15+
export default [
16+
js.configs.recommended,
17+
{
18+
files: ['src/**/*.ts'],
19+
rules,
20+
languageOptions: {
21+
parser: tsParser,
22+
parserOptions: {
23+
ecmaVersion: 2020,
24+
sourceType: 'module',
25+
},
26+
},
27+
plugins: {
28+
'@typescript-eslint': tsPlugin,
29+
},
30+
},
31+
{
32+
files: ['src/test/**/*.ts'],
33+
rules,
34+
languageOptions: {
35+
parser: tsParser,
36+
parserOptions: {
37+
ecmaVersion: 2020,
38+
sourceType: 'module',
39+
},
40+
globals: {
41+
suite: 'readonly',
42+
test: 'readonly',
43+
before: 'readonly',
44+
after: 'readonly',
45+
beforeEach: 'readonly',
46+
afterEach: 'readonly',
47+
},
48+
},
49+
plugins: {
50+
'@typescript-eslint': tsPlugin,
51+
},
52+
},
53+
{
54+
files: ['*.js'],
55+
languageOptions: {
56+
ecmaVersion: 2020,
57+
sourceType: 'module',
58+
globals: {
59+
console: 'readonly',
60+
process: 'readonly',
61+
},
62+
},
63+
rules: {
64+
semi: 'error',
65+
},
66+
},
67+
{
68+
ignores: ['out/**', 'dist/**', '**/*.d.ts', 'node_modules/**'],
69+
},
70+
];

package.json

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
"name": "vscode-generic-expand-selection",
33
"displayName": "Generic Expand Selection",
44
"description": "Intelligently expand selection to nearest scoped characters like quotes, brackets, and more.",
5-
"publisher": "danztran",
5+
"publisher": "dandehoon",
66
"version": "0.0.1",
77
"repository": {
88
"type": "git",
9-
"url": "git://github.com/danztran/vscode-generic-expand-selection.git"
9+
"url": "git://github.com/dandehoon/vscode-generic-expand-selection.git"
1010
},
11+
"type": "module",
1112
"engines": {
1213
"vscode": "^1.92.0"
1314
},
@@ -45,37 +46,26 @@
4546
]
4647
},
4748
"scripts": {
48-
"vscode:prepublish": "pnpm run package",
49-
"vscode:install": "pnpm vscode:prepublish && pnpm vsce package -o out.vsix --no-dependencies && code --install-extension out.vsix",
50-
"compile": "pnpm run check-types && pnpm run lint && node esbuild.js",
51-
"watch": "npm-run-all -p watch:*",
52-
"watch:esbuild": "node esbuild.js --watch",
53-
"watch:tsc": "tsc --noEmit --watch --project tsconfig.json",
54-
"package": "pnpm run check-types && pnpm run lint && node esbuild.js --production",
55-
"compile-tests": "tsc -p . --outDir out",
56-
"watch-tests": "tsc -p . -w --outDir out",
57-
"pretest": "pnpm run compile-tests && pnpm run compile",
58-
"check-types": "tsc --noEmit",
59-
"lint": "eslint src --ext ts",
60-
"test": "vscode-test"
49+
"check": "tsc --noEmit && eslint src --ext ts",
50+
"test": "tsc -p . --outDir out && vscode-test",
51+
"build": "pnpm run check && node esbuild.js --production && pnpm dlx vsce package --no-dependencies -o out.vsix",
52+
"publish": "pnpm dlx vsce publish --no-dependencies",
53+
"vsce:install": "pnpm run build && code --install-extension out.vsix"
6154
},
6255
"devDependencies": {
63-
"@types/glob": "^7.2.0",
64-
"@types/mocha": "^10.0.7",
56+
"@eslint/js": "^9.29.0",
57+
"@types/mocha": "^10.0.10",
6558
"@types/node": "20.x",
6659
"@types/vscode": "^1.92.0",
67-
"@typescript-eslint/eslint-plugin": "^7.14.1",
68-
"@typescript-eslint/parser": "^7.11.0",
69-
"@vscode/test-cli": "^0.0.9",
60+
"@typescript-eslint/eslint-plugin": "^8.34.1",
61+
"@typescript-eslint/parser": "^8.34.1",
62+
"@vscode/test-cli": "^0.0.11",
7063
"@vscode/test-electron": "^2.4.0",
71-
"@vscode/vsce": "^2.32.0",
72-
"esbuild": "^0.21.5",
73-
"eslint": "^8.57.0",
74-
"glob": "^7.2.3",
75-
"mocha": "^9.2.2",
76-
"npm-run-all": "^4.1.5",
77-
"typescript": "^5.4.5",
78-
"v8-compile-cache": "^2.4.0"
64+
"@vscode/vsce": "^3.5.0",
65+
"esbuild": "^0.25.5",
66+
"eslint": "^9.29.0",
67+
"mocha": "^11.7.0",
68+
"typescript": "5.5.4"
7969
},
8070
"packageManager": "pnpm@10.12.1+sha512.f0dda8580f0ee9481c5c79a1d927b9164f2c478e90992ad268bbb2465a736984391d6333d2c327913578b2804af33474ca554ba29c04a8b13060a717675ae3ac"
8171
}

0 commit comments

Comments
 (0)