Skip to content

feat: Substitution Part 3#8616

Merged
Jason3S merged 16 commits intomainfrom
dev-map
Feb 23, 2026
Merged

feat: Substitution Part 3#8616
Jason3S merged 16 commits intomainfrom
dev-map

Conversation

@Jason3S
Copy link
Copy Markdown
Collaborator

@Jason3S Jason3S commented Feb 22, 2026

Pull request overview

This PR updates the SourceMap encoding/handling to use relative span-length pairs (instead of absolute offset pairs) so transformations can be composed more reliably, while updating affected parsers, mappers, and tests across the monorepo.

Changes:

  • Redefines SourceMap documentation/usage to represent relative [srcSpanLen, dstSpanLen] segments (with non-linear segment semantics).
  • Introduces new SourceMap utilities in cspell-lib and refactors TextMap/mapping code and tests to use them.
  • Updates TypeScript grammar parsing/mappers to emit relative maps and adjusts fixtures/tests accordingly.

Caution

Internal breaking: SourceMaps are now span lengths instead of being offsets. This makes them invariant during translation, making concatenation, and slicing much easier.
A minor version change was chosen instead of a major version change since it was only used with the experimental TypeScript parser.

@Jason3S Jason3S changed the title feat: Use relative SourceMaps feat: Substitution Part 3 Feb 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 22, 2026

Performance Report

Daily Performance
xychart-beta
    title Files Per Second by Day
    y-axis Files per Second
    x-axis Date [Jan-24, Jan-26, Jan-27, Jan-31, Feb-1, Feb-2, Feb-3, Feb-4, Feb-6, Feb-7, Feb-8, Feb-9, Feb-10, Feb-11, Feb-12, Feb-14, Feb-15, Feb-16, Feb-17, Feb-19, Feb-20, Feb-21, Feb-22, Feb-23]
    bar [190.32, 191.51, 190.41, 192.01, 191.89, 188.72, 191.38, 188.90, 190.72, 190.17, 190.44, 190.91, 190.55, 190.54, 188.86, 190.65, 191.15, 192.54, 190.97, 189.21, 190.95, 191.93, 188.84, 189.28]
    line [20.01, 19.80, 18.94, 17.77, 19.48, 18.59, 18.27, 20.00, 20.26, 18.55, 19.66, 20.05, 18.72, 19.96, 20.29, 18.59, 19.07, 20.25, 18.95, 19.76, 18.01, 18.46, 18.38, 21.90]
    line [26.06, 26.20, 24.97, 23.09, 24.19, 23.67, 25.80, 25.02, 24.57, 25.83, 26.53, 27.12, 25.19, 24.73, 26.32, 25.72, 25.93, 26.65, 24.45, 25.52, 23.53, 25.65, 25.87, 22.18]
    line [69.89, 68.59, 68.16, 64.96, 64.42, 71.54, 66.41, 68.48, 67.32, 68.66, 69.54, 66.78, 64.72, 66.96, 67.81, 67.54, 69.24, 69.14, 67.84, 76.41, 70.89, 67.31, 66.82, 67.73]
    line [106.72, 105.14, 103.83, 105.85, 104.82, 108.27, 101.16, 101.71, 96.80, 105.17, 106.78, 104.49, 88.12, 105.95, 95.68, 105.24, 108.38, 96.07, 105.42, 104.57, 104.52, 96.66, 102.79, 106.23]
    line [128.54, 132.65, 129.67, 126.00, 129.13, 135.02, 129.21, 131.37, 130.21, 127.48, 133.83, 127.77, 122.88, 128.37, 135.10, 130.41, 132.90, 121.26, 129.83, 131.86, 128.62, 131.04, 130.26, 129.46]
    line [150.15, 146.49, 146.96, 143.93, 149.76, 150.71, 139.56, 149.35, 149.31, 151.26, 147.89, 143.35, 146.05, 148.59, 146.97, 147.88, 152.57, 150.80, 149.13, 152.26, 152.78, 149.55, 148.15, 146.55]
    line [261.87, 267.56, 251.76, 251.39, 257.09, 256.60, 252.24, 257.13, 261.45, 265.63, 258.24, 253.80, 254.33, 238.72, 270.54, 256.71, 261.76, 251.74, 255.44, 255.70, 246.95, 250.90, 244.70, 242.12]
    line [226.67, 217.21, 209.84, 210.58, 224.80, 219.16, 222.44, 214.46, 210.98, 218.39, 222.45, 224.30, 218.74, 221.76, 200.54, 218.78, 219.30, 216.79, 209.78, 203.99, 220.72, 225.56, 229.20, 197.90]
    line [55.10, 53.59, 53.02, 57.11, 52.81, 55.66, 56.60, 51.29, 52.77, 57.05, 53.25, 56.05, 58.16, 56.27, 53.18, 53.98, 54.67, 55.62, 52.95, 56.33, 56.16, 52.87, 55.45, 53.54]
    line [102.16, 102.14, 102.53, 103.49, 99.40, 99.16, 97.64, 98.18, 103.70, 106.20, 99.99, 97.22, 103.26, 104.26, 101.58, 98.06, 97.55, 103.52, 102.20, 104.64, 105.41, 96.15, 100.38, 106.16]
    line [86.06, 83.34, 81.63, 80.82, 83.46, 83.98, 85.68, 83.63, 81.75, 82.99, 80.30, 81.36, 82.63, 82.18, 80.51, 83.91, 83.57, 87.71, 81.51, 80.83, 78.91, 82.42, 80.37, 74.03]
    line [330.62, 332.64, 332.86, 330.58, 325.66, 323.17, 336.90, 335.91, 322.03, 323.49, 318.09, 297.24, 321.28, 332.16, 332.97, 319.43, 324.88, 322.69, 320.99, 329.84, 297.30, 325.03, 331.76, 297.98]
    line [24.29, 23.65, 23.65, 21.57, 23.77, 24.71, 24.15, 24.26, 23.40, 25.18, 24.34, 21.29, 24.41, 23.32, 24.52, 23.95, 23.93, 26.14, 23.05, 24.64, 20.92, 22.32, 25.16, 22.81]
    line [232.80, 236.05, 231.31, 219.07, 234.91, 232.08, 226.54, 219.34, 230.80, 225.22, 227.18, 223.96, 236.18, 221.89, 211.43, 221.91, 216.06, 220.67, 225.17, 231.02, 220.24, 226.17, 215.58, 221.35]
    line [15.03, 15.29, 14.84, 15.62, 14.38, 14.96, 14.97, 15.27, 14.50, 15.88, 15.38, 15.78, 13.95, 14.61, 15.64, 15.09, 14.85, 15.30, 15.16, 14.06, 14.46, 15.41, 14.08, 15.61]
    line [34.02, 34.09, 33.87, 34.29, 34.92, 32.72, 32.24, 34.39, 32.11, 29.25, 34.28, 34.27, 30.99, 32.76, 34.39, 34.12, 31.87, 32.51, 34.43, 31.35, 34.71, 33.66, 36.75, 34.13]
    line [47.53, 47.48, 45.26, 47.60, 46.28, 48.66, 45.03, 44.68, 43.73, 45.57, 47.74, 41.63, 41.21, 45.64, 48.81, 44.68, 43.13, 46.03, 46.35, 45.95, 47.66, 45.50, 46.89, 46.51]
    line [193.91, 185.17, 181.80, 175.63, 188.19, 178.84, 190.27, 179.88, 183.71, 188.14, 181.32, 186.40, 168.60, 184.20, 174.99, 182.26, 184.13, 178.63, 177.91, 178.13, 170.26, 181.98, 177.56, 173.68]
    line [90.73, 88.98, 87.79, 92.24, 85.84, 87.34, 84.11, 87.49, 86.37, 87.72, 85.83, 80.71, 86.83, 85.89, 88.80, 88.35, 86.20, 79.88, 88.50, 88.86, 89.95, 85.47, 89.64, 87.88]
    line [218.17, 216.51, 216.11, 223.69, 217.62, 221.92, 210.52, 217.06, 217.75, 221.18, 215.63, 217.27, 218.63, 215.55, 219.85, 215.87, 211.04, 214.14, 215.28, 213.09, 213.97, 220.46, 207.58, 213.71]
    line [238.38, 229.34, 231.07, 215.86, 227.49, 237.43, 233.36, 227.18, 233.42, 233.14, 230.84, 225.21, 232.83, 240.89, 231.65, 231.34, 231.21, 244.19, 223.55, 239.70, 229.90, 235.21, 223.87, 220.46]
    line [129.59, 130.75, 126.15, 128.28, 128.07, 127.23, 125.91, 129.12, 126.49, 131.65, 129.27, 131.48, 127.09, 130.68, 129.17, 127.78, 130.44, 128.86, 131.22, 132.26, 123.16, 133.27, 135.57, 128.79]
    line [202.65, 197.73, 197.86, 185.13, 193.14, 197.96, 188.03, 184.87, 192.18, 186.89, 188.37, 189.97, 197.93, 196.64, 199.99, 198.18, 196.78, 191.66, 183.24, 198.97, 195.69, 196.29, 194.82, 193.20]
    line [174.86, 177.54, 174.66, 177.76, 179.20, 178.55, 179.09, 179.41, 173.82, 171.95, 172.64, 171.28, 176.43, 175.80, 180.86, 176.28, 173.64, 175.63, 176.43, 178.51, 182.28, 170.09, 171.99, 175.84]
    line [269.34, 261.80, 260.28, 260.12, 259.24, 266.03, 264.66, 253.81, 264.19, 262.88, 255.12, 259.81, 256.65, 259.10, 261.07, 258.76, 261.47, 267.24, 254.70, 257.67, 260.94, 258.83, 263.71, 255.65]
    line [204.49, 217.13, 213.62, 216.87, 219.73, 217.00, 217.80, 206.42, 216.86, 217.40, 212.93, 213.99, 216.37, 207.17, 209.51, 213.52, 203.34, 215.88, 213.12, 205.73, 212.95, 211.55, 213.31, 213.98]
    line [244.81, 248.38, 241.40, 249.14, 241.45, 239.07, 239.51, 243.53, 244.90, 249.62, 243.56, 245.16, 248.01, 245.77, 245.71, 246.33, 249.20, 246.02, 244.24, 231.62, 249.13, 242.45, 246.48, 247.99]
    line [39.56, 40.89, 38.42, 41.91, 40.21, 40.30, 38.59, 39.97, 40.70, 38.75, 38.14, 39.24, 39.45, 39.06, 40.44, 38.93, 40.19, 35.66, 39.21, 40.89, 39.79, 40.82, 39.75, 38.71]
    line [83.63, 82.99, 83.39, 81.99, 83.50, 81.95, 82.10, 83.95, 83.89, 81.23, 83.38, 84.02, 78.63, 78.33, 84.47, 83.13, 83.66, 80.84, 83.02, 84.44, 80.37, 87.47, 84.08, 84.50]
    line [178.27, 178.37, 173.24, 175.53, 174.36, 175.31, 176.60, 177.03, 168.50, 172.68, 169.57, 174.00, 174.69, 174.76, 142.58, 173.78, 169.32, 168.80, 179.63, 179.91, 171.61, 176.10, 175.03, 168.14]
    line [353.32, 354.47, 340.16, 355.36, 343.22, 341.35, 343.34, 343.75, 345.17, 341.37, 358.57, 359.43, 367.04, 357.06, 346.78, 363.25, 359.22, 355.34, 343.44, 363.00, 335.36, 339.22, 362.80, 347.59]
    line [221.41, 212.75, 215.81, 222.32, 209.91, 217.01, 216.15, 212.32, 213.20, 215.93, 213.93, 215.54, 211.99, 212.34, 214.45, 216.77, 218.28, 216.31, 214.05, 214.67, 213.49, 218.19, 216.61, 214.83]
    line [425.03, 422.04, 415.46, 422.79, 413.85, 411.47, 422.24, 425.96, 422.90, 426.77, 417.49, 413.10, 427.18, 415.79, 423.61, 413.93, 415.75, 423.97, 415.82, 402.21, 417.90, 421.85, 402.15, 393.97]
    line [195.95, 192.00, 189.33, 196.17, 191.05, 192.93, 192.90, 193.43, 182.93, 188.24, 197.74, 194.04, 183.39, 196.97, 181.19, 192.15, 188.44, 188.43, 193.17, 194.32, 195.93, 197.80, 193.32, 177.39]
    line [136.02, 132.00, 133.67, 130.01, 133.77, 131.00, 132.25, 127.77, 131.87, 132.83, 130.24, 129.37, 135.96, 133.33, 120.48, 131.69, 126.77, 128.95, 131.05, 132.77, 134.30, 133.46, 131.83, 133.40]
    line [125.81, 130.48, 125.23, 130.52, 121.85, 125.25, 129.66, 129.52, 125.44, 125.65, 123.91, 126.45, 124.46, 122.70, 126.21, 125.01, 121.92, 124.63, 126.05, 123.51, 125.30, 123.36, 124.67, 127.11]
    line [82.74, 85.67, 76.62, 69.80, 79.78, 83.19, 79.99, 81.38, 78.37, 78.87, 76.33, 81.76, 73.03, 78.44, 82.16, 76.45, 81.35, 81.75, 78.06, 74.92, 73.32, 81.29, 78.95, 78.49]
    line [259.27, 265.80, 263.72, 257.16, 251.63, 250.02, 261.80, 245.30, 263.91, 261.35, 263.52, 260.14, 262.60, 262.38, 253.84, 256.03, 271.88, 272.11, 262.81, 268.41, 258.56, 256.27, 284.25, 241.15]
    line [384.07, 389.49, 375.11, 344.39, 377.92, 368.78, 357.60, 388.25, 362.18, 363.07, 369.70, 375.89, 360.98, 379.16, 371.95, 380.17, 380.03, 383.65, 403.62, 329.33, 387.65, 379.15, 375.70, 384.43]
    line [37.80, 38.01, 36.89, 36.96, 37.04, 36.98, 36.58, 36.57, 37.20, 37.62, 37.00, 38.62, 38.34, 38.10, 37.49, 36.82, 37.56, 36.77, 36.33, 37.40, 36.62, 38.51, 36.10, 37.90]
    line [49.53, 48.99, 48.58, 48.96, 48.60, 48.80, 46.86, 44.78, 49.77, 46.58, 46.37, 48.10, 48.71, 50.07, 49.29, 45.43, 50.01, 33.04, 44.04, 44.67, 46.36, 48.18, 49.05, 48.26]
    line [233.44, 228.13, 220.74, 229.98, 223.23, 220.66, 222.78, 222.35, 231.30, 222.88, 223.28, 209.50, 215.15, 218.83, 217.74, 220.20, 225.26, 234.21, 221.97, 226.10, 219.20, 223.30, 227.37, 218.36]
    line [6.94, 6.67, 6.54, 6.62, 6.41, 6.91, 6.36, 6.58, 6.71, 6.80, 6.54, 6.62, 5.96, 6.86, 6.86, 6.52, 6.16, 6.48, 6.78, 6.24, 6.45, 6.67, 5.92, 6.59]
    line [138.61, 141.46, 138.59, 143.14, 142.73, 142.84, 131.70, 135.60, 134.90, 137.77, 133.55, 139.08, 139.48, 135.67, 138.79, 139.27, 140.69, 136.31, 141.26, 136.95, 140.26, 134.61, 141.79, 141.85]
    line [126.29, 124.09, 118.58, 122.01, 124.68, 121.40, 124.27, 121.00, 122.72, 124.94, 121.83, 120.56, 119.51, 117.66, 126.41, 120.64, 118.92, 126.15, 122.12, 122.32, 119.71, 119.61, 127.43, 116.40]
    line [240.84, 231.74, 230.60, 238.25, 234.41, 226.71, 230.40, 229.74, 237.81, 232.23, 224.57, 237.26, 238.90, 231.61, 222.35, 235.22, 226.17, 229.70, 226.87, 232.74, 235.31, 224.47, 238.32, 224.73]
    line [167.30, 165.36, 160.46, 164.87, 161.06, 158.29, 161.96, 164.85, 164.28, 164.40, 159.10, 159.22, 159.55, 156.17, 168.86, 156.43, 163.15, 147.05, 161.97, 157.72, 155.61, 153.59, 162.30, 160.85]
    line [205.03, 203.50, 200.03, 203.99, 203.12, 208.67, 201.18, 195.78, 203.73, 196.42, 202.06, 200.13, 204.90, 199.89, 202.61, 200.63, 203.97, 207.62, 204.11, 196.35, 204.19, 205.00, 194.87, 204.43]
    line [100.22, 98.35, 98.09, 97.24, 99.79, 99.21, 94.63, 98.63, 99.54, 99.93, 96.90, 95.85, 100.02, 98.95, 99.68, 93.47, 96.18, 99.12, 97.35, 97.51, 101.87, 100.27, 99.76, 99.34]
    line [167.02, 174.50, 177.97, 180.67, 179.91, 166.82, 180.26, 174.86, 175.68, 174.32, 177.53, 181.20, 174.17, 176.92, 176.20, 178.74, 179.75, 180.11, 177.55, 173.68, 176.25, 178.32, 171.39, 178.10]
Loading
Time to Process Files
Repository Elapsed Min/Avg/Max SD SD Graph
AdaDoom3/AdaDoom3 2.72 2.6 / 2.8 / 2.9 0.07 ┣━━┻●━╋━━┻━━┫
alexiosc/megistos 7.88 6.6 / 7.1 / 7.8 0.23 ┣━━┻━━╋━━┻━━┫ ●
apollographql/apollo-server 2.39 2.4 / 2.5 / 2.9 0.12 ┣━━●━━╋━━┻━━┫
aspnetboilerplate/aspnetboilerplate 8.94 8.3 / 8.8 / 9.9 0.24 ┣━━┻━━╋━●┻━━┫
aws-amplify/docs 11.59 11.4 / 11.8 / 12.5 0.24 ┣━━┻●━╋━━┻━━┫
Azure/azure-rest-api-specs 10.13 8.6 / 9.4 / 11.2 0.47 ┣━━┻━━╋━━┻━●┫
bitjson/typescript-starter 0.91 1.0 / 1.0 / 1.2 0.06 ●┣━┻━━╋━━┻━┫
caddyserver/caddy 3.36 3.1 / 3.4 / 3.7 0.13 ┣━━┻━━●━━┻━━┫
canada-ca/open-source-logiciel-libre 1.06 1.0 / 1.1 / 1.2 0.06 ┣━┻━━●━━┻━┫
chef/chef 5.49 5.0 / 5.4 / 5.9 0.19 ┣━━┻━━╋━●┻━━┫
dart-lang/sdk 53.75 50.2 / 54.4 / 60.2 1.48 ┣━━━┻━●━╋━━━┻━━━┫
django/django 13.46 12.8 / 13.4 / 14.4 0.36 ┣━━┻━━●━━┻━━┫
eslint/eslint 9.64 9.2 / 9.5 / 10.3 0.24 ┣━━┻━━╋●━┻━━┫
exonum/exonum 3.31 3.2 / 3.4 / 3.6 0.10 ┣━━┻━●╋━━┻━━┫
flutter/samples 15.23 13.4 / 14.3 / 17.4 0.58 ┣━━━┻━━╋━━┻━●━┫
gitbucket/gitbucket 3.20 3.0 / 3.2 / 3.4 0.11 ┣━━┻━━●━━┻━━┫
googleapis/google-cloud-cpp 118.84 115.2 / 119.4 / 135.3 3.74 ┣━━━┻━━●╋━━━┻━━━┫
graphql/express-graphql 1.14 1.0 / 1.1 / 1.3 0.07 ┣━┻━━╋━●┻━┫
graphql/graphql-js 2.59 2.5 / 2.7 / 3.1 0.10 ┣━━┻●━╋━━┻━━┫
graphql/graphql-relay-js 1.26 1.0 / 1.1 / 1.3 0.07 ┣━┻━━╋━━┻━┫●
graphql/graphql-spec 1.22 1.2 / 1.3 / 1.4 0.06 ┣━┻●━╋━━┻━┫
iluwatar/java-design-patterns 11.60 10.8 / 11.4 / 12.3 0.36 ┣━━┻━━╋●━┻━━┫
ktaranov/sqlserver-kit 5.80 5.5 / 5.9 / 6.9 0.22 ┣━━┻●━╋━━┻━━┫
liriliri/licia 3.74 3.4 / 3.8 / 4.4 0.17 ┣━━┻●━╋━━┻━━┫
MartinThoma/LaTeX-examples 6.27 5.8 / 6.1 / 6.7 0.19 ┣━━┻━━╋━━●━━┫
mdx-js/mdx 1.80 1.4 / 1.8 / 2.1 0.11 ┣━━┻━━●━━┻━━┫
microsoft/TypeScript-Website 5.19 4.9 / 5.1 / 5.9 0.19 ┣━━┻━━╋●━┻━━┫
MicrosoftDocs/PowerShell-Docs 19.85 19.3 / 20.1 / 22.0 0.55 ┣━━━┻●━╋━━┻━━━┫
neovim/nvim-lspconfig 3.99 3.8 / 4.0 / 4.6 0.15 ┣━━┻━━●━━┻━━┫
pagekit/pagekit 3.74 3.2 / 3.4 / 3.9 0.15 ┣━━┻━━╋━━┻━━●
php/php-src 22.89 22.1 / 23.2 / 28.7 0.94 ┣━━━┻━●╋━━┻━━━┫
plasticrake/tplink-smarthome-api 1.28 1.2 / 1.3 / 1.9 0.10 ┣━┻━●╋━━┻━┫
prettier/prettier 7.66 7.1 / 7.5 / 8.1 0.25 ┣━━┻━━╋━●┻━━┫
pycontribs/jira 1.48 1.3 / 1.5 / 1.7 0.09 ┣━┻━━●━━┻━┫
RustPython/RustPython 6.48 5.7 / 6.1 / 7.1 0.23 ┣━━┻━━╋━━┻●━┫
shoelace-style/shoelace 2.73 2.6 / 2.7 / 3.1 0.11 ┣━━┻━━●━━┻━━┫
slint-ui/slint 13.02 12.1 / 12.8 / 14.1 0.45 ┣━━━┻━━╋●━┻━━━┫
SoftwareBrothers/admin-bro 2.54 2.3 / 2.4 / 2.7 0.10 ┣━━┻━━╋━━●━━┫
sveltejs/svelte 21.46 19.5 / 20.0 / 21.0 0.38 ┣━━┻━━╋━━┻━━┫ ●
TheAlgorithms/Python 5.79 5.2 / 5.5 / 6.4 0.22 ┣━━┻━━╋━━┻●━┫
twbs/bootstrap 1.74 1.5 / 1.7 / 2.0 0.08 ┣━┻━━●━━┻━┫
typescript-cheatsheets/react 1.37 1.3 / 1.3 / 1.5 0.06 ┣━┻━━╋●━┻━┫
typescript-eslint/typescript-eslint 4.38 3.8 / 4.0 / 4.5 0.18 ┣━━┻━━╋━━┻━━●
vitest-dev/vitest 11.45 9.9 / 10.8 / 11.7 0.41 ┣━━┻━━╋━━┻━●┫
w3c/aria-practices 3.21 3.1 / 3.2 / 3.6 0.12 ┣━━┻━━●━━┻━━┫
w3c/specberus 1.85 1.8 / 1.9 / 2.2 0.10 ┣━━┻●━╋━━┻━━┫
webdeveric/webpack-assets-manifest 1.18 1.0 / 1.2 / 1.4 0.08 ┣━┻━●╋━━┻━┫
webpack/webpack 5.16 4.7 / 5.0 / 5.6 0.20 ┣━━┻━━╋━●┻━━┫
wireapp/wire-desktop 1.29 1.2 / 1.3 / 1.6 0.09 ┣━┻━●╋━━┻━┫
wireapp/wire-webapp 11.75 10.3 / 10.8 / 11.8 0.35 ┣━━┻━━╋━━┻━━┫ ●

Note:

  • Elapsed time is in seconds.
Files per Second over Time
Repository Files Sec Fps Rel Trend Fps N
AdaDoom3/AdaDoom3 103 2.72 37.90 1.76% █▇▇█▇▅▇▆▆▇▇▆▅▆▇▆██▅▇ 56
alexiosc/megistos 583 7.88 74.03 -10.44% ▆▅▆▆▅▇▆▇▇█▅█▅▇▆▅▇▅▅▃ 56
apollographql/apollo-server 254 2.39 106.16 5.14% ▇▇██▇▃█▅▆▇▄▇▇▇██▆▄▆█ 56
aspnetboilerplate/aspnetboilerplate 2286 8.94 255.65 -1.82% ▇▇▆▇▇▇▇▇▇▆██▆▇▇▇▆██▇ 56
aws-amplify/docs 2874 11.59 247.99 1.55% ▇▇▇▇▇▇▇▇▆█▇▇▇▇▅▇▇▆▇▇ 56
Azure/azure-rest-api-specs 2444 10.13 241.15 -7.55% ▆▇▅▆▅▆▅▅▆▇▇▇▆▆▇▆▇▄█▄ 56
bitjson/typescript-starter 20 0.91 21.90 13.73% ▅▆▆▆▆▅▅▅▂▆▃▆▆▄▆▄▃▅▄█ 56
caddyserver/caddy 295 3.36 87.88 0.98% ▇▇▆▇▇█▆▇█▇▆▄▆█▇█▅▇█▇ 56
canada-ca/open-source-logiciel-libre 7 1.06 6.59 0.29% ▃▆▇█▇▆▃▇▆▄▄▅▆▇▄▅█▄▃▆ 56
chef/chef 1199 5.49 218.36 -2.11% ▅▆▅▇▆▇▆▆▆█▆█▅▇▇▆▇▆▇▆ 56
dart-lang/sdk 10988 53.75 204.43 1.34% █▆█▆▇▆▇▇▇█▇█▇█▆█▇█▆█ 56
django/django 2891 13.46 214.83 -0.10% ▆▇▇▄▆██▇▅█▆▇▇▅▇▆▇▇▇▇ 56
eslint/eslint 2060 9.64 213.71 -1.24% ▇▇▅▇▇█▆▇▆█▄▆▆█▆▆█▇▅▆ 56
exonum/exonum 421 3.31 127.11 1.18% ▇▇▅▆▇▇█▇▄▇▅▇█▆▆▇▇▆▇▇ 56
flutter/samples 2561 15.23 168.14 -3.18% ▇▇▇█▃▇█▇▇▇▆▆███▇██▇▆ 56
gitbucket/gitbucket 414 3.20 129.46 -0.56% ▅▆▆▇█▆▇█▇▇█▄▇▆▇▆▇▇▇▇ 56
googleapis/google-cloud-cpp 21165 118.84 178.10 0.82% ▇▇▇█▇▇█▇▇▇██▇▇▆▇▆█▆▇ 56
graphql/express-graphql 26 1.14 22.81 -4.00% ▇▇▆▄▇▇█▅▅▇▆█▆▄▇▃▄▆▇▅ 56
graphql/graphql-js 368 2.59 141.85 2.71% ▇▇▅▆▆▅▆▇█▇▇▆▇▇▆▇▅▆▇▇ 56
graphql/graphql-relay-js 28 1.26 22.18 -12.53% ▆▆▄▆▇▆▅▆█▆▇▇▄▇▆▄▆▆▆▃ 56
graphql/graphql-spec 19 1.22 15.61 4.06% ▄▇▄▇█▇▆▇▇▅█▇▇▇▅▅█▇▅█ 56
iluwatar/java-design-patterns 2039 11.60 175.84 0.05% ▇▆▇▇█▇█▆▇▅▇▇▇▆▇█▆▄▆▇ 56
ktaranov/sqlserver-kit 490 5.80 84.50 1.87% ▅▃▆▆▇▇▆▅█▆▆▆▇▆▇▅▇█▇▇ 56
liriliri/licia 1437 3.74 384.43 2.43% ▅▄▆▇▅▅▆▆▆▆▅▆▆█▃▆▆▆▅▆ 56
MartinThoma/LaTeX-examples 1409 6.27 224.73 -2.95% ██▇▆▅█▇█▆▆▆▆▆▆▇▇▆▅█▆ 56
mdx-js/mdx 141 1.80 78.49 -0.76% ▅▇▇▆██▅▆▅█▇█▅▇▅▅▇█▇▆ 56
microsoft/TypeScript-Website 761 5.19 146.55 -0.99% ▆█▆▇▇▇▇▆▇█▇▇▇▇██▇▇▇▇ 56
MicrosoftDocs/PowerShell-Docs 2648 19.85 133.40 1.26% ██▇▇▄▆█▇▇▄▇▆▇▇▇██▇▇▇ 56
neovim/nvim-lspconfig 770 3.99 193.20 -0.34% ▇▇▇▇▇▇██▆▇▇▆▆▅▇▇▇▇▇▇ 56
pagekit/pagekit 741 3.74 197.90 -9.03% ▇▇▇▇▄█▅▇▇█▆▆▄▇▅▇███▄ 56
php/php-src 2274 22.89 99.34 1.38% ██▇▇█▇▂▇█▇▆▇▇▇▇████▇ 56
plasticrake/tplink-smarthome-api 62 1.28 48.26 1.49% ▇▇█▇▇▅▅▇▇█▇▂▅▆▆▆█▆▇▇ 56
prettier/prettier 2664 7.66 347.59 -0.61% █▇▆▇▆▇█▇█▇▇▇▅▆▇▅▄▆▇▆ 56
pycontribs/jira 79 1.48 53.54 -1.28% █▆█▇▆▇▆▅▇▅█▇▅▆▇▇▃█▇▆ 56
RustPython/RustPython 754 6.48 116.40 -4.38% ▆▅▆▆█▇▇▆▇▆▆█▆▇▇▆▆▆█▆ 56
shoelace-style/shoelace 439 2.73 160.85 0.04% ▆▆▅▆█▄▆▆▇▆█▄▇▇▆▆▇▃▇▇ 56
slint-ui/slint 2786 13.02 213.98 0.36% ██▇▄▇█▇█▇▇▅██▇▆▇█▆▇▇ 56
SoftwareBrothers/admin-bro 441 2.54 173.68 -4.97% ▅▇██▆█▆█▇▇█▆█▅▆▅▇▇▆▆ 56
sveltejs/svelte 8453 21.46 393.97 -5.79% ██▇▅█▇▇▆▇▇▇█▆▇▅▇▇█▅▄ 56
TheAlgorithms/Python 1401 5.79 242.12 -5.39% ▆▃█▃█▆▇▆█▇▇▆▆▇▇▆▆▆▅▅ 56
twbs/bootstrap 118 1.74 67.73 -0.50% ▄▆▆▄▅▄▅▆▆▆▆▆▅▆█▆▅▅▅▅ 56
typescript-cheatsheets/react 53 1.37 38.71 -1.85% ▆▇▇▄▇▆▇▆▄▆█▃▆▇▇▇▇█▇▆ 56
typescript-eslint/typescript-eslint 1306 4.38 297.98 -8.61% ▆▆▆█▇▅▇▆▆▅█▆▇▅▇▄▆▇▇▄ 56
vitest-dev/vitest 2525 11.45 220.46 -4.80% ▆▆█▆▅▅▅▆▆▅▆▇▅▄▆▅▅▇▄▄ 56
w3c/aria-practices 414 3.21 128.79 -0.04% ▆▇▇▇▇▇▆▆▆█▆▆▇▇▇▅███▆ 56
w3c/specberus 197 1.85 106.23 2.60% ▃█▇▇▅▆▇▇▇██▅▇▇▇▇▄▆▆▇ 56
webdeveric/webpack-assets-manifest 55 1.18 46.51 1.80% ▄█▃██▆▆▆▅▄▆▇▇▇▆▇█▄▇▇ 56
webpack/webpack 1143 5.16 221.35 -2.46% █▅▅█▅▆▇▅▆▇▃▆█▆▇▆█▆▅▆ 56
wireapp/wire-desktop 44 1.29 34.13 1.89% ▅▅▄█▇▅▆▇▇▄▆▅▇▆▅▇▆▆█▆ 56
wireapp/wire-webapp 2084 11.75 177.39 -7.66% ▅██▇▅▇█▆▇▆▇▆▆█▇███▇▄ 55
Data Throughput
Repository Files Sec Kps Rel Trend Kps N
AdaDoom3/AdaDoom3 103 2.72 805.40 1.76% █▇▇█▇▅▇▆▆▇▇▆▅▆▇▆██▅▇ 56
alexiosc/megistos 583 7.88 581.69 -10.44% ▆▅▆▆▅▇▆▇▇█▅█▅▇▆▅▇▅▅▃ 56
apollographql/apollo-server 254 2.39 872.24 5.39% ▇▇██▇▃█▅▆▇▄▇▇▇██▆▄▆█ 56
aspnetboilerplate/aspnetboilerplate 2286 8.94 622.02 -1.82% ▇▇▆▇▇▇▇▇▇▆██▆▇▇▇▆██▇ 56
aws-amplify/docs 2874 11.59 867.10 1.58% ▇▇▇▇▇▇▇▇▆█▇▇▇▇▅▇▇▆▇▇ 56
Azure/azure-rest-api-specs 2444 10.13 632.09 -7.93% ▆█▅▆▆▇▅▅▇▇▇▇▆▆▇▆▇▄█▄ 56
bitjson/typescript-starter 20 0.91 87.58 13.73% ▅▆▆▆▆▅▅▅▂▆▃▆▆▄▆▄▃▅▄█ 56
caddyserver/caddy 295 3.36 767.37 0.68% ▇▇▆▇▇█▆▇█▇▆▄▆█▇█▅▇█▇ 56
canada-ca/open-source-logiciel-libre 7 1.06 54.64 0.29% ▃▆▇█▇▆▃▇▆▄▄▅▆▇▄▅█▄▃▆ 56
chef/chef 1199 5.49 1024.42 -2.08% ▅▆▅▇▆▇▆▆▆█▆█▅▇▇▆▇▆▇▆ 56
dart-lang/sdk 10988 53.75 1389.90 1.34% █▆█▆▇▇▇▇▇█▇█▇█▆█▇█▆█ 56
django/django 2891 13.46 1357.41 0.02% ▆▇▇▄▆██▇▆█▆▇▇▅▇▆▇▇▇▇ 56
eslint/eslint 2060 9.64 1483.41 -1.10% ▇▇▅▇▇█▅▇▆█▄▆▆█▆▆█▇▅▆ 56
exonum/exonum 421 3.31 1215.86 1.18% ▇▇▅▆▇▇█▇▄▇▅▇█▆▆▇▇▆▇▇ 56
flutter/samples 2561 15.23 1420.21 -5.86% ██▇█▃▇█▇█▇▆▆███▆▇▇▇▆ 56
gitbucket/gitbucket 414 3.20 591.97 -0.31% ▅▆▆▇█▆▇█▇▇█▄▇▆▇▆▇▇▇▇ 56
googleapis/google-cloud-cpp 21165 118.84 1447.15 0.66% ▇▇▇█▇▇█▇▇▇██▇▇▆▇▆█▆▇ 56
graphql/express-graphql 26 1.14 104.39 -4.00% ▇▇▆▄▇▇█▅▅▇▆█▆▄▇▃▄▆▇▅ 56
graphql/graphql-js 368 2.59 826.07 2.82% ▇▇▅▆▆▅▆▇█▇▇▆▇▇▆▇▅▆▇▇ 56
graphql/graphql-relay-js 28 1.26 87.14 -12.53% ▆▆▄▆▇▆▅▆█▆▇▇▄▇▆▄▆▆▆▃ 56
graphql/graphql-spec 19 1.22 521.00 4.06% ▄▇▄▇█▇▆▇▇▅█▇▇▇▅▅█▇▅█ 56
iluwatar/java-design-patterns 2039 11.60 544.01 0.11% ▇▆▇▇█▇█▆▇▅▇▇▇▆▇█▆▄▆▇ 56
ktaranov/sqlserver-kit 490 5.80 1277.33 1.81% ▅▃▆▆▇▇▆▅█▆▆▆▇▆▇▅▇█▇▇ 56
liriliri/licia 1437 3.74 458.00 2.43% ▅▄▆▇▅▅▆▆▆▆▅▆▆█▃▆▆▆▅▆ 56
MartinThoma/LaTeX-examples 1409 6.27 464.14 -2.95% ██▇▆▅█▇█▆▆▆▆▆▆▇▇▆▅█▆ 56
mdx-js/mdx 141 1.80 364.63 -0.76% ▅▇▇▆██▅▆▅█▇█▅▇▅▅▇█▇▆ 56
microsoft/TypeScript-Website 761 5.19 1013.54 -1.00% ▆█▆▇▇▇▇▆▇█▇▇▇▇██▇▇▇▇ 56
MicrosoftDocs/PowerShell-Docs 2648 19.85 1394.76 1.27% ██▇▇▄▆█▇▇▄▇▆▇▇▇██▇▇▇ 56
neovim/nvim-lspconfig 770 3.99 367.83 1.01% ▇▇▇▇▇▇██▆▇▇▇▆▅█▇▇▇▇▇ 56
pagekit/pagekit 741 3.74 412.62 -9.03% ▇▇▇▇▄█▅▇▇█▆▆▄▇▅▇███▄ 56
php/php-src 2274 22.89 1728.96 1.19% ██▇▇█▇▂▇█▇▆▇▇▇▇████▇ 56
plasticrake/tplink-smarthome-api 62 1.28 260.74 1.49% ▇▇█▇▇▅▅▇▇█▇▂▅▆▆▆█▆▇▇ 56
prettier/prettier 2664 7.66 478.20 -1.34% █▇▆▇▆▇█▇█▇▇▆▄▆▇▅▄▆▇▆ 56
pycontribs/jira 79 1.48 379.55 -1.28% █▆█▇▆▇▆▅▇▅█▇▅▆▇▇▃█▇▆ 56
RustPython/RustPython 754 6.48 1696.81 2.07% ▆▆▇▆█▇▇▆▇▆▆█▇█▇▇▇▇█▆ 56
shoelace-style/shoelace 439 2.73 777.15 0.04% ▆▆▅▆█▄▆▆▇▆█▄▇▇▆▆▇▃▇▇ 56
slint-ui/slint 2786 13.02 1327.97 0.04% ██▇▄▇█▇█▇▇▅██▇▆▇█▆▇▇ 56
SoftwareBrothers/admin-bro 441 2.54 382.81 -4.97% ▅▇██▆█▆█▇▇█▆█▅▆▅▇▇▆▆ 56
sveltejs/svelte 8453 21.46 265.70 -5.55% ██▇▅█▇▇▆▇▇▇█▆█▅▇▇█▅▄ 56
TheAlgorithms/Python 1401 5.79 616.44 -5.39% ▆▃█▃█▆▇▆█▇▇▆▆▇▇▆▆▆▅▅ 56
twbs/bootstrap 118 1.74 556.18 -0.50% ▄▆▆▄▅▄▅▆▆▆▆▆▅▆█▆▅▅▅▅ 56
typescript-cheatsheets/react 53 1.37 287.07 -1.64% ▆▇▇▄▇▆▇▆▄▆█▃▆▇█▇▇█▇▆ 56
typescript-eslint/typescript-eslint 1306 4.38 1572.03 -8.42% ▆▆▆█▇▅▇▆▆▅█▆▇▅▇▄▆▇▇▄ 56
vitest-dev/vitest 2525 11.45 662.33 -3.61% ▆▆█▆▆▅▅▆▆▅▆▇▅▄▆▅▅▇▅▄ 56
w3c/aria-practices 414 3.21 1203.00 -0.03% ▆▇▇▇▇▇▆▆▆█▆▆▇▇▇▅███▆ 56
w3c/specberus 197 1.85 337.04 2.81% ▃█▇▇▅▆▇▇▇██▅▇▇▇▇▄▆▆▇ 56
webdeveric/webpack-assets-manifest 55 1.18 106.55 1.80% ▄█▃██▆▆▆▅▄▆▇▇▇▆▇█▄▇▇ 56
webpack/webpack 1143 5.16 1034.13 -2.16% █▅▅█▅▆▇▅▆▇▃▆█▆▇▆█▆▅▆ 56
wireapp/wire-desktop 44 1.29 152.01 1.89% ▅▅▄█▇▅▆▇▇▄▆▅▇▆▅▇▆▆█▆ 56
wireapp/wire-webapp 2084 11.75 690.13 -7.72% ▅██▇▅▇█▆▇▆▇▆▆█▇███▇▄ 55

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the SourceMap encoding/handling to use relative span-length pairs (instead of absolute offset pairs) so transformations can be composed more reliably, while updating affected parsers, mappers, and tests across the monorepo.

Changes:

  • Redefines SourceMap documentation/usage to represent relative [srcSpanLen, dstSpanLen] segments (with non-linear segment semantics).
  • Introduces new SourceMap utilities in cspell-lib and refactors TextMap/mapping code and tests to use them.
  • Updates TypeScript grammar parsing/mappers to emit relative maps and adjusts fixtures/tests accordingly.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
packages/cspell-types/src/Parser/types.ts Updates SourceMap documentation and examples for the new relative span format.
packages/cspell-types/src/Parser/Mapped.ts Updates the Mapped.map doc example for the new SourceMap encoding.
packages/cspell-types/api/index.d.mts Regenerated API types reflecting updated SourceMap docs/examples.
packages/cspell-types/api/Parser/index.d.mts Regenerated Parser API types reflecting updated SourceMap docs/examples.
packages/cspell-lib/src/lib/textValidation/docValidator.test.ts Adjusts expected issues due to updated fixture content.
packages/cspell-lib/src/lib/Transform/parsedText.ts Updates mapping helpers’ types to SourceMap and tweaks map presence checks.
packages/cspell-lib/src/lib/Transform/parsedText.test.ts Updates tests to convert legacy offset-pair maps into the new SourceMap format.
packages/cspell-lib/src/lib/Transform/TextMap.ts Refactors mapping/extraction logic to rely on new SourceMap utilities.
packages/cspell-lib/src/lib/Transform/TextMap.test.ts Updates TextMap tests for the new map format and new mapping helpers.
packages/cspell-lib/src/lib/Transform/SubstitutionTransformer.ts Converts generated offset-pair maps into the new relative SourceMap format.
packages/cspell-lib/src/lib/Transform/SubstitutionTransformer.test.ts Updates expected maps to the new relative SourceMap format.
packages/cspell-lib/src/lib/Transform/SourceMap.ts Adds new core SourceMap cursor/merge/slice utilities.
packages/cspell-lib/src/lib/Transform/SourceMap.test.ts Adds unit tests covering merge/slice behavior and substitution assumptions.
packages/cspell-lib/fixtures/docValidator/parser/sample.ts Extends fixture to include an additional escaped-word error case.
packages/cspell-grammar/src/parsers/typescript/TypeScriptParser.ts Switches to appendParsedText and converts raw-string offset maps to relative maps.
packages/cspell-grammar/src/mappers/typescript.ts Renames map to offsetMap for raw string mapping output.
packages/cspell-grammar/src/mappers/typescript.test.ts Updates tests to assert on offsetMap.
packages/cspell-grammar/src/mappers/types.ts Renames mapping field to offsetMap and adjusts typing.
packages/cspell-grammar/src/mappers/appendMappedText.ts Adds appendParsedText; updates appendMappedText to use offsetMap.
packages/cspell-grammar/src/mappers/appendMappedText.test.ts Updates helper to build MappedText with offsetMap.

Jason3S and others added 6 commits February 22, 2026 20:46
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jason Dent <Jason3S@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jason Dent <Jason3S@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jason Dent <Jason3S@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

packages/cspell-lib/src/lib/Transform/parsedText.ts:82

  • mapRangeBackToOriginalPos / mapRangeToLocal currently treat each map pair as linearly interpolatable. With the new SourceMap semantics, non-linear segments (either span lengths where srcLen !== dstLen, or segments explicitly marked via a preceding 0,0) must not be split; offsets inside them should map to the segment start. As written, ranges inside an expansion segment (e.g. 1->6) will incorrectly map to different source offsets instead of collapsing to the segment start. Consider rewriting these helpers to use createSourceMapCursor (like TextMap.mapOffsetToSource/mapOffsetToDest) or explicitly detect non-linear segments and clamp offsets accordingly, including honoring the 0,0 non-linear marker.
export function mapRangeBackToOriginalPos(offRange: SimpleRange, map: SourceMap | undefined): SimpleRange {
    if (!map || !map.length) return offRange;

    const [start, end] = offRange;

    let i = 0,
        j = 0,
        p = 1;

    while (p < map.length && map[p] + j < start) {
        i += map[p - 1];
        j += map[p];
        p += 2;
    }

    const iA = start - j + i;

    while (p < map.length && map[p] + j < end) {
        i += map[p - 1];
        j += map[p];
        p += 2;
    }

    const iB = end - j + i;

    return [iA, iB];
}

export function mapRangeToLocal(rangeOrig: SimpleRange, map: SourceMap | undefined): SimpleRange {
    if (!map?.length) return rangeOrig;

    const [start, end] = rangeOrig;

    let i = 0,
        j = 0,
        p = 0;

    while (p < map.length && map[p] + i < start) {
        i += map[p];
        j += map[p + 1];
        p += 2;
    }

    const jA = start - i + j;

    while (p < map.length && map[p] + i < end) {
        i += map[p];
        j += map[p + 1];
        p += 2;
    }

    const jB = end - i + j;

    return [jA, jB];
}

Jason3S and others added 5 commits February 23, 2026 07:04
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jason Dent <Jason3S@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jason Dent <Jason3S@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 7 comments.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jason Dent <Jason3S@users.noreply.github.com>
@Jason3S Jason3S marked this pull request as ready for review February 23, 2026 07:44
@Jason3S Jason3S merged commit bbd0af8 into main Feb 23, 2026
80 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants