Skip to content

Commit 12c62c1

Browse files
authored
Merge branch 'master' into surround-fixup
2 parents cdbe977 + 386a3b1 commit 12c62c1

File tree

239 files changed

+16447
-13163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

239 files changed

+16447
-13163
lines changed

.github/CONTRIBUTING.md

Lines changed: 62 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ When creating a new bug report do:
1616

1717
### Improve Existing Issues
1818

19+
- Try to replicate bugs and describe the method if you're able to.
1920
- Search for [duplicate issues](https://github.com/VSCodeVim/Vim/issues?q=is%3Aissue+is%3Aopen+cursor). See which thread(s) are more mature, and recommend the duplicate be closed, or just provide links to related issues.
2021
- Find [old issues](https://github.com/VSCodeVim/Vim/issues?page=25&q=is%3Aissue+is%3Aopen) and test them in the latest version of VSCodeVim. If the issue has been resolved, comment & recommend OP to close (or provide more information if not resolved).
2122
- Give thumbs up / thumbs down to existing issues, to indicate your support (or not)
@@ -29,40 +30,60 @@ When submitting a PR, please fill out the template that is presented by GitHub w
2930

3031
## First Time Setup
3132

32-
1. Install prerequisites:
33-
- latest [Visual Studio Code](https://code.visualstudio.com/)
34-
- [Node.js](https://nodejs.org/) v12.0.0 or higher
35-
- [Yarn](https://classic.yarnpkg.com/) v1.x
36-
- _Optional_: [Docker Community Edition](https://store.docker.com/search?type=edition&offering=community) 🐋
37-
1. In a terminal:
33+
1. Install prerequisites:
3834

39-
```bash
40-
# fork and clone the repository
41-
git clone git@github.com:<YOUR-FORK>/Vim.git
42-
cd Vim
35+
- [Visual Studio Code](https://code.visualstudio.com/), latest stable or insiders
36+
- [Node.js](https://nodejs.org/) v14.0.0 or higher
37+
- [Yarn](https://classic.yarnpkg.com/) v1.x
38+
- _Optional_: [Docker Community Edition](https://store.docker.com/search?type=edition&offering=community) 🐋
4339

44-
# Install the dependencies
45-
yarn install
40+
2. Fork and clone repository:
4641

47-
# Open in VSCode
48-
code .
42+
```bash
43+
git clone git@github.com:<YOUR-FORK>/Vim.git
44+
cd Vim
45+
```
4946

50-
# Choose the "Build, Run Extension" in the dropdown of VSCode's
51-
# debug tab to build and run the extension.
52-
# Or run tests by selecting the appropriate drop down option
47+
3. Build extension:
5348

54-
# Alternatively, build and run tests through gulp and npm scripts
55-
npx gulp build # build
56-
npx gulp prepare-test # build tests
57-
yarn test # test (must close all instances of VSCode)
49+
```bash
50+
# Install the dependencies
51+
yarn install
5852

59-
# Only available if Docker is installed and running
60-
npx gulp test # run tests inside Docker container
61-
npx gulp test --grep testSuite # run only tests/suites filtered by js regex inside container
53+
# Open in VS Code
54+
code .
6255

63-
# Alternatively, build .vsix extension and load it into VSCode for manual testing
64-
yarn run vsce package --web # build vim-xxx.vsix
65-
```
56+
# Build with one of these...
57+
npx gulp build-dev # Fast build for development
58+
npx gulp build # Slow build for release
59+
yarn watch # Fast build whenever a file changes
60+
```
61+
62+
4. Run extension using VS Code's "Run and Debug" menu
63+
64+
5. Run tests:
65+
66+
```bash
67+
# If Docker is installed and running:
68+
npx gulp test # Run tests inside Docker container
69+
npx gulp test --grep <REGEX> # Run only tests/suites matching <REGEX> inside Docker container
70+
71+
# Otherwise, build and run the tests locally:
72+
npx gulp build # Build
73+
npx gulp prepare-test # Build tests
74+
yarn test # Test (must close all instances of VS Code)
75+
```
76+
77+
6. Package and install extension:
78+
79+
```bash
80+
# Package extension into `vim-<MAJOR>.<MINOR>.<PATCH>.vsix`
81+
# (This can be opened and inspected like a .zip file)
82+
yarn package
83+
84+
# Install packaged extension to your local VS Code installation
85+
code --install-extension vim-<MAJOR>.<MINOR>.<PATCH>.vsix --force
86+
```
6687

6788
## Code Architecture
6889

@@ -90,43 +111,44 @@ Consists of two data structures:
90111

91112
#### How it works
92113

93-
1. `handleKeyEventHelper` is called with the most recent keypress.
94-
2. `Actions.getRelevantAction` determines if all the keys pressed so far uniquely specify any action in actions.ts. If not, we continue waiting for keypresses.
95-
3. `runAction` runs the action that was matched. Movements, Commands and Operators all have separate functions that dictate how to run them - `executeMovement`, `handleCommand`, and `executeOperator` respectively.
96-
4. Now that we've updated VimState, we run `updateView` with the new VimState to "redraw" VSCode to the new state.
114+
1. `handleKeyEventHelper` is called with the most recent keypress.
115+
2. `Actions.getRelevantAction` determines if all the keys pressed so far uniquely specify any action in actions.ts. If not, we continue waiting for keypresses.
116+
3. `runAction` runs the action that was matched. Movements, Commands and Operators all have separate functions that dictate how to run them - `executeMovement`, `handleCommand`, and `executeOperator` respectively.
117+
4. Now that we've updated `VimState`, we run `updateView` with the new VimState to "redraw" VS Code to the new state.
97118

98-
#### vscode.window.onDidChangeTextEditorSelection
119+
#### `vscode.window.onDidChangeTextEditorSelection`
99120

100121
This is my hack to simulate a click event based API in an IDE that doesn't have them (yet?). I check the selection that just came in to see if it's the same as what I thought I previously set the selection to the last time the state machine updated. If it's not, the user _probably_ clicked. (But she also could have tab completed!)
101122

102123
## Release
103124

125+
Before you push a release, be sure to make sure the changelog is updated!
126+
104127
To push a release:
105128

106129
```bash
107-
npx gulp release --semver [SEMVER] --gitHubToken [TOKEN]
130+
npx gulp release --semver [SEMVER]
108131
git push --follow-tags
109132
```
110133

111134
The above Gulp command will:
112135

113-
1. Bump the package version based off the semver supplied. Supported values: patch, minor, major.
114-
2. Create a changelog using [github-changelog-generator](https://github.com/github-changelog-generator/github-changelog-generator).
115-
3. Create a Git commit with the above changes.
116-
4. Create a Git tag using the new package version.
136+
1. Bump the package version based off the semver supplied. Supported values: patch, minor, major.
137+
2. Create a Git commit with the above changes.
138+
3. Create a Git tag using the new package version.
117139

118140
In addition to building and testing the extension, when a tag is applied to the commit, the CI server will also create a GitHub release and publish the new version to the Visual Studio marketplace.
119141

120142
## Troubleshooting
121143

122-
### Visual Studio Code Slowdown
144+
### VS Code Slowdown
123145

124146
If you notice a slowdown and have ever run `yarn test` in the past instead of running tests through VSCode, you might find a `.vscode-test/` folder, which VSCode is continually consuming CPU cycles to index. Long story short, you can speed up VSCode by:
125147

126148
```bash
127-
$ rm -rf .vscode-test/
149+
rm -rf .vscode-test/
128150
```
129151

130-
## Styleguide
152+
## Style Guide
131153

132154
Please try your best to adhere to our [style guidelines](https://github.com/VSCodeVim/Vim/blob/master/STYLE.md).

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ If remapping-related, please attach log output: https://github.com/VSCodeVim/Vim
2525

2626
<!--
2727
Ensure you are on the latest VSCode + VSCodeVim
28-
You can use "Report Issue" by running "Developers: Show Running Extensions" from the Command Pallette to prefill these.
28+
You can use "Report Issue" by running "Developers: Show Running Extensions" from the Command Palette to prefill these.
2929
-->
3030

3131
- Extension (VsCodeVim) version:

.github/workflows/build.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,49 @@ name: build
33
on:
44
push:
55
branches:
6-
- '**'
6+
- 'master'
77
pull_request:
88
branches:
99
- '**'
1010

1111
jobs:
1212
build:
13-
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, windows-latest]
16+
runs-on: ${{ matrix.os }}
1417
steps:
1518
- name: Checkout VSCodeVim
16-
uses: actions/checkout@v2
17-
with:
18-
# Get full history; needed for Prettier to amend commit
19-
fetch-depth: 0
19+
uses: actions/checkout@v3
2020

2121
- name: Set up Node.js
2222
uses: actions/setup-node@v2-beta
2323
with:
24-
node-version: '12'
24+
node-version: '16'
2525

2626
- name: Install dependencies
2727
run: yarn install
2828

2929
- name: Prettier
30+
if: matrix.os != 'windows-latest'
3031
uses: creyD/prettier_action@v3.3
3132
with:
32-
prettier_options: '--write **/*.{ts,js,json,md,yml}'
33-
same_commit: true
34-
only_changed: true
35-
env:
36-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
dry: true
3734

3835
- name: Lint
3936
run: npx tslint -c tslint.json -p tsconfig.json
4037

4138
- name: Build
4239
run: gulp webpack
4340

44-
- name: Test
41+
- name: Test on ubuntu-latest
42+
if: matrix.os != 'windows-latest'
4543
run: |
4644
gulp prepare-test
4745
xvfb-run -a yarn test
46+
47+
- name: Test on windows-latest
48+
if: matrix.os == 'windows-latest'
49+
run: |
50+
gulp prepare-test
51+
yarn test

.github/workflows/release.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout VSCodeVim
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v3
1414

1515
- name: Set up Node.js
1616
uses: actions/setup-node@v2-beta
1717
with:
18-
node-version: '12'
18+
node-version: '16'
1919

2020
- name: Install dependencies
2121
run: yarn install
@@ -34,7 +34,7 @@ jobs:
3434
- name: Build extension package
3535
id: build_vsix
3636
run: |
37-
yarn run vsce package --web;
37+
yarn package;
3838
echo ::set-output name=vsix_path::$(ls *.vsix);
3939
4040
- name: Create release on GitHub
@@ -59,6 +59,12 @@ jobs:
5959
asset_content_type: application/zip
6060

6161
- name: Publish to VSCode Extension Marketplace
62-
run: yarn run vsce publish --yarn --web
62+
run: yarn run vsce publish --yarn
6363
env:
6464
VSCE_PAT: ${{ secrets.VSCE_PAT }}
65+
66+
- name: Publish to Open VSX Registry
67+
uses: HaaLeo/publish-vscode-extension@v1
68+
id: publishToOpenVSX
69+
with:
70+
pat: ${{ secrets.OPEN_VSX_TOKEN }}

.github_changelog_generator

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

.vscode/launch.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@
3838
"outFiles": ["${workspaceRoot}/{out, node_modules}/**/*.js"],
3939
"preLaunchTask": "gulp: prepare-test",
4040
"internalConsoleOptions": "openOnSessionStart"
41+
},
42+
{
43+
"name": "Run Web Extension",
44+
"type": "pwa-extensionHost",
45+
"debugWebWorkerHost": true,
46+
"request": "launch",
47+
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionDevelopmentKind=web"],
48+
"outFiles": ["${workspaceRoot}/{out, node_modules}/**/*.js"]
4149
}
4250
]
4351
}

.vscode/tasks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
{
1717
"type": "gulp",
18-
"task": "build",
18+
"task": "build-dev",
1919
"problemMatcher": []
2020
}
2121
]

.vscodeignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ tslint.json
2222
webpack.config.js
2323
gulpfile.js
2424
renovate.json
25-
.github_changelog_generator

0 commit comments

Comments
 (0)