Skip to content

Commit

Permalink
fix: enable prettier for md
Browse files Browse the repository at this point in the history
  • Loading branch information
jpoon committed Jul 29, 2018
1 parent 06cfbe9 commit 4852646
Show file tree
Hide file tree
Showing 12 changed files with 989 additions and 747 deletions.
62 changes: 31 additions & 31 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,69 +11,69 @@ Thanks for helping us in making VSCodeVim better! :clap:
The [GitHub issue tracker](https://github.com/VSCodeVim/Vim/issues) is the preferred channel for tracking bugs and enhancement suggestions.
When creating a new bug report do:

* Search against existing issues to check if somebody else has already reported your problem or requested your idea
* Fill out the issue template.
- Search against existing issues to check if somebody else has already reported your problem or requested your idea
- Fill out the issue template.

## Submitting Pull Requests

Pull requests are *awesome*.
Pull requests are _awesome_.
If you're looking to raise a PR for something which doesn't have an open issue, consider creating an issue first.

When submitting a PR, please fill out the template that is presented by GitHub when a PR is opened.

## First Time Setup

1. Install prerequisites:
* latest [Visual Studio Code](https://code.visualstudio.com/)
* [Node.js](https://nodejs.org/) v8.0.0 or higher
- latest [Visual Studio Code](https://code.visualstudio.com/)
- [Node.js](https://nodejs.org/) v8.0.0 or higher
1. In a terminal:

```bash
# fork and clone the repository
git clone git@github.com:<YOUR-FORK>/Vim.git
cd Vim
```bash
# fork and clone the repository
git clone git@github.com:<YOUR-FORK>/Vim.git
cd Vim

# Install the dependencies
npm install -g gulp-cli
npm install
# Install the dependencies
npm install -g gulp-cli
npm install

# Open in VSCode
code .
# Open in VSCode
code .

# Choose the "Build, Run Extension" in the dropdown of VSCode's
# debug tab to build and run the extension.
# Or run tests by selecting the appropriate drop down option
# Choose the "Build, Run Extension" in the dropdown of VSCode's
# debug tab to build and run the extension.
# Or run tests by selecting the appropriate drop down option

# Alternatively, build and run tests through gulp and npm scripts
gulp build # build
npm test # test
gulp test # run tests inside Docker container
gulp test --grep testSuite # run only tests/suites filtered by js regex inside container
```
# Alternatively, build and run tests through gulp and npm scripts
gulp build # build
npm test # test
gulp test # run tests inside Docker container
gulp test --grep testSuite # run only tests/suites filtered by js regex inside container
```

## Code Architecture

The code is split into two parts:

* ModeHandler - Vim state machine
* Actions - 'actions' which modify the state
- ModeHandler - Vim state machine
- Actions - 'actions' which modify the state

### Actions

Actions are all currently stuffed into actions.ts (sorry!). There are:

* `BaseAction` - the base Action type that all Actions derive from.
* `BaseMovement` - A movement (e.g.`w`, `h`, `{`, etc.) *ONLY* updates the cursor position or returns an `IMovement`, which indicates a start and stop. This is used for movements like `aw` which may actually start before the cursor.
* `BaseCommand` - Anything which is not just a movement is a Command. That includes motions which also update the state of Vim in some way, like `*`.
- `BaseAction` - the base Action type that all Actions derive from.
- `BaseMovement` - A movement (e.g.`w`, `h`, `{`, etc.) _ONLY_ updates the cursor position or returns an `IMovement`, which indicates a start and stop. This is used for movements like `aw` which may actually start before the cursor.
- `BaseCommand` - Anything which is not just a movement is a Command. That includes motions which also update the state of Vim in some way, like `*`.

At one point, I wanted to have actions.ts be completely pure (no side effects whatsoever), so commands would just return objects indicating what side effects on the editor they would have. This explains the giant switch in handleCommand in ModeHandler. I now believe this to be a dumb idea and someone should get rid of it.

### The Vim State Machine

Consists of two data structures:

* `VimState` - this is the state of Vim. It's what actions update.
* `RecordedState` - this is temporary state that will reset at the end of a change.
- `VimState` - this is the state of Vim. It's what actions update.
- `RecordedState` - this is temporary state that will reset at the end of a change.

#### How it works

Expand All @@ -84,7 +84,7 @@ Consists of two data structures:

#### vscode.window.onDidChangeTextEditorSelection

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!)
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!)

## Release

Expand Down
10 changes: 6 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -21,13 +21,15 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Environment (please complete the following information):**

<!--
Ensure you are on the latest VSCode + VSCodeVim
You can use "Report Issue" by running "Developers: Show Running Extensions" from the Command Pallette to prefill these.
-->
- Extension (VsCodeVim) version:
- VSCode version:
- OS:

- Extension (VsCodeVim) version:
- VSCode version:
- OS:

**Additional context**
Add any other context about the problem here.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Please ensure your PR adheres to:
Commits in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)
-->

**Special notes for your reviewer**:
**Special notes for your reviewer**:
Loading

0 comments on commit 4852646

Please sign in to comment.