Skip to content

Commit a232354

Browse files
committed
Fix README.md with correct method names
1 parent 56fd909 commit a232354

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,30 @@ import { decode } from "@chrome-devtools/source-map-scopes-codec";
3535
const scopeInformation = decode(sourceMap);
3636
```
3737

38+
### Scope Builder
39+
3840
The library also contains a builder that makes creating structured scope information easier:
3941

4042
```js
4143
import { ScopeInfoBuilder } from "@chrome-devtools/source-map-scopes-codec";
4244

4345
const scopeInformation = new ScopeInfoBuilder()
44-
.addScope(0, 0, { kind: "Global" })
45-
.addScope(5, 10)
46-
.setScopeKind("Function") // Same as passing 'kind' to 'addScope'.
47-
.setScopeName("foo") // Same as passing 'name' to 'addScope'.
46+
.startScope(0, 0, { kind: "Global" })
47+
.startScope(5, 10)
48+
.setScopeKind("Function") // Same as passing 'kind' to 'startScope'.
49+
.setScopeName("foo") // Same as passing 'name' to 'startScope'.
4850
.endScope(10, 5)
4951
.endScope(11, 1)
50-
.addRange(0, 0, { scope: 0 })
51-
.addRange(0, 10)
52-
.setRangeScopeDefinition(1) // Same as passing 'scope' to 'addRange'.
52+
.startRange(0, 0, { scope: 0 })
53+
.startRange(0, 10)
54+
.setRangeScopeDefinition(1) // Same as passing 'scope' to 'startRange'.
5355
.endRange(0, 15)
5456
.endRange(1, 1)
5557
.build();
5658
```
5759

5860
There is also a `SafeScopeInfoBuilder` that checks that scopes and ranges are well nested and some other integrity constraints (e.g. definition scopes are known).
61+
62+
## Missing features
63+
64+
The library is currently missing support for encoding/decoding sub-range bindings. It will be added in the next release.

0 commit comments

Comments
 (0)