You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -11,7 +11,12 @@ The package includes typescript definitions.
11
11
npm install vscode-diff --save
12
12
```
13
13
## Usage
14
-
Typescript:
14
+
15
+
Starting from version 1.71.0 VS Code introduced new diffing algorithm that can also detect code moves. It is currently used by default in VS Code and can be accessed in this library as `AdvancedLinesDiffComputer`.
16
+
The legacy algorithm can be accessed as `DiffComputer`.
The format of the result mapping is similar to that returned by `DiffComputer` but beware that then ending line number in line range is exclusive, e.g.
162
+
```json
163
+
"originalRange": {
164
+
"startLineNumber": 2,
165
+
"endLineNumberExclusive": 3
166
+
}
167
+
```
168
+
169
+
as opposed to
170
+
```json
171
+
"originalStartLineNumber": 2,
172
+
"originalEndLineNumber": 2,
173
+
```
174
+
175
+
83
176
## Changelog
84
177
178
+
### 2.1.0
179
+
* Update to VS Code 1.82.1 that introduces new diffing algorithm `AdvancedLinesDiffComputer`.
Since we do not want this package to differ from the original implementation in VS Code, no changes that differs from the [source repository](https://github.com/Microsoft/vscode) will be merged. Any changes that only affect this npm package (like changes to this README) are welcome via pull requests.
107
203
108
-
If you want to help keep the diff algorithm up to date, you'll find from which commit and what file the code comes from in the top of the file, e.g:
109
-
110
-
_src/diffComputer.ts_
111
-
```javascript
112
-
// Updated from commit 46d1426 - vscode/src/vs/editor/common/diff/diffComputer.ts
113
-
```
204
+
Steps for updating diff algorithm:
205
+
* Copy all necessary files from VS Code repo.
206
+
* Verify with `npm run build` that all code is self-contained.
207
+
* Verify with `npm run unimported` that there are no unused files.
208
+
* Run `npm test` to run all the tests.
209
+
* Update [src/example.ts] on any API changes.
210
+
* Run `npm run example` and update this README with example usage code and output.
211
+
* Include VS Code version and commit hash in commit message.
114
212
115
213
Any help documenting the diff API is very welcome.
0 commit comments