Full Code of ducaale/xh for AI

master 2751f22f31ea cached
71 files
794.0 KB
201.4k tokens
735 symbols
1 requests
Download .txt
Showing preview only (824K chars total). Download the full file or copy to clipboard to get everything.
Repository: ducaale/xh
Branch: master
Commit: 2751f22f31ea
Files: 71
Total size: 794.0 KB

Directory structure:
gitextract_9556vlw0/

├── .github/
│   └── workflows/
│       ├── ci.yaml
│       └── release.yaml
├── .gitignore
├── CHANGELOG.md
├── Cargo.toml
├── FAQ.md
├── LICENSE
├── README.md
├── RELEASE-CHECKLIST.md
├── assets/
│   ├── README.md
│   ├── syntax/
│   │   ├── basic/
│   │   │   └── json.sublime-syntax
│   │   └── large/
│   │       ├── css.sublime-syntax
│   │       ├── html.sublime-syntax
│   │       ├── js.sublime-syntax
│   │       └── xml.sublime-syntax
│   └── themes/
│       ├── ansi.tmTheme
│       ├── fruity.tmTheme
│       ├── monokai.tmTheme
│       └── solarized.tmTheme
├── build.rs
├── completions/
│   ├── _xh
│   ├── _xh.ps1
│   ├── xh.bash
│   ├── xh.elv
│   ├── xh.fish
│   └── xh.nu
├── doc/
│   ├── man-template.roff
│   └── xh.1
├── install.ps1
├── install.sh
├── src/
│   ├── auth.rs
│   ├── buffer.rs
│   ├── cli.rs
│   ├── content_disposition.rs
│   ├── decoder.rs
│   ├── download.rs
│   ├── error_reporting.rs
│   ├── formatting/
│   │   ├── headers.rs
│   │   ├── mod.rs
│   │   └── palette.rs
│   ├── generation.rs
│   ├── main.rs
│   ├── message_signature.rs
│   ├── middleware.rs
│   ├── nested_json.rs
│   ├── netrc.rs
│   ├── printer.rs
│   ├── redacted.rs
│   ├── redirect.rs
│   ├── request_items.rs
│   ├── session.rs
│   ├── to_curl.rs
│   └── utils.rs
└── tests/
    ├── cases/
    │   ├── auth_message_signature.rs
    │   ├── compress_request_body.rs
    │   ├── download.rs
    │   ├── logging.rs
    │   ├── mod.rs
    │   ├── unix_socket.rs
    │   └── xml.rs
    ├── cli.rs
    ├── fixtures/
    │   ├── certs/
    │   │   ├── README.md
    │   │   ├── client.badssl.com.crt
    │   │   ├── client.badssl.com.key
    │   │   └── wildcard-self-signed.pem
    │   ├── keys/
    │   │   └── rsa_private_key_pkcs8.pem
    │   └── responses/
    │       ├── README.md
    │       ├── hello_world.br
    │       ├── hello_world.zst
    │       └── hello_world.zz
    └── server/
        └── mod.rs

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/workflows/ci.yaml
================================================
name: CI

on:
  pull_request:
  push:
    branches: [master]
  schedule:
    - cron: "00 00 * * *"

jobs:
  test:
    name: Test
    runs-on: ${{ matrix.job.os }}
    timeout-minutes: 15
    strategy:
      matrix:
        job:
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
            flags: --features=native-tls
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
            flags: --no-default-features --features=native-tls,online-tests # disables rustls
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
            flags: --features=http3
            rustflags: --cfg reqwest_unstable
          - target: x86_64-apple-darwin
            os: macos-15-intel
            flags: --features=native-tls
          - target: aarch64-apple-darwin
            os: macos-latest
            flags: --features=native-tls
          - target: x86_64-pc-windows-msvc
            os: windows-latest
            flags: --features=native-tls
          - target: x86_64-unknown-linux-musl
            os: ubuntu-latest
            use-cross: true
          - target: aarch64-unknown-linux-musl
            os: ubuntu-latest
            use-cross: true
            flags: -- --test-threads=4
          - target: arm-unknown-linux-gnueabihf
            os: ubuntu-latest
            use-cross: true
            flags: -- --test-threads=4
    steps:
      - uses: actions/checkout@v4

      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: 1.85.0 # minimum supported rust version
          targets: ${{ matrix.job.target }}

      - uses: Swatinem/rust-cache@v2
        with:
          key: v2-${{ matrix.job.target }}

      - name: Set RUSTFLAGS env variable
        if: matrix.job.rustflags
        shell: bash
        run: echo "RUSTFLAGS=${{ matrix.job.rustflags }}" >> $GITHUB_ENV

      - uses: ClementTsang/cargo-action@v0.0.6
        with:
          use-cross: ${{ !!matrix.job.use-cross }}
          command: test
          args: --target ${{ matrix.job.target }} ${{ matrix.job.flags }}

  fmt-and-clippy:
    name: Rustfmt and clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
          components: rustfmt, clippy

      - uses: Swatinem/rust-cache@v2

      - name: Rustfmt
        run: cargo fmt --check

      - name: Clippy (default features)
        run: cargo clippy --tests -- -D warnings -A unknown-lints

      - name: Clippy (all features)
        run: cargo clippy --all-features --tests -- -D warnings -A unknown-lints
        env:
          RUSTFLAGS: --cfg reqwest_unstable

      - name: Clippy (native-tls only)
        run: cargo clippy --no-default-features --features=native-tls,online-tests --tests -- -D warnings -A unknown-lints


================================================
FILE: .github/workflows/release.yaml
================================================
name: release

on:
  push:
    tags: [v*.*.*]

jobs:
  test:
    name: Test
    runs-on: ${{ matrix.job.os }}
    timeout-minutes: 15
    strategy:
      matrix:
        job:
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
            flags: --features=native-tls
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
            flags: --no-default-features --features=native-tls,online-tests # disables rustls
          - target: x86_64-apple-darwin
            os: macos-15-intel
            flags: --features=native-tls
          - target: aarch64-apple-darwin
            os: macos-latest
            flags: --features=native-tls
          - target: x86_64-pc-windows-msvc
            os: windows-latest
            flags: --features=native-tls
          - target: x86_64-unknown-linux-musl
            os: ubuntu-latest
            use-cross: true
          - target: aarch64-unknown-linux-musl
            os: ubuntu-latest
            use-cross: true
            flags: -- --test-threads=4
          - target: arm-unknown-linux-gnueabihf
            os: ubuntu-latest
            use-cross: true
            flags: -- --test-threads=4
    steps:
      - uses: actions/checkout@v4

      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: 1.85.0 # minimum supported rust version
          targets: ${{ matrix.job.target }}

      - uses: ClementTsang/cargo-action@v0.0.6
        with:
          use-cross: ${{ !!matrix.job.use-cross }}
          command: test
          args: --target ${{ matrix.job.target }} ${{ matrix.job.flags }}

  deploy:
    name: Deploy
    needs: [test]
    runs-on: ${{ matrix.job.os }}
    strategy:
      matrix:
        job:
          - os: ubuntu-latest
            target: aarch64-unknown-linux-musl
            binutils: aarch64-linux-gnu
            use-cross: true
          - os: ubuntu-latest
            target: arm-unknown-linux-gnueabihf
            binutils: arm-linux-gnueabihf
            use-cross: true
          - os: ubuntu-latest
            target: x86_64-unknown-linux-musl
            use-cross: true
          - os: macos-15-intel
            target: x86_64-apple-darwin
            flags: --features=native-tls
          - os: macos-latest
            target: aarch64-apple-darwin
            flags: --features=native-tls
          - os: windows-latest
            target: x86_64-pc-windows-msvc
            flags: --features=native-tls
            rustflags: -C target-feature=+crt-static
    steps:
      - uses: actions/checkout@v4

      - name: Set RUSTFLAGS env variable
        if: matrix.job.rustflags
        shell: bash
        run: echo "RUSTFLAGS=${{ matrix.job.rustflags }}" >> $GITHUB_ENV

      - name: Build target
        uses: ClementTsang/cargo-action@v0.0.6
        with:
          use-cross: ${{ !!matrix.job.use-cross }}
          command: build
          args: --release --target ${{ matrix.job.target }} ${{ matrix.job.flags }}
        env:
          CARGO_PROFILE_RELEASE_LTO: true

      - name: Strip release binary (linux and macOS)
        if: matrix.job.os != 'windows-latest'
        run: |
          if [ "${{ matrix.job.binutils }}" != "" ]; then
            sudo apt update
            sudo apt -y install "binutils-${{ matrix.job.binutils }}"
            "${{ matrix.job.binutils }}-strip" "target/${{ matrix.job.target }}/release/xh"
          else
            strip "target/${{ matrix.job.target }}/release/xh"
          fi

      - name: Package
        shell: bash
        run: |
          if [ "${{ matrix.job.os }}" = "windows-latest" ]; then
            bin="target/${{ matrix.job.target }}/release/xh.exe"
          else
            bin="target/${{ matrix.job.target }}/release/xh"
          fi
          staging="xh-${{ github.ref_name }}-${{ matrix.job.target }}"

          mkdir -p "$staging"/{doc,completions}
          cp LICENSE README.md $bin $staging
          cp CHANGELOG.md doc/xh.1 "$staging"/doc
          cp completions/* "$staging"/completions

          if [ "${{ matrix.job.os }}" = "windows-latest" ]; then
            7z a "$staging.zip" $staging
          elif [[ "${{ matrix.job.os }}" =~ "macos" ]]; then
            gtar czvf "$staging.tar.gz" $staging
          else
            tar czvf "$staging.tar.gz" $staging
          fi

      - name: Package (debian)
        if: matrix.job.target == 'x86_64-unknown-linux-musl'
        shell: bash
        run: |
          cargo install --git https://github.com/blyxxyz/cargo-deb --locked --branch xh-patches cargo-deb
          cargo deb --no-build --target ${{ matrix.job.target }}
          cp "target/${{ matrix.job.target }}/debian"/*.deb ./

      - name: Publish
        uses: softprops/action-gh-release@v1
        with:
          files: "xh*"
          draft: true
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


================================================
FILE: .gitignore
================================================
/.direnv
/.envrc
/target
/.vscode
.DS_Store


================================================
FILE: CHANGELOG.md
================================================
## Unreleased
### Features
- Pretty-print XML responses, see #450 (@o1x3)
- Add experimental HTTP message signatures (RFC 9421) support, see #448 (@zuisong)

### Other
- Upgrade to reqwest v0.13, see #441 (@ducaale)

## [0.25.3] - 2025-12-16
### Features
- Add colors to `--help`/`-h`, see #432 (@starsep)

### Bug fixes
- Don't fail on error code 416 if resuming download, see #434 (@simonomi)

### Other
- Upgrade brotli to latest version, see #438 (@ducaale)

## [0.25.0] - 2025-09-19
### Features
- Add `--unix-socket` for calling Unix Domain Sockets, see #427 (@ducaale)
- Support binding to interface name on macOS, see #421 (@ducaale)
- Add experimental HTTP/3 support, see #425 (@ducaale)

## [0.24.1] - 2025-05-02
### Features
- Support RFC 5987 encoding for Content-Disposition filenames, see #416 (@zuisong)

### Bug fixes
- Fix crash on empty zstd response body, see #411 (@blyxxyz)

### Other
- Improve rustls errors for invalid certificates, see #413 (@blyxxyz)

## [0.24.0] - 2025-02-18
### Features
- Add `--generate` option to generate the man page and shell completions at runtime,
  see #393 (@fgimian)
- Add support for Elvish and Nushell shell completions, see #393 (@fgimian)
- Add `--compress` for compressing request body, see #403 (@zuisong)

### Bug fixes
- Store default paths for cookies without an explicit path attribute,
  see #401 (@otaconix)

### Other
- Support generating man page with reproducible timestamp via `SOURCE_DATE_EPOCH`,
  see #402 (@nc7s)
- Upgrade cookie_store to 0.21.1, see #397 (@kranurag7)

## [0.23.1] - 2025-01-02
### Security fixes
- Upgrade to ruzstd v0.7.3 to fix RUSTSEC-2024-0400, see #396 (@zuisong)

### Bug fixes
- Warn on combination of `--continue` and `Range` header, #394 (@blyxxyz)

### Other
- Enable logging in `rustls` and `tracing`-using dependencies, see #390 (@blyxxyz)

## [0.23.0] - 2024-10-12
### Features
- Handle responses compressed in zstd format, see #364 (@zuisong)
- Suppress warnings when `-qq` flag is used, see #371 (@blyxxyz)
- Add `--debug` option for logging and backtraces, see #371 (@blyxxyz)
- Decode `content-disposition` and `location` headers as UTF-8, see #375 (@zuisong)
- Print headers as latin1, with the UTF-8 decoding also shown if applicable,
  see #377 (@blyxxyz)
- Print the actual reason phrase sent by the server instead of guessing it from
  the status code, see #377 (@blyxxyz)

### Bug fixes
- Apply TLS options to non-HTTPS URLs, see #372 (@blyxxyz)

### Other
- Ignore `NO_COLOR` if set to empty string, see #370 (@blyxxyz)

## [0.22.2] - 2024-07-08
### Security fixes
- Prevent directory traversal in server-supplied filenames, see #379 (@blyxxyz)

## [0.22.0] - 2024-04-13
### Features
- Support http2-prior-knowledge, see #356 (@zuisong)
- Directly bind to interface name on supported platforms, see #359 (@ducaale)
- Enable stream when content-type is `text/event-stream`, see #360 (@zuisong)
- Decode utf-8 encoded string when formatting non-streaming JSON response,
  see #361 (@zuisong)

### Other
- Upgrade to hyper v1, see #357 (@zuisong)
- Use `serde-transcode` to optimize JSON formatting, see #362 (@blyxxyz)

## [0.21.0] - 2024-01-28
### Features
- Display remote address in metadata when `-vv` or `--meta` flag is used,
  see #348 (@zuisong)

### Other
- Default `XH_CONFIG_DIR` to `~/.config/xh` in macOS, see #353 (@ducaale)

## [0.20.1] - 2023-11-19
### Features
- Add `--resolve` for overriding DNS resolution, see #327 (@ducaale)

## [0.19.4] - 2023-10-22
### Other
- Explicitly enable serde's derive feature, see #334 (@jayvdb)

## [0.19.3] - 2023-10-21
### Other
- Make `network-interface` an optional dependency, see #332 (@blyxxyz)

## [0.19.2] - 2023-10-21
### Features
- Add `--interface` for binding to a local IP address or interface, see #307 (@ducaale)
- Translate `--raw` flag when using `--curl`, see #308 (@ducaale)
- Support duplicate header keys in session files, see #313 (@ducaale)
- Support persisting cookies from multiple domains, see #314 (@ducaale)
- Control output formatting (JSON indent-level, header sorting, etc)
  via `--format-options`, see #318 (@Bnyro) and #319 (@ducaale)

### Bug fixes
- Disable cURL's URL globbing, see #325 (@ducaale)
- Improve PATH handling in `install.ps1`, see #264 (@henno)

### Other
- Update Rustls to v0.21.0, see #311 (@ducaale)

## [0.18.0] - 2023-02-20
### Features
- Support reading query param and header values from a file, see #288 (@ducaale)
- Highlight Syntax errors found while tokenizing a JSON path, see #260 (@ducaale)
- Support outputting the metadata of a response via `--meta`, `--print=m` or `-vv`,
  see #240 (@ducaale)

### Bug fixes
- Fix panic when when parsing connection timeout, see #295 (@sorairolake)

### Breaking changes
- Remove `-m` as a short flag for `--multipart`, see #299 (@ducaale)

## [0.17.0] - 2022-11-08
### Features
- Add support for nested json syntax, see #217 (@ducaale)
- Add Support for bearer auth in `.netrc`, see #267 (@porglezomp)
- Support forcing ipv4/ipv6, see #276 (@zuisong)

### Other
- Allow building xh using native-tls only, see #281 (@jirutka)
- Warn users when translating `--follow` + non GET method, see #280 (@jgoday)

## [0.16.1] - 2022-05-22
### Bug fixes
- fix HEAD request failing on compressed response, see #257 (@ducaale)

### Other
- Configurable install dir for `install.sh` via `XH_BINDIR` env variable,
  see #256 (@lispyclouds)
- Use exit status 2 and 6 for `request timeout` and `too many redirects` errors
  respectively, see #258 (@sorairolake)

## [0.16.0] - 2022-04-17
### Features
- Add support for URLs with leading `://` to allow quick conversion of
  pasted URLs into HTTPie/xh command e.g `http://httpbin.org/json` →
  `$ http ://httpbin.org/json`, see #232 (@ducaale)
- Support sending multiple request headers with the same key, see #242 (@ducaale)

### Bug fixes
- Don't remove `content-encoding` and `content-length` headers while processing
  gzip/deflate/brotli encoded responses, see #241 (@ducaale)

### Other
- Replace structopt with clap3.x, see #216 (@ducaale) and #235 (@blyxxyz)
- Improve output coloring performance by switching to incremental highlighting,
  see #228 (@blyxxyz)
- Faster `--stream` output formatting by switching to full buffering and manual
  flushing, see #233 (@blyxxyz) 
- Automate the generation of negation flags, see #234 (@blyxxyz)
- Display download's elapsed time as seconds, see #236 (@ducaale)

## [0.15.0] - 2022-01-27
### Features
- Add support for `--raw` flag, see #202 (@ducaale)
- Add Fruity theme, see #206 (@ducaale)
- Use a custom netrc parser that supports comments and is more faithful
  to HTTPie, see #207 (@blyxxyz)
- Add browser-style text encoding detection, see #203 (@blyxxyz)
- Enable using OS certificate store with rustls, see #225 (@austinbutler)
- Improve quoting and update options from `--curl`, see #200 (@blyxxyz)

### Bug fixes
- Expand tilde in request items that contain a path, see #209 (@ducaale)
- Get version from `-V` when generating manpages, see #214 (@ducaale)

### Other
- Statically link C-runtime for MSVC Windows, see #221 (@ducaale)
- Add `install.ps1` for Windows, see #220 (@ChrisK-0)
- Add aarch64 support, see #213 (@myhro)

## [0.14.1] - 2021-11-26
### Bug fixes
- Do not print response body unconditionally, see #197 (@blyxxyz)

### Other
- Do not rebuild when no syntax or theme file has changed, see #194 (@blyxxyz)
- Remove curl from `dev-dependencies` by replacing httpmock with hyper, see #190 (@ducaale)

## [0.14.0] - 2021-11-15
### Features
- Add `--http-version` for forcing a specific http version, see #161 (@ducaale)
- Support overwriting response's mime and charset via `--response-mime` and `--response-charset`
  respectively, see #184 (@ducaale)
- Add support for digest authentication, see #176 (@ducaale)
- Add `--ssl` option for forcing a specific TLS version, see #168 (@blyxxyz)

### Bug fixes
- Preserve case of `--verify` path, see #181 (@blyxxyz)

### Other
- Enable LTO on the release profile, see #177 (@sorairolake)
- Replace `lazy_static` with `once_cell`, see #187 (@sorairolake)
- Include enabled features in `--version` flag's output, see #188 and #191 (@sorairolake)
- Support displaying units smaller than a second in download result, see #192 (@sorairolake)
- Change to use binary prefix in `--download`, see #193 (@sorairolake)

## [0.13.0] - 2021-09-16
### Features
- Add `--all` flag for printing intermediate requests and responses, see #137 (@ducaale)
- Support customising what sections are printed from intermediary requests and responses
  via the `--history-print` flag, see #137 (@ducaale)

### Bug fixes
- Apply header title case for consecutive dashes, see #170 (@blyxxyz)
- Avoid printing unnecessary line separators when `--all` flag is used, see #174 (@ducaale)

### Other
- Include Debian package in release artifacts, see #172 (@ducaale)

## [0.12.0] - 2021-08-06
### Features
- Add support for HTTPie's [Sessions](https://httpie.io/docs#sessions), see #125 (@ducaale)
- Send and display headers names as title case for non-HTTP/2 requests and responses, see #167 (@blyxxyz)
- Support using the system's TLS library via `--native-tls` flag, see #154 (@blyxxyz)
- Support reading args from a config file, see #165 (@ducaale)

## [0.11.0] - 2021-07-26
### Features
- Support `REQUESTS_CA_BUNDLE` & `CURL_CA_BUNDLE` env variables, see #146 (@ducaale)
- Enable color and wrapping for `--help`, see #151 (@QuarticCat)
- Add monokai theme, #157 (@ducaale)
- handle responses compressed in deflate format, see #158 (@ducaale)
- Support setting the filename for multipart uploads, see #164 (@blyxxyz)

### Bug fixes
- Do not hardcode `/tmp` in the install script, see #149 (@blyxxyz)

### Other
- Re-enable HTTP/2 adaptive window, see #150 (@blyxxyz)

### Breaking changes
- `--check-status` is now on by default. You can opt-out of this change by enabling xh's
  [strict compatibility mode](https://github.com/ducaale/xh#strict-compatibility-mode),
  see #155 (@ducaale)

## [0.10.0] - 2021-05-17
### Features
- Support reading DataField and JsonField value from a file, see #118 (@ducaale)
- Add percentage of progress to download progress bar, see #119 (@sorairolake)
- Add the timeout flag, see #131 (@sorairolake)
- Support installation via a shell script, see #122 (@ducaale)
- Support reading request body from file, see #140 (@blyxxyz)

### Bug fixes
- Fix progress bar ETA when resuming download, see #116 (@blyxxyz)
- Replace `deflate` in Accept-Encoding to `br`, see #128 (@sorairolake)
- Set Accept-Encoding to `identity` in download mode, see #130 (@sorairolake)
- Replace HTTP/2 adaptive window by fixed window to prevent crashes, see #138 (@blyxxyz)
- Fix a bug where same file cannot be re-downloaded, see #139 (@ducaale)
- Enforce accept-encoding to be `identity` in download mode, see #141 (@ducaale)

### Other
- Unvendor jsonxf, see #124 (@blyxxyz)
- Add config file for clippy, see #123 (@sorairolake)

## [0.9.2] - 2021-03-24
### Bug fixes
- Escape backslash in JSON highlighting definition, see #108 (@blyxxyz)
- Do not require filenames to be valid unicode, see #112 (@blyxxyz)
- Preserve the order of JSON keys in requests, see #113 (@ducaale)
- Keep bar coloring consistent with other colored output
  (e.g. don't color it if $NO_COLOR is set), see #114 (@blyxxyz)
- Prevent mitsuhiko/indicatif#144 in narrow terminals, see #114 (@blyxxyz)

### Other
- JSON records are now separated by double newlines, see #109 (@blyxxyz)
- Writing to a redirect or a file now doesn't stream unless you use --stream, like HTTPie,
  and it properly decodes the response when it needs to, see #111 (@blyxxyz)
- Writing formatted JSON to a file is now significantly faster, see #111 (@blyxxyz)
- Use adaptive window for HTTP/2, see #115 (@blyxxyz)

## [0.9.1] - 2021-03-16
### Bug fixes
- Don't include the `--verify` flag in usage when it is not used, see #100 (@ducaale)
- Don't color progress indicators when color is disabled, see #103 (@ducaale)

### Other
- JSON requests coloring is now twice as fast, see #96 (@blyxxyz)
- Unify flags and options in help, see #100 (@ducaale)
- Replace ansi_term by termcolor for better Windows support, see #105 (@blyxxyz)

## [0.9.0] - 2021-03-08
### Features
- Add `--no-FLAG` variants of flags. This is useful for disabling any flags you might have in your
  alias, see #86 (@blyxxyz)
- Support non-standard HTTP methods, see #89 (@blyxxyz)
- Add support for getting credentials from .netrc plus a `--ignore-netrc` flag to disable that
  functionality, see #87 (@dwink)

## [0.8.1] - 2021-03-01
### Features
- Highlight Javascript and CSS, see #82 (@blyxxyz)
- Check if text is actually JSON before formatting it, see #82 (@blyxxyz)
- Default to a content-type of application/json when reading a body from stdin, see #82 (@blyxxyz)

## [0.8.0] - 2021-02-28
### Features
- More robust detection of the method and URL arguments, see #55 (@blyxxyz)
- Improvements to the generation downloaded filenames, see #56 (@blyxxyz)
- `--continue` now works for resuming downloads. It was incomplete before, see #59 (@blyxxyz)
- `--check-status` is supported, and is automatically active for downloads
  (so you don't download error pages), see #59 (@blyxxyz)
- Add the `--proxy` option, see #62 (@otaconix)
- Add `--bearer` flag for Bearer Authentication and remove `--auth-type`, see #64 (@blyxxyz)
- Add support for manpages, see #64 (@blyxxyz)
- Add _help_ subcommand for printing long help and update `--help` to print short help, see #64 (@blyxxyz)
- Support escaping characters in request items with backslash, see #66 (@blyxxyz)
- Add support for `--verify` to skip the host’s SSL certificate verification, see #44 (@jihchi, @otaconix)
- Add support for `--cert/cert-key` for using client side certificate for the SSL communication, see #44 (@jihchi, @otaconix)
- Add `--curl` flag to print equivalent curl command, see #69 (@blyxxyz)
- Replace `--default-scheme` by `--https`. `--default-scheme` is still kept as an undocumented flag, see #73 (@blyxxyz)
- If `xh` is invoked as `xhs`, `https`, or `xhttps`, run as if `--https` was used, see #73 (@blyxxyz)
- Support `NO_COLOR` environment variable to turn colors off by default, see #73 (@blyxxyz)
- Make `--json`/`--form`/`--multipart` override each other and force content-type. If you use multiple of those flags,
  all but the last will be ignored. And if you use them without request items the appropriate headers will still be set,
  see #73 (@blyxxyz)
- Try to detect undeclared JSON response bodies: If the response is javascript or plain text,
  check if it's JSON, see #73 (@blyxxyz)
- Add shell autocompletion generation, see #76 (@blyxxyz)

### Other
- Make structopt usage more consistent, see #67 (@blyxxyz)
- Remove use of async, make --stream work consistently, see #41 (@blyxxyz)
- Introduce clippy and fmt in CI, see #75 (@ducaale)

## [0.7.0] - 2021-02-12
### Features
- Follow redirects if downloading a file, see #51 (@blyxxyz)
- Allow form value regex to match newlines, see #46 (@blyxxyz)
- Adds --headers option, see #42 (@sanpii)

### Other
- Rename ht binary to xh

## [0.6.0] - 2021-02-08
### Features
- Add support for OPTIONS HTTP method, see #17 (@plombard)
- Add `--body` flag for printing only response body, see #38 (@idanski)
- Add content length to file upload stream, see #32 (@blyxxyz)
- Include User-Agent header in outgoing requests, see #33 (@blyxxyz)

### Other
- Ensure filename from `content-disposition` doesn't overwrite existing files,
  isn't a hidden file, or doesn't end up outside the current directory,
  see #37 (@blyxxyz)
- Bubble errors up to main() instead of panicking see #37 (@blyxxyz)

## [0.5.0] - 2021-02-07
### Features
- Add support for HEAD requests, see #16 (@Till--H)
- Support setting the content-type for files in multipart requests e.g
  `ht httpbin.org/post --multipart pic@cat.png;type=image/png`
- Add `--follow` and `--max-redirects` for configuring redirect behaviour, see #19 (@Till--H)

### Bug fixes
- Render white text as the default foreground color, see #21 (@blyxxyz)
- Don't insert lines when streaming json.
- Do not explicitly add `Host` header, see #26 (@blyxxyz)

### Other
- Init parsing regex for RequestItem once, see #22 (@jRimbault)

## [0.4.0] - 2021-02-06
### Features
- Support streaming responses. This on by default for unformatted responses and can also
  be enabled via the `--stream` flag

## [0.3.5] - 2021-01-31
### Features
- Support output redirection for downloads e.g `ht -d httpbin.org/json > temp.json`

### Other
- Upgrade to Tokio 1.x.


================================================
FILE: Cargo.toml
================================================
[package]
name = "xh"
version = "0.25.3"
authors = ["ducaale <sharaf.13@hotmail.com>"]
edition = "2024"
rust-version = "1.85.0"
license = "MIT"
description = "Friendly and fast tool for sending HTTP requests"
documentation = "https://github.com/ducaale/xh"
homepage = "https://github.com/ducaale/xh"
repository = "https://github.com/ducaale/xh"
readme = "README.md"
keywords = ["http"]
categories = ["command-line-utilities"]
exclude = ["assets/xhs", "assets/xhs.1.gz"]

[dependencies]
anyhow = "1.0.38"
brotli = { version = "8", default-features = false, features = ["std"] }
chardetng = "0.1.15"
clap = { version = "4.4", features = ["derive", "wrap_help", "string"] }
clap_complete = "4.4"
clap_complete_nushell = "4.4"
cookie_store = { version = "0.22.0", features = ["preserve_order"] }
digest_auth = "0.3.0"
dirs = "6.0"
encoding_rs = "0.8.28"
encoding_rs_io = "0.1.7"
flate2 = "1.0.22"
# Add "tracing" feature to hyper once it stabilizes
hyper = { version = "1.2", default-features = false }
indicatif = "0.18"
jsonxf = "1.1.0"
memchr = "2.4.1"
mime = "0.3.16"
mime2ext = "0.1.0"
mime_guess = "2.0"
os_display = "0.1.3"
pem = "3.0"
regex-lite = "0.1.5"
reqwest_cookie_store = "0.10.0"
roff = "0.2.1"
rpassword = "7.2.0"
serde = { version = "1.0", features = ["derive"] }
serde-transcode = "1.1.1"
serde_json = { version = "1.0", features = ["preserve_order"] }
serde_urlencoded = "0.7.0"
supports-hyperlinks = "3.0.0"
termcolor = "1.1.2"
time = "0.3.16"
humantime = "2.2.0"
unicode-width = "0.1.9"
url = "2.2.2"
ruzstd = { version = "0.7", default-features = false, features = ["std"] }
env_logger = { version = "0.11.3", default-features = false, features = ["color", "auto-color", "humantime"] }
log = "0.4.21"
base64 = "0.22.1"
form_urlencoded = "1.0.1"
httpsig-hyper = { version = "0.0.24", optional = true, default-features = false, features = ["blocking", "rsa-signature"] }
sha2 = { version = "0.10", optional = true, default-features = false }

# Enable logging in transitive dependencies.
# The rustls version number should be kept in sync with hyper/reqwest.
rustls = { version = "0.23.25", optional = true, default-features = false, features = ["logging"] }
tracing = { version = "0.1.41", default-features = false, features = ["log"] }
percent-encoding = "2.3.1"
sanitize-filename = "0.6.0"
quick-xml = "0.38"

[dependencies.reqwest]
version = "0.13.2"
default-features = false
features = ["json", "form", "multipart", "blocking", "socks", "cookies", "http2", "system-proxy"]

[dependencies.syntect]
version = "5.1"
default-features = false
features = ["parsing", "dump-load", "regex-onig"]

[target.'cfg(not(any(target_os = "android", target_os = "fuchsia", target_os = "illumos", target_os = "ios", target_os = "linux", target_os = "macos", target_os = "solaris", target_os = "tvos", target_os = "visionos", target_os = "watchos")))'.dependencies]
network-interface = { version = "1.0.0", optional = true }

[build-dependencies.syntect]
version = "5.1"
default-features = false
features = ["dump-create", "plist-load", "regex-onig", "yaml-load"]

[dev-dependencies]
assert_cmd = "2.0.8"
indoc = "2.0"
rand = "0.8.3"
predicates = "3.0"
hyper = { version = "1.2", features = ["server"] }
tokio = { version = "1", features = ["rt", "sync", "time"] }
tempfile = "3.2.0"
hyper-util = { version = "0.1.3", features = ["server"] }
http-body-util = "0.1.1"

[features]
default = ["online-tests", "rustls", "network-interface"]
native-tls = ["reqwest/native-tls"]
rustls = ["reqwest/rustls", "dep:rustls"]
http3 = ["reqwest/http3"]
http-message-signatures = ["dep:httpsig-hyper", "dep:sha2"]

# To be used by platforms that don't support binding to interface via SO_BINDTODEVICE
# Ideally, this would be auto-disabled on platforms that don't need it
# However: https://github.com/rust-lang/cargo/issues/1197
# Also, see https://github.com/ducaale/xh/issues/330
network-interface = ["dep:network-interface"]

online-tests = []
ipv6-tests = []

[package.metadata.cross.build.env]
passthrough = ["CARGO_PROFILE_RELEASE_LTO"]

[package.metadata.deb]
features = []
section = "web"
license-file = "LICENSE"
preserve-symlinks = true
assets = [
  ["target/release/xh", "usr/bin/", "755"],
  ["assets/xhs", "usr/bin/", "777"],
  ["CHANGELOG.md", "usr/share/doc/xh/NEWS", "644"],
  ["README.md", "usr/share/doc/xh/README", "644"],
  ["doc/xh.1", "usr/share/man/man1/xh.1", "644"],
  ["assets/xhs.1.gz", "usr/share/man/man1/xhs.1.gz", "777"],
  ["completions/xh.bash", "usr/share/bash-completion/completions/xh", "644"],
  ["completions/xh.fish", "usr/share/fish/vendor_completions.d/xh.fish", "644"],
  ["completions/_xh", "usr/share/zsh/vendor-completions/", "644"],
]
extended-description = """\
xh is a friendly and fast tool for sending HTTP requests.
It reimplements as much as possible of HTTPie's excellent design, with a focus
on improved performance.
"""


================================================
FILE: FAQ.md
================================================
<h3 name="header-value-encoding">Why do some HTTP headers show up mangled?</h3>

HTTP header values are officially only supposed to contain ASCII. Other bytes are "opaque data":

> Historically, HTTP has allowed field content with text in the ISO-8859-1 charset [[ISO-8859-1](https://datatracker.ietf.org/doc/html/rfc7230#ref-ISO-8859-1)], supporting other charsets only through use of [[RFC2047](https://datatracker.ietf.org/doc/html/rfc2047)] encoding.  In practice, most HTTP header field values use only a subset of the US-ASCII charset [[USASCII](https://datatracker.ietf.org/doc/html/rfc7230#ref-USASCII)].  Newly defined header fields SHOULD limit their field values to US-ASCII octets.  A recipient SHOULD treat other octets in field content (obs-text) as opaque data.

([RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4))

In practice some headers are for some purposes treated like UTF-8, which supports all languages and characters in Unicode. But if you try to access header values through a browser's `fetch()` API or view them in the developer tools then they tend to be decoded as ISO-8859-1, which only supports a very limited number of characters and may not be the actual intended encoding.

xh as of version 0.23.0 shows the ISO-8859-1 decoding by default to avoid a confusing difference with web browsers. If the value looks like valid UTF-8 then it additionally shows the UTF-8 decoding.

That is, the following request:
```console
xh -v https://example.org Smile:☺
```
Displays the `Smile` header like this:
```
Smile: â�º (UTF-8: ☺)
```
The server will probably see `â�º` instead of the smiley. Or it might see `☺` after all. It depends!


================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2021 Mohamed Daahir

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
# xh
[![Version info](https://img.shields.io/crates/v/xh.svg)](https://crates.io/crates/xh)
[![Packaging status](https://repology.org/badge/tiny-repos/xh.svg)](https://repology.org/project/xh/versions)

`xh` is a friendly and fast tool for sending HTTP requests. It reimplements as much
as possible of [HTTPie's](https://httpie.io/) excellent design, with a focus
on improved performance.

[![asciicast](/assets/xh-demo.gif)](https://asciinema.org/a/475190)

## Installation

### via cURL (Linux & macOS)

```
curl -sfL https://raw.githubusercontent.com/ducaale/xh/master/install.sh | sh
```

### via Powershell (Windows)

```
iwr -useb https://raw.githubusercontent.com/ducaale/xh/master/install.ps1 | iex
```


### via a package manager

| OS                            | Method     | Command                                    |
|-------------------------------|------------|--------------------------------------------|
| Any                           | Cargo\*    | `cargo install xh --locked`                |
| Any                           | [Huber]    | `huber install xh`                         |
| Android ([Termux])            | pkg        | `pkg install xh`                           |
| Android ([Magisk]/[KernelSU]) | MMRL\*\*   | `mmrl install xhhttp`                      |
| Alpine Linux                  | apk\*\*\*  | `apk add xh`                               |
| Arch Linux                    | Pacman     | `pacman -S xh`                             |
| Debian & Ubuntu               | Apt\*\*\*\*| `sudo apt install xh`                      |
| FreeBSD                       | FreshPorts | `pkg install xh`                           |
| NetBSD                        | pkgsrc     | `pkgin install xh`                         |
| Linux & macOS                 | Nixpkgs    | `nix-env -iA nixpkgs.xh`                   |
| Linux & macOS                 | [Flox]     | `flox install xh`                          |
| Linux & macOS                 | Homebrew   | `brew install xh`                          |
| Linux & macOS                 | [Hermit]   | `hermit install xh`                        |
| macOS                         | MacPorts   | `sudo port install xh`                     |
| Windows                       | Scoop      | `scoop install xh`                         |
| Windows                       | Chocolatey | `choco install xh`                         |
| Windows                       | Winget     | `winget add ducaale.xh`                    |

\* Make sure that you have Rust 1.85 or later installed

\*\* You will need to install the [MMRL CLI](https://github.com/DerGoogler/MMRL-CLI/releases)

\*\*\* Built with native-tls only.

\*\*\*\* Available since Debian 13 and Ubuntu 25.04. Built with native-tls only.

[Huber]: https://github.com/innobead/huber#installing-huber
[Magisk]: https://github.com/topjohnwu/Magisk
[KernelSU]: https://kernelsu.org
[Termux]: https://github.com/termux/termux-app
[Flox]: https://flox.dev/docs/
[Hermit]: https://cashapp.github.io/hermit/

### via pre-built binaries
The [release page](https://github.com/ducaale/xh/releases) contains prebuilt binaries for Linux, macOS and Windows.

## Usage
```
Usage: xh [OPTIONS] <[METHOD] URL> [REQUEST_ITEM]...

Arguments:
  <[METHOD] URL>     The request URL, preceded by an optional HTTP method
  [REQUEST_ITEM]...  Optional key-value pairs to be included in the request.

Options:
  -j, --json                             (default) Serialize data items from the command line as a JSON object
  -f, --form                             Serialize data items from the command line as form fields
      --multipart                        Like --form, but force a multipart/form-data request even without files
      --raw <RAW>                        Pass raw request data without extra processing
      --pretty <STYLE>                   Controls output processing [possible values: all, colors, format, none]
      --format-options <FORMAT_OPTIONS>  Set output formatting options
  -s, --style <THEME>                    Output coloring style [possible values: auto, solarized, monokai, fruity]
      --response-charset <ENCODING>      Override the response encoding for terminal display purposes
      --response-mime <MIME_TYPE>        Override the response mime type for coloring and formatting for the terminal
  -p, --print <FORMAT>                   String specifying what the output should contain
  -h, --headers                          Print only the response headers. Shortcut for --print=h
  -b, --body                             Print only the response body. Shortcut for --print=b
  -m, --meta                             Print only the response metadata. Shortcut for --print=m
  -v, --verbose...                       Print the whole request as well as the response
      --debug                            Print full error stack traces and debug log messages
      --all                              Show any intermediary requests/responses while following redirects with --follow
  -P, --history-print <FORMAT>           The same as --print but applies only to intermediary requests/responses
  -q, --quiet...                         Do not print to stdout or stderr
  -S, --stream                           Always stream the response body
  -x, --compress...                      Content compressed (encoded) with Deflate algorithm
  -o, --output <FILE>                    Save output to FILE instead of stdout
  -d, --download                         Download the body to a file instead of printing it
  -c, --continue                         Resume an interrupted download. Requires --download and --output
      --session <FILE>                   Create, or reuse and update a session
      --session-read-only <FILE>         Create or read a session without updating it from the request/response exchange
  -A, --auth-type <AUTH_TYPE>            Specify the auth mechanism [possible values: basic, bearer, digest]
  -a, --auth <USER[:PASS] | TOKEN>       Authenticate as USER with PASS (-A basic|digest) or with TOKEN (-A bearer)
      --ignore-netrc                     Do not use credentials from .netrc
      --offline                          Construct HTTP requests without sending them anywhere
      --check-status                     (default) Exit with an error status code if the server replies with an error
  -F, --follow                           Do follow redirects
      --max-redirects <NUM>              Number of redirects to follow. Only respected if --follow is used
      --timeout <SEC>                    Connection timeout of the request
      --proxy <PROTOCOL:URL>             Use a proxy for a protocol. For example: --proxy https:http://proxy.host:8080
      --verify <VERIFY>                  If "no", skip SSL verification. If a file path, use it as a CA bundle
      --cert <FILE>                      Use a client side certificate for SSL
      --cert-key <FILE>                  A private key file to use with --cert
      --ssl <VERSION>                    Force a particular TLS version [possible values: auto, tls1, tls1.1, tls1.2, tls1.3]
      --https                            Make HTTPS requests if not specified in the URL
      --http-version <VERSION>           HTTP version to use [possible values: 1.0, 1.1, 2, 2-prior-knowledge, 3-prior-knowledge]
      --resolve <HOST:ADDRESS>           Override DNS resolution for specific domain to a custom IP
      --interface <NAME>                 Bind to a network interface or local IP address
  -4, --ipv4                             Resolve hostname to ipv4 addresses only
  -6, --ipv6                             Resolve hostname to ipv6 addresses only
      --unix-socket <FILE>               Connect using a Unix domain socket
  -I, --ignore-stdin                     Do not attempt to read stdin
      --curl                             Print a translation to a curl command
      --curl-long                        Use the long versions of curl's flags
      --generate <KIND>                  Generate shell completions or man pages
      --help                             Print help
  -V, --version                          Print version

Each option can be reset with a --no-OPTION argument.
```

Run `xh help` for more detailed information.

### Request Items

`xh` uses [HTTPie's request-item syntax](https://httpie.io/docs/cli/request-items) to set headers, request body, query string, etc.

- `=`/`:=` for setting the request body's JSON or form fields (`=` for strings and `:=` for other JSON types).
- `==` for adding query strings.
- `@` for including files in multipart requests e.g `picture@hello.jpg` or `picture@hello.jpg;type=image/jpeg;filename=goodbye.jpg`.
- `:` for adding or removing headers e.g `connection:keep-alive` or `connection:`.
- `;` for including headers with empty values e.g `header-without-value;`.

An `@` prefix can be used to read a value from a file. For example: `x-api-key:@api-key.txt`.

The request body can also be read from standard input, or from a file using `@filename`.

To construct a complex JSON object, a JSON path can be used as a key e.g `app[container][0][id]=090-5`.
For more information on this syntax, refer to https://httpie.io/docs/cli/nested-json.

### Shorthand form for URLs

Similar to HTTPie, specifying the scheme portion of the request URL is optional, and a leading colon works as shorthand
for localhost. `:8000` is equivalent to `localhost:8000`, and `:/path` is equivalent to `localhost/path`.

URLs can have a leading `://` which allows quickly converting a URL into a valid xh or HTTPie command. For example
`http://httpbin.org/json` becomes `http ://httpbin.org/json`.


```sh
xh http://localhost:3000/users # resolves to http://localhost:3000/users
xh localhost:3000/users        # resolves to http://localhost:3000/users
xh :3000/users                 # resolves to http://localhost:3000/users
xh :/users                     # resolves to http://localhost:80/users
xh example.com                 # resolves to http://example.com
xh ://example.com              # resolves to http://example.com
```

### Making HTTPS requests by default

`xh` will default to HTTPS scheme if the binary name is one of `xhs`, `https`, or `xhttps`. If you have installed `xh`
via a package manager, both `xh` and `xhs` should be available by default. Otherwise, you need to create one like this:

```sh
cd /path/to/xh && ln -s ./xh ./xhs
xh httpbin.org/get  # resolves to http://httpbin.org/get
xhs httpbin.org/get # resolves to https://httpbin.org/get
```

### Strict compatibility mode

If `xh` is invoked as `http` or `https` (by renaming the binary), or if the `XH_HTTPIE_COMPAT_MODE` environment variable is set,
it will run in HTTPie compatibility mode. The only current difference is that `--check-status` is not enabled by default.

## Examples

```sh
# Send a GET request
xh httpbin.org/json

# Send a POST request with body {"name": "ahmed", "age": 24}
xh httpbin.org/post name=ahmed age:=24

# Send a GET request with querystring id=5&sort=true
xh get httpbin.org/json id==5 sort==true

# Send a GET request and include a header named x-api-key with value 12345
xh get httpbin.org/json x-api-key:12345

# Send a POST request with body read from stdin.
echo "[1, 2, 3]" | xh post httpbin.org/post

# Send a PUT request and pipe the result to less
xh put httpbin.org/put id:=49 age:=25 | less

# Download and save to res.json
xh -d httpbin.org/json -o res.json

# Make a request with a custom user agent
xh httpbin.org/get user-agent:foobar
```

## How xh compares to HTTPie

### Advantages

- Improved startup speed.
- Available as a single statically linked binary that's easy to install and carry around.
- HTTP/2 support.
- Builtin translation to curl commands with the `--curl` flag.
- Short, cheatsheet-style output from `--help`. (For longer output, pass `help`.)

### Disadvantages

- Not all of HTTPie's features are implemented. ([#4](https://github.com/ducaale/xh/issues/4))
- No plugin system.
- General immaturity. HTTPie is old and well-tested.
- Worse documentation.

## Similar or related Projects

- [curlie](https://github.com/rs/curlie) - frontend to cURL that adds the ease of use of httpie
- [httpie-go](https://github.com/nojima/httpie-go) - httpie-like HTTP client written in Go
- [curl2httpie](https://github.com/dcb9/curl2httpie) - convert command arguments between cURL and HTTPie


================================================
FILE: RELEASE-CHECKLIST.md
================================================
## Release Checklist

- Update `README.md`'s Usage section with the output of `xh --help`
- Update `CHANGELOG.md` (rename unreleased header to the current date, add any missing changes).
- Run `cargo update` to update dependencies.
- Bump up the version in `Cargo.toml` and run `cargo check` to update `Cargo.lock`.
- Run the following to update shell-completion files and man pages.
  ```sh
  cargo run --features=native-tls -- --generate complete-bash > completions/xh.bash
  cargo run --features=native-tls -- --generate complete-elvish > completions/xh.elv
  cargo run --features=native-tls -- --generate complete-fish > completions/xh.fish
  cargo run --features=native-tls -- --generate complete-nushell > completions/xh.nu
  cargo run --features=native-tls -- --generate complete-powershell > completions/_xh.ps1
  cargo run --features=native-tls -- --generate complete-zsh > completions/_xh
  cargo run --features=native-tls -- --generate man > doc/xh.1
  ```
- Commit changes and push them to remote.
- Add git tag e.g `git tag v0.9.0`.
- Push the local tags to remote i.e `git push --tags` which will start the CI release action.
- Publish to crates.io by running `cargo publish`.


================================================
FILE: assets/README.md
================================================
## Syntaxes and themes used
- [Sublime-HTTP](https://github.com/samsalisbury/Sublime-HTTP)
- [json-kv](https://github.com/aurule/json-kv)
- [Sublime Packages](https://github.com/sublimehq/Packages/tree/fa6b8629c95041bf262d4c1dab95c456a0530122)
- [ansi-dark theme](https://github.com/sharkdp/bat/blob/master/assets/themes/ansi-dark.tmTheme)
- Solarized and Monokai are based on ansi-dark with color values taken from the [pygments](https://github.com/pygments/pygments) library
  - [Solarized](https://github.com/pygments/pygments/blob/master/pygments/styles/solarized.py)
  - [Monokai](https://github.com/pygments/pygments/blob/master/pygments/styles/monokai.py)
  - [Fruity](https://github.com/pygments/pygments/blob/master/pygments/styles/fruity.py)

## Tools used to create xh-demo.gif
- [asciinema](https://github.com/asciinema/asciinema) for the initial recording.
- [asciinema-edit](https://github.com/cirocosta/asciinema-edit) to speed up the recording.
- [asciicast2gif](https://github.com/asciinema/asciicast2gif) to produce the final GIF. The
  default font didn't look great so I modified it to use [Cascadia Mono](https://github.com/microsoft/cascadia-code).


================================================
FILE: assets/syntax/basic/json.sublime-syntax
================================================
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: JSON Key-Value
file_extensions:
  - json
scope: source.json
contexts:
  main:
    - match: //.*
      comment: Single-line comment
      scope: comment.single.line.jsonkv
    - match: /\*
      comment: Multi-line comment
      push:
        - meta_scope: comment.block.jsonkv
        - match: \*/
          pop: true
    - match: '(")(?i)([^\\"]+)(")\s*?:'
      comment: Key names
      captures:
        1: keyword.other.name.jsonkv.start
        2: keyword.other.name.jsonkv
        3: keyword.other.name.jsonkv.end
    - match: '"'
      comment: String values
      push:
        - meta_scope: string.quoted.jsonkv
        - match: '"'
          pop: true
        - match: '\\[tnr"]'
          comment: Escape characters
          scope: constant.character.escape.jsonkv
    - match: \d+(?:.\d+)?
      comment: Numeric values
      scope: constant.numeric.jsonkv
    - match: true|false
      comment: Boolean values
      scope: constant.language.boolean.jsonkv
    - match: "null"
      comment: Null value
      scope: constant.language.null.jsonkv


================================================
FILE: assets/syntax/large/css.sublime-syntax
================================================
%YAML 1.2
---
# Derived from https://github.com/i-akhmadullin/Sublime-CSS3
name: CSS
file_extensions:
  - css
  - css.erb
  - css.liquid
scope: source.css
variables:
  # Many variable names taken directly from https://www.w3.org/TR/css3-selectors/#lex
  unicode: '\\\h{1,6}[ \t\n\f]?'
  escape: '(?:{{unicode}}|\\[^\n\f\h])'
  nonascii: '[\p{L}\p{M}\p{S}\p{N}&&[^[:ascii:]]]'
  nmstart: '(?:[[_a-zA-Z]{{nonascii}}]|{{escape}})'
  nmchar: '(?:[[-\w]{{nonascii}}]|{{escape}})'
  ident: '(?:--{{nmchar}}+|-?{{nmstart}}{{nmchar}}*)'

  # Types
  # https://www.w3.org/TR/css3-values/#numeric-types
  integer: '(?:[-+]?\d+)'
  number: '[-+]?(?:(?:\d*\.\d+(?:[eE]{{integer}})*)|{{integer}})'

  # Units
  # https://www.w3.org/TR/css3-values/#lengths
  font_relative_lengths: '(?i:em|ex|ch|rem)'
  viewport_percentage_lengths: '(?i:vw|vh|vmin|vmax)'
  absolute_lengths: '(?i:cm|mm|q|in|pt|pc|px|fr)'
  angle_units: '(?i:deg|grad|rad|turn)'
  duration_units: '(?i:s|ms)'
  frequency_units: '(?i:Hz|kHz)'
  resolution_units: '(?i:dpi|dpcm|dppx)'

  custom_element_chars: |-
    (?x:
        [-_a-z0-9\x{00B7}]
      | \\\.
      | [\x{00C0}-\x{00D6}]
      | [\x{00D8}-\x{00F6}]
      | [\x{00F8}-\x{02FF}]
      | [\x{0300}-\x{037D}]
      | [\x{037F}-\x{1FFF}]
      | [\x{200C}-\x{200D}]
      | [\x{203F}-\x{2040}]
      | [\x{2070}-\x{218F}]
      | [\x{2C00}-\x{2FEF}]
      | [\x{3001}-\x{D7FF}]
      | [\x{F900}-\x{FDCF}]
      | [\x{FDF0}-\x{FFFD}]
      | [\x{10000}-\x{EFFFF}]
    )

  combinators: '(?:>{1,3}|[~+])'

  # Predefined Counter Styles
  # https://drafts.csswg.org/css-counter-styles-3/#predefined-counters
  counter_styles: |-
    (?xi:
        arabic-indic | armenian | bengali | cambodian | circle
      | cjk-decimal | cjk-earthly-branch | cjk-heavenly-stem | decimal-leading-zero
      | decimal | devanagari | disclosure-closed | disclosure-open | disc
      | ethiopic-numeric | georgian | gujarati | gurmukhi | hebrew
      | hiragana-iroha | hiragana | japanese-formal | japanese-informal
      | kannada | katakana-iroha | katakana | khmer
      | korean-hangul-formal | korean-hanja-formal | korean-hanja-informal | lao
      | lower-alpha | lower-armenian | lower-greek | lower-latin | lower-roman
      | malayalam | mongolian | myanmar | oriya | persian
      | simp-chinese-formal | simp-chinese-informal
      | square | tamil | telugu | thai | tibetan
      | trad-chinese-formal | trad-chinese-informal
      | upper-alpha | upper-armenian | upper-latin | upper-roman
    )

contexts:
  main:
    - include: comment-block
    - include: selector
    - include: at-rules
    - include: property-list

  at-rules:
    - include: at-charset
    - include: at-counter-style
    - include: at-custom-media
    - include: at-document
    - include: at-font-face
    - include: at-import
    - include: at-keyframes
    - include: at-media
    - include: at-namespace
    - include: at-page
    - include: at-supports

  # When including `color-values` and `color-adjuster-functions`, make sure it is
  # included after the color adjustors to prevent `color-values` from consuming
  # conflicting function names & color constants such as `red`, `green`, or `blue`.
  color-values:
    - include: color-functions
      # https://www.w3.org/TR/CSS22/syndata.html#color-units
    - match: \b(aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow)\b
      scope: support.constant.color.w3c-standard-color-name.css
      # https://www.w3.org/TR/css3-color/#svg-color
    - match: \b(aliceblue|antiquewhite|aquamarine|azure|beige|bisque|blanchedalmond|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|gainsboro|ghostwhite|gold|goldenrod|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|limegreen|linen|magenta|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|oldlace|olivedrab|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|rebeccapurple|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|thistle|tomato|turquoise|violet|wheat|whitesmoke|yellowgreen)\b
      scope: support.constant.color.w3c-extended-color-keywords.css
      # Special Color Keywords
      # https://www.w3.org/TR/css3-color/#currentcolor
      # https://www.w3.org/TR/css3-color/#transparent-def
    - match: \b((?i)currentColor|transparent)\b
      scope: support.constant.color.w3c-special-color-keyword.css
      # Hex Color
    - match: '(#)(\h{3}|\h{6})\b'
      scope: constant.other.color.rgb-value.css
      captures:
        1: punctuation.definition.constant.css
      # RGBA Hexadecimal Colors
      # https://en.wikipedia.org/wiki/RGBA_color_space#RGBA_hexadecimal_.28word-order.29
    - match: '(#)(\h{4}|\h{8})\b'
      scope: constant.other.color.rgba-value.css
      captures:
        1: punctuation.definition.constant.css

  comment-block:
    - match: /\*
      scope: punctuation.definition.comment.css
      push:
        - meta_scope: comment.block.css
        - match: \*/
          scope: punctuation.definition.comment.css
          pop: true

  at-charset:
    - match: \s*((@)charset\b)\s*
      captures:
        1: keyword.control.at-rule.charset.css
        2: punctuation.definition.keyword.css
      push:
        - meta_scope: meta.at-rule.charset.css
        - include: at-rule-punctuation
        - include: literal-string

  # @counter-style
  # https://drafts.csswg.org/css-counter-styles-3/#the-counter-style-rule
  at-counter-style:
    - match: \s*((@)counter-style\b)\s+(?:(?i:\b(decimal|none)\b)|({{ident}}))\s*(?=\{|$)
      captures:
        1: keyword.control.at-rule.counter-style.css
        2: punctuation.definition.keyword.css
        3: invalid.illegal.counter-style-name.css
        4: entity.other.counter-style-name.css
      push:
        - meta_scope: meta.at-rule.counter-style.css
        - include: comment-block
        - include: rule-list-terminator
        - include: rule-list

  at-custom-media:
    - match: (?=\s*@custom-media\b)
      push:
        - match: ;
          scope: punctuation.terminator.css
          pop: true
        - match: \s*((@)custom-media)
          captures:
            1: keyword.control.at-rule.custom-media.css
            2: punctuation.definition.keyword.css
            3: support.constant.custom-media.css
          push:
            - meta_scope: meta.at-rule.custom-media.css
            - match: \s*(?=;)
              pop: true
            - include: media-query-list

  # @document
  # https://www.w3.org/TR/2012/WD-css3-conditional-20120911/#at-document
  at-document:
    - match: '((@)document)'
      captures:
        1: keyword.control.at-rule.document.css
        2: punctuation.definition.keyword.css
      push:
        - meta_scope: meta.at-rule.document.css
        - match: '\{'
          scope: punctuation.definition.block.begin.css
          push:
            - meta_scope: meta.block.css
            - match: '(?=\})'
              pop: true
            - include: main
        - match: '\}'
          scope: meta.block.css punctuation.definition.block.end.css
          pop: true
        - include: comment-block
        - include: url-function
        - include: url-prefix-function
        - include: domain-function
        - include: regexp-function
        - include: comma-delimiter

  at-font-face:
    - match: '\s*((@)font-face)\s*(?=\{|$)'
      captures:
        1: keyword.control.at-rule.font-face.css
        2: punctuation.definition.keyword.css
      push:
        - meta_scope: meta.at-rule.font-face.css
        - include: comment-block
        - include: rule-list-terminator
        - include: rule-list

  at-import:
    - match: \s*((@)import\b)\s*
      captures:
        1: keyword.control.at-rule.import.css
        2: punctuation.definition.keyword.css
      push:
        - meta_scope: meta.at-rule.import.css
        - include: at-rule-punctuation
        - include: literal-string
        - include: url-function
        - include: media-query-list

  # https://drafts.csswg.org/css-animations/#propdef-animation-name
  keyframe-name:
    - match: '\s*({{ident}})?'
      captures:
        1: entity.other.animation-name.css
      push:
        - match: '\s*(?:(,)|(?=[{;]))'
          captures:
            1: punctuation.definition.arbitrary-repetition.css
          pop: true

  # @keyframes
  # https://drafts.csswg.org/css-animations/#keyframes
  at-keyframes:
    - match: (?=\s*@(?:-webkit-|-moz-|-o-)?keyframes\b)
      push:
        - include: rule-list-terminator
        - match: \s*((@)(-webkit-|-moz-|-o-)?keyframes)
          captures:
            1: keyword.control.at-rule.keyframe.css
            2: punctuation.definition.keyword.css
            3: support.type.property-vendor.css
            4: support.constant.keyframe.css
          push:
            - meta_scope: meta.at-rule.keyframe.css
            - match: '\s*(?=\{)'
              pop: true
            - match: '\s*(?=[^{;])'
              push:
                - match: '\s*(?=[{;])'
                  pop: true
                - include: keyframe-name
        - match: '\s*(\{)'
          captures:
            1: punctuation.section.property-list.css
          push:
            - match: '(?=\})'
              pop: true
            - match: '\s*(?:(from|to)|((?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)(%)))\s*,?\s*'
              captures:
                1: keyword.keyframe-selector.css
                2: constant.numeric.css
                3: keyword.other.unit.css
            - include: main

  at-media:
    - match: (?=\s*@media\b)
      push:
        - include: rule-list-terminator
        - match: \s*((@)media)
          captures:
            1: keyword.control.at-rule.media.css
            2: punctuation.definition.keyword.css
            3: support.constant.media.css
          push:
            - meta_scope: meta.at-rule.media.css
            - match: '\s*(?=\{)'
              pop: true
            - include: media-query-list
        - match: '\s*(\{)'
          captures:
            1: punctuation.section.property-list.css
          push:
            - match: '(?=\})'
              pop: true
            - include: main

  media-query:
    # Media Types: https://www.w3.org/TR/CSS21/media.html
    - include: comment-block
    - match: \b(?i:all|aural|braille|embossed|handheld|print|projection|screen|speech|tty|tv)\b
      scope: support.constant.media.css
    - match: '\b(?i:and|or|not|only)\b'
      scope: keyword.operator.logic.media.css
    - match: ','
      scope: punctuation.definition.arbitrary-repetition.css
    - match: \(
      scope: punctuation.definition.group.begin.css
      push:
        - match: \)
          scope: punctuation.definition.group.end.css
          pop: true
        - include: comment-block
        - match: |-
            (?x)
            (
                (-webkit-|-o-)?
                ((min|max)-)?
                (-moz-)?
                (
                    ((device-)?(height|width|aspect-ratio|pixel-ratio))|
                    (color(-index)?)|monochrome|resolution
                )
            )|grid|scan|orientation
            \s*(?=[:)])
          captures:
            0: support.type.property-name.media.css
            2: support.type.vendor-prefix.css
            5: support.type.vendor-prefix.css
          push:
            - match: (:)|(?=\))
              captures:
                1: punctuation.separator.key-value.css
              pop: true
        - match: \b(portrait|landscape|progressive|interlace)
          scope: support.constant.property-value.css
        - match: \s*(\d+)(/)(\d+)
          captures:
            1: constant.numeric.css
            2: keyword.operator.arithmetic.css
            3: constant.numeric.css
        - include: numeric-values

  media-query-list:
    - match: '\s*(?=[^{;])'
      push:
        - match: '\s*(?=[{;])'
          pop: true
        - include: media-query

  # @namespace
  # https://www.w3.org/TR/css3-namespace/
  at-namespace:
    - match: '\s*((@)namespace)\s+({{ident}})?'
      captures:
        1: keyword.control.at-rule.namespace.css
        2: punctuation.definition.keyword.css
        3: entity.other.namespace-prefix.css
      push:
        - meta_scope: meta.at-rule.namespace.css
        - include: at-rule-punctuation
        - include: literal-string

  # @page
  # https://www.w3.org/TR/CSS2/page.html
  at-page:
    - match: '\s*((@)page)\s*(?:(:)(first|left|right))?\s*(?=\{|$)'
      captures:
        1: keyword.control.at-rule.page.css
        2: punctuation.definition.keyword.css
        3: punctuation.definition.entity.css
        4: entity.other.pseudo-class.css
      push:
        - meta_scope: meta.at-rule.page.css
        - include: comment-block
        - include: rule-list-terminator
        - include: rule-list

  # @supports
  # https://drafts.csswg.org/css-conditional-3/#at-supports
  at-supports:
    - match: '((@)supports)'
      captures:
        1: keyword.control.at-rule.supports.css
        2: punctuation.definition.keyword.css
      push:
        - meta_scope: meta.at-rule.supports.css
        - match: '\{'
          scope: punctuation.definition.block.begin.css
          push:
            - meta_scope: meta.block.css
            - match: '(?=\})'
              pop: true
            - include: rule-list-body
            - include: main
        - match: '\}'
          scope: meta.block.css punctuation.definition.block.end.css
          pop: true
        - include: at-supports-operators
        - include: at-supports-parens

  at-supports-operators:
    - match: '\b(?i:and|or|not)\b'
      scope: keyword.operator.logic.css

  at-supports-parens:
    - match: '\('
      scope: punctuation.definition.group.begin.css
      push:
        - meta_scope: meta.group.css
        - match: '\)'
          scope: punctuation.definition.group.end.css
          pop: true
        - include: at-supports-operators
        - include: at-supports-parens
        - include: rule-list-body

  property-list:
    - match: '(?=\{)'
      push:
        - match: '\}'
          scope: punctuation.section.property-list.css
          pop: true
        - include: rule-list

  property-value-constants:
    - match: |-
            (?x)\b(
                absolute|active|add
              | all(-(petite|small)-caps|-scroll)?
              | alpha(betic)?
              | alternate(-reverse)?
              | always|annotation|antialiased|at
              | auto(hiding-scrollbar)?
              | avoid(-column|-page|-region)?
              | background(-color|-image|-position|-size)?
              | backwards|balance|baseline|below|bevel|bicubic|bidi-override|blink
              | block(-line-height)?
              | blur
              | bold(er)?
              | border(-bottom|-left|-right|-top)?-(color|radius|width|style)
              | border-(bottom|top)-(left|right)-radius
              | border-image(-outset|-repeat|-slice|-source|-width)?
              | border(-bottom|-left|-right|-top|-collapse|-spacing|-box)?
              | both|bottom
              | box(-shadow)?
              | break-(all|word)
              | brightness
              | butt(on)?
              | capitalize
              | cent(er|ral)
              | char(acter-variant)?
              | cjk-ideographic|clip|clone|close-quote
              | closest-(corner|side)
              | col-resize|collapse
              | color(-stop|-burn|-dodge)?
              | column((-count|-gap|-reverse|-rule(-color|-width)?|-width)|s)?
              | common-ligatures|condensed|consider-shifts|contain
              | content(-box|s)?
              | contextual|contrast|cover
              | crisp(-e|E)dges
              | crop
              | cross(hair)?
              | da(rken|shed)
              | default|dense|diagonal-fractions|difference|disabled
              | discretionary-ligatures|disregard-shifts
              | distribute(-all-lines|-letter|-space)?
              | dotted|double|drop-shadow
              | (nwse|nesw|ns|ew|sw|se|nw|ne|w|s|e|n)-resize
              | ease(-in-out|-in|-out)?
              | element|ellipsis|embed|end|EndColorStr|evenodd
              | exclu(de(-ruby)?|sion)
              | expanded
              | (extra|semi|ultra)-(condensed|expanded)
              | farthest-(corner|side)?
              | fill(-box|-opacity)?
              | filter|fixed|flat
              | flex((-basis|-end|-grow|-shrink|-start)|box)?
              | flip|flood-color
              | font(-size(-adjust)?|-stretch|-weight)?
              | forwards
              | from(-image)?
              | full-width|geometricPrecision|glyphs|gradient|grayscale
              | grid(-height)?
              | groove|hand|hanging|hard-light|height|help|hidden|hide
              | historical-(forms|ligatures)
              | horizontal(-tb)?
              | hue
              | ideograph(-alpha|-numeric|-parenthesis|-space|ic)
              | inactive|include-ruby|infinite|inherit|initial
              | inline(-block|-box|-flex(box)?|-line-height|-table)?
              | inset|inside
              | inter(-ideograph|-word|sect)
              | invert|isolat(e|ion)|italic
              | jis(04|78|83|90)
              | justify(-all)?
              | keep-all
              | large[r]?
              | last|left|letter-spacing
              | light(e[nr]|ing-color)
              | line(-edge|-height|-through)?
              | linear(-gradient|RGB)?
              | lining-nums|list-item|local|loose|lowercase|lr-tb|ltr
              | lumin(osity|ance)|manual
              | margin(-bottom|-box|-left|-right|-top)?
              | marker(-offset|s)?
              | mathematical
              | max-(content|height|lines|size|width)
              | medium|middle
              | min-(content|height|width)
              | miter|mixed|move|multiply|newspaper
              | no-(change|clip|(close|open)-quote|(common|discretionary|historical)-ligatures|contextual|drop|repeat)
              | none|nonzero|normal|not-allowed|nowrap|oblique
              | offset(-after|-before|-end|-start)?
              | oldstyle-nums|opacity|open-quote
              | optimize(Legibility|Precision|Quality|Speed)
              | order|ordinal|ornaments
              | outline(-color|-offset|-width)?
              | outset|outside|over(line|-edge|lay)
              | padding(-bottom|-box|-left|-right|-top)?
              | page|painted|paused
              | perspective-origin
              | petite-caps|pixelated|pointer
              | pre(-line|-wrap)?
              | preserve-3d
              | progid:DXImageTransform.Microsoft.(Alpha|Blur|dropshadow|gradient|Shadow)
              | progress
              | proportional-(nums|width)
              | radial-gradient|recto|region|relative
              | repeat(-[xy])?
              | repeating-(linear|radial)-gradient
              | replaced|reset-size|reverse|ridge|right
              | round
              | row(-resize|-reverse)?
              | run-in
              | ruby(-base|-text)?(-container)?
              | rtl|running|saturat(e|ion)|screen
              | scroll(-position|bar)?
              | separate|sepia
              | scale-down
              | shape-(image-threshold|margin|outside)
              | show
              | sideways(-lr|-rl)?
              | simplified
              | slashed-zero|slice
              | small(-caps|er)?
              | smooth|snap|solid|soft-light
              | space(-around|-between)?
              | span|sRGB
              | stack(ed-fractions)?
              | start(ColorStr)?
              | static
              | step-(end|start)
              | sticky
              | stop-(color|opacity)
              | stretch|strict
              | stroke(-box|-dash(array|offset)|-miterlimit|-opacity|-width)?
              | style(set)?
              | stylistic
              | sub(grid|pixel-antialiased|tract)?
              | super|swash
              | table(-caption|-cell|(-column|-footer|-header|-row)-group|-column|-row)?
              | tabular-nums|tb-rl
              | text((-bottom|-(decoration|emphasis)-color|-indent|-(over|under|after|before)-edge|-shadow|-size(-adjust)?|-top)|field)?
              | thi(ck|n)
              | titling-ca(ps|se)
              | to[p]?
              | touch|traditional
              | transform(-origin)?
              | under(-edge|line)?
              | unicase|unset|uppercase|upright
              | use-(glyph-orientation|script)
              | verso
              | vertical(-align|-ideographic|-lr|-rl|-text)?
              | view-box
              | viewport-fill(-opacity)?
              | visibility
              | visible(Fill|Painted|Stroke)?
              | wait|wavy|weight|whitespace|width|word-spacing
              | wrap(-reverse)?
              | x{1,2}-(large|small)
              | z-index|zero
              | zoom(-in|-out)?
              | ({{counter_styles}})
            )\b
      scope: support.constant.property-value.css
      # Generic Font Families: https://www.w3.org/TR/CSS2/fonts.html
    - match: \b(?i:sans-serif|serif|monospace|fantasy|cursive|system-ui)\b(?=\s*[;,\n}])
      scope: support.constant.font-name.css

  property-values:
    - include: comment-block
    - include: vendor-prefix
    - include: builtin-functions
    - include: unicode-range
    - include: numeric-values
    - include: color-values
    - include: property-value-constants
    - include: literal-string
    - match: \!\s*important
      scope: keyword.other.important.css

  rule-list-terminator:
    - match: '\s*(\})'
      captures:
        1: punctuation.section.property-list.css
      pop: true

  rule-list:
    - match: '\{'
      scope: punctuation.section.property-list.css
      push:
        - meta_scope: meta.property-list.css
        - match: '(?=\s*\})'
          pop: true
        - include: rule-list-body

  rule-list-body:
    - include: comment-block
    - match: "(?=[-a-z])"
      push:
        - meta_scope: meta.property-name.css
        - match: "$|(?![-a-z])"
          pop: true
        - include: vendor-prefix
        - match: '\b(var-)({{ident}})(?=\s)'
          scope: invalid.deprecated.custom-property.css
          captures:
            1: keyword.other.custom-property.prefix.css
            2: support.type.custom-property.name.css
        - include: custom-property-name
        - match: \bfont(-family)?(?!-)\b
          scope: support.type.property-name.css
          push:
            - match: (:)([ \t]*)
              captures:
                1: punctuation.separator.key-value.css
                2: meta.property-value.css
              push:
                - meta_content_scope: meta.property-value.css
                - match: '\s*(;)|(?=[})])'
                  captures:
                    1: punctuation.terminator.rule.css
                  pop: true
                - include: property-values
                - match: '{{ident}}(\s+{{ident}})*'
                  scope: string.unquoted.css
                - match: ','
                  scope: punctuation.separator.css
            - match: ''
              pop: true
        # Property names are sorted by popularity in descending order.
        # Popularity data taken from https://www.chromestatus.com/metrics/css/popularity
        - match: |-
            \b(?x)(
                display|width|background-color|height|position|font-family|font-weight
              | top|opacity|cursor|background-image|right|visibility|box-sizing
              | user-select|left|float|margin-left|margin-top|line-height
              | padding-left|z-index|margin-bottom|margin-right|margin
              | vertical-align|padding-top|white-space|border-radius|padding-bottom
              | padding-right|padding|bottom|clear|max-width|box-shadow|content
              | border-color|min-height|min-width|font-style|border-width
              | border-collapse|background-size|text-overflow|max-height|text-transform
              | text-shadow|text-indent|border-style|overflow-y|list-style-type
              | word-wrap|border-spacing|appearance|zoom|overflow-x|border-top-left-radius
              | border-bottom-left-radius|border-top-color|pointer-events
              | border-bottom-color|align-items|justify-content|letter-spacing
              | border-top-right-radius|border-bottom-right-radius|border-right-width
              | font-smoothing|border-bottom-width|border-right-color|direction
              | border-top-width|src|border-left-color|border-left-width
              | tap-highlight-color|table-layout|background-clip|word-break
              | transform-origin|resize|filter|backface-visibility|text-rendering
              | box-orient|transition-property|transition-duration|word-spacing
              | quotes|outline-offset|animation-timing-function|animation-duration
              | animation-name|transition-timing-function|border-bottom-style
              | border-bottom|transition-delay|transition|unicode-bidi|border-top-style
              | border-top|unicode-range|list-style-position|orphans|outline-width
              | line-clamp|order|flex-direction|box-pack|animation-fill-mode
              | outline-color|list-style-image|list-style|touch-action|flex-grow
              | border-left-style|border-left|animation-iteration-count
              | page-break-inside|box-flex|box-align|page-break-after|animation-delay
              | widows|border-right-style|border-right|flex-align|outline-style
              | outline|background-origin|animation-direction|fill-opacity
              | background-attachment|flex-wrap|transform-style|counter-increment
              | overflow-wrap|counter-reset|animation-play-state|animation
              | will-change|box-ordinal-group|image-rendering|mask-image|flex-flow
              | background-position-y|stroke-width|background-position-x|background-position
              | background-blend-mode|flex-shrink|flex-basis|flex-order|flex-item-align
              | flex-line-pack|flex-negative|flex-pack|flex-positive|flex-preferred-size
              | flex|user-drag|font-stretch|column-count|empty-cells|align-self
              | caption-side|mask-size|column-gap|mask-repeat|box-direction
              | font-feature-settings|mask-position|align-content|object-fit
              | columns|text-fill-color|clip-path|stop-color|font-kerning
              | page-break-before|stroke-dasharray|size|fill-rule|border-image-slice
              | column-width|break-inside|column-break-before|border-image-width
              | stroke-dashoffset|border-image-repeat|border-image-outset|line-break
              | stroke-linejoin|stroke-linecap|stroke-miterlimit|stroke-opacity
              | stroke|shape-rendering|border-image-source|border-image|border
              | tab-size|writing-mode|perspective-origin-y|perspective-origin-x
              | perspective-origin|perspective|text-align-last|text-align|clip-rule
              | clip|text-anchor|column-rule-color|box-decoration-break|column-fill
              | fill|column-rule-style|mix-blend-mode|text-emphasis-color
              | baseline-shift|dominant-baseline|page|alignment-baseline
              | column-rule-width|column-rule|break-after|font-variant-ligatures
              | transform-origin-y|transform-origin-x|transform|object-position
              | break-before|column-span|isolation|shape-outside|all
              | color-interpolation-filters|marker|marker-end|marker-start
              | marker-mid|color-rendering|color-interpolation|background-repeat-x
              | background-repeat-y|background-repeat|background|mask-type
              | flood-color|flood-opacity|text-orientation|mask-composite
              | text-emphasis-style|paint-order|lighting-color|shape-margin
              | text-emphasis-position|text-emphasis|shape-image-threshold
              | mask-clip|mask-origin|mask|font-variant-caps|font-variant-alternates
              | font-variant-east-asian|font-variant-numeric|font-variant-position
              | font-variant|font-size-adjust|font-size|font-language-override
              | font-display|font-synthesis|font|line-box-contain|text-justify
              | text-decoration-color|text-decoration-style|text-decoration-line
              | text-decoration|text-underline-position|grid-template-rows
              | grid-template-columns|grid-template-areas|grid-template|rotate|scale
              | translate|scroll-behavior|grid-column-start|grid-column-end
              | grid-column-gap|grid-row-start|grid-row-end|grid-auto-rows
              | grid-area|grid-auto-flow|grid-auto-columns|image-orientation
              | hyphens|overflow-scrolling|overflow|color-profile|kerning
              | nbsp-mode|color|image-resolution|grid-row-gap|grid-row|grid-column
              | blend-mode|azimuth|pause-after|pause-before|pause|pitch-range|pitch
              | text-height|system|negative|prefix|suffix|range|pad|fallback
              | additive-symbols|symbols|speak-as|speak|grid-gap
            )\b
          scope: support.type.property-name.css
    - match: (:)([ \t]*)
      captures:
        1: punctuation.separator.key-value.css
        2: meta.property-value.css
      push:
        - meta_content_scope: meta.property-value.css
        - match: '\s*(;)|(?=[})])'
          captures:
            1: punctuation.terminator.rule.css
          pop: true
        - include: property-values

  selector:
    - match: '\s*(?=[:.*#a-zA-Z\[])'
      push:
        - meta_scope: meta.selector.css
        - match: "(?=[/@{)])"
          pop: true
          # Custom Elements: http://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
        - match: '\b([a-z](?:{{custom_element_chars}})*-(?:{{custom_element_chars}})*)\b'
          scope: entity.name.tag.custom.css
        - match: '\b(a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdi|bdo|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|content|data|datalist|dd|del|details|dfn|dir|dialog|div|dl|dt|element|em|embed|eventsource|fieldset|figure|figcaption|footer|form|frame|frameset|h[1-6]|head|header|hgroup|hr|html|i|iframe|img|input|ins|isindex|kbd|keygen|label|legend|li|link|main|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|picture|pre|progress|q|rp|rt|rtc|s|samp|script|section|select|shadow|small|source|span|strike|strong|style|sub|summary|sup|svg|table|tbody|td|template|textarea|tfoot|th|thead|time|title|tr|track|tt|u|ul|var|video|wbr|xmp|circle|clipPath|defs|ellipse|filter|foreignObject|g|glyph|glyphRef|image|line|linearGradient|marker|mask|path|pattern|polygon|polyline|radialGradient|rect|stop|switch|symbol|text|textPath|tref|tspan|use)\b'
          scope: entity.name.tag.css
          # https://drafts.csswg.org/selectors-4/#class-html
        - match: '(\.){{ident}}'
          scope: entity.other.attribute-name.class.css
          captures:
            1: punctuation.definition.entity.css
          # https://drafts.csswg.org/selectors-4/#id-selectors
        - match: "(#){{ident}}"
          scope: entity.other.attribute-name.id.css
          captures:
            1: punctuation.definition.entity.css
        - match: \*
          scope: entity.name.tag.wildcard.css
          # Combinators
          # https://drafts.csswg.org/selectors-4/#combinators
          # https://drafts.csswg.org/css-scoping/#deep-combinator
        - match: '({{combinators}})(?![>~+])'
          scope: punctuation.separator.combinator.css
        - match: '({{combinators}}){2,}'
          scope: invalid.illegal.combinator.css
        - include: pseudo-elements
        - include: pseudo-classes # pseudo-classes must be included after pseudo-elements
        # Attribute Selectors
        # https://drafts.csswg.org/selectors-4/#attribute-selectors
        - match: '\['
          scope: punctuation.definition.entity.css
          push:
            - meta_scope: meta.attribute-selector.css
            - include: qualified-name
            - match: '({{ident}})'
              scope: entity.other.attribute-name.css
            - match: '\s*([~*|^$]?=)\s*'
              captures:
                1: keyword.operator.attribute-selector.css
              push:
                - match: '[^\s\]\[''"]'
                  scope: string.unquoted.css
                - include: literal-string
                - match: '(?=(\s|\]))'
                  pop: true
            - match: '(?:\s+([iI]))?'  # case insensitive flag
              captures:
                1: keyword.other.css
            - match: '\]'
              scope: punctuation.definition.entity.css
              pop: true

  # Pseudo Elements
  # https://drafts.csswg.org/selectors-4/#pseudo-elements
  pseudo-elements:
    - match: |-
        (?x:
            (:{1,2})(?:before|after|first-line|first-letter) # CSS1 & CSS2 require : or ::
          | (::)(-(?:moz|ms|webkit)-)?(?:{{ident}}) # CSS3 requires ::
        )\b
      scope: entity.other.pseudo-element.css
      captures:
        1: punctuation.definition.entity.css
        2: punctuation.definition.entity.css
        3: support.type.vendor-prefix.css

  # Pseudo Classes
  # https://drafts.csswg.org/selectors-4/#pseudo-classes
  pseudo-classes:
      # Functional Pseudo Classes
      # https://drafts.csswg.org/selectors-4/#functional-pseudo-class

      # Functional Pseudo Classes with a single unquoted string
    - match: '(:)(dir|lang)(?=\()'
      scope: entity.other.pseudo-class.css
      captures:
        1: punctuation.definition.entity.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: unquoted-string

      # Functional Pseudo Classes with selector list
    - match: '(:)(matches|not|has)(?=\()'
      scope: entity.other.pseudo-class.css
      captures:
        1: punctuation.definition.entity.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: selector

      # Special :drop() pseudo-class
    - match: '(:)(drop)(?=\()'
      scope: entity.other.pseudo-class.css
      captures:
        1: punctuation.definition.entity.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - match: \b(active|valid|invalid)\b
            scope: keyword.other.pseudo-class.css

      # Functional Pseudo Classes with `An+B` param
      # An+B Notation: https://drafts.csswg.org/css-syntax/#anb
      # nth-last-child(), nth-child(), nth-last-of-type(), nth-of-type()
    - match: '(:)(nth-last-child|nth-child|nth-last-of-type|nth-of-type)(?=\()'
      scope: entity.other.pseudo-class.css
      captures:
        1: punctuation.definition.entity.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - match: \b(even|odd)\b
            scope: keyword.other.pseudo-class.css
          - match: '(?:[-+]?(?:\d+)?(n)(\s*[-+]\s*\d+)?|[-+]?\s*\d+)'
            scope: constant.numeric.css
            captures:
              1: keyword.other.unit.css

      # Regular Pseudo Classes
    - match: '(:)({{ident}})'
      scope: entity.other.pseudo-class.css
      captures:
        1: punctuation.definition.entity.css

  builtin-functions:
    - include: attr-function
    - include: calc-function
    - include: cross-fade-function
    - include: filter-functions
    - include: gradient-functions
    - include: image-function
    - include: image-set-function
    - include: minmax-function
    - include: url-function
    - include: var-function
    - include: color-adjuster-functions

      # filter()
      # https://drafts.fxtf.org/filters/#funcdef-filter
    - match: '\b(filter)(?=\()'
      scope: support.function.filter.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: comma-delimiter
          - include: image-type
          - include: literal-string
          - include: filter-functions

      # counter()
      # https://drafts.csswg.org/css-lists-3/#funcdef-counter
    - match: '\b(counter)(?=\()'
      scope: support.function.counter.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - match: '({{ident}})'
            scope: entity.other.counter-name.css string.unquoted.css
          - match: '(?=,)'
            push:
              - match: '(?=\))'
                pop: true
              - include: comma-delimiter
              - match: '\b({{counter_styles}}|none)\b'
                scope: support.constant.property-value.counter-style.css

      # counters()
      # https://drafts.csswg.org/css-lists-3/#funcdef-counters
    - match: '\b(counters)(?=\()'
      scope: support.function.counter.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - match: '({{ident}})'
            scope: entity.other.counter-name.css string.unquoted.css
          - match: '(?=,)'
            push:
              - match: '(?=\))'
                pop: true
              - include: comma-delimiter
              - include: literal-string
              - match: '\b({{counter_styles}}|none)\b'
                scope: support.constant.property-value.counter-style.css

      # symbols()
      # https://drafts.csswg.org/css-counter-styles-3/#symbols-function
    - match: '\b(symbols)(?=\()'
      scope: support.function.counter.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - match: '\b(cyclic|numeric|alphabetic|symbolic|fixed)\b'
            scope: support.constant.symbol-type.css
          - include: comma-delimiter
          - include: literal-string
          - include: image-type

      # format()
      # https://drafts.csswg.org/css-fonts-3/#descdef-src
      # format() is also mentioned in `issue 2` at https://drafts.csswg.org/css-images-3/#issues-index
      # but does not seem to be implemented in any manner
    - match: '\b(format)(?=\()'
      scope: support.function.font-face.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: literal-string

      # local()
      # https://drafts.csswg.org/css-fonts-3/#descdef-src
    - match: '\b(local)(?=\()'
      scope: support.function.font-face.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: unquoted-string

      # Transform Functions
      # https://www.w3.org/TR/css-transforms-1/#transform-functions

      # transform functions with comma separated <number> types
      # matrix(), scale(), matrix3d(), scale3d()
    - match: '\b(matrix3d|scale3d|matrix|scale)(?=\()'
      scope: support.function.transform.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: comma-delimiter
          - include: number-type
          - include: var-function

      # transform functions with comma separated <number> or <length> types
      # translate(), translate3d()
    - match: '\b(translate(3d)?)(?=\()'
      scope: support.function.transform.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: comma-delimiter
          - include: percentage-type
          - include: length-type
          - include: number-type
          - include: var-function

      # transform functions with a single <number> or <length> type
      # translateX(), translateY()
    - match: '\b(translate[XY])(?=\()'
      scope: support.function.transform.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: percentage-type
          - include: length-type
          - include: number-type

      # transform functions with a single <angle> type
      # rotate(), skewX(), skewY(), rotateX(), rotateY(), rotateZ()
    - match: '\b(rotate[XYZ]?|skew[XY])(?=\()'
      scope: support.function.transform.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: angle-type

      # transform functions with comma separated <angle> types
      # skew()
    - match: '\b(skew)(?=\()'
      scope: support.function.transform.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: comma-delimiter
          - include: angle-type

      # transform functions with a single <length> type
      # translateZ(), perspective()
    - match: '\b(translateZ|perspective)(?=\()'
      scope: support.function.transform.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: length-type

      # transform functions with a comma separated <number> or <angle> types
      # rotate3d()
    - match: '\b(rotate3d)(?=\()'
      scope: support.function.transform.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: comma-delimiter
          - include: angle-type
          - include: number-type

      # transform functions with a single <number> type
      # scaleX(), scaleY(), scaleZ()
    - match: '\b(scale[XYZ])(?=\()'
      scope: support.function.transform.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: comma-delimiter
          - include: number-type

      # Timing Functions
      # https://www.w3.org/TR/web-animations-1/#timing-functions

      # cubic-bezier()
      # https://www.w3.org/TR/web-animations-1/#cubic-bzier-timing-function
    - match: '\b(cubic-bezier)(?=\()'
      scope: support.function.timing.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: comma-delimiter
          - include: number-type

      # steps()
      # https://www.w3.org/TR/web-animations-1/#step-timing-function
    - match: '\b(steps)(?=\()'
      scope: support.function.timing.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: comma-delimiter
          - include: integer-type
          - match: (end|middle|start)
            scope: support.keyword.timing-direction.css

      # Shape Functions
      # https://www.w3.org/TR/css-shapes-1/#typedef-basic-shape

      # rect() - Deprecated
      # https://drafts.fxtf.org/css-masking-1/#funcdef-clip-rect
    - match: '\b(rect)(?=\()'
      scope: support.function.shape.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - match: \bauto\b
            scope: support.constant.property-value.css
          - include: length-type

      # inset()
      # https://www.w3.org/TR/css-shapes-1/#funcdef-inset
    - match: '\b(inset)(?=\()'
      scope: support.function.shape.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - match: '\bround\b'
            scope: keyword.other.css
          - include: length-type
          - include: percentage-type

      # circle()
      # https://www.w3.org/TR/css-shapes-1/#funcdef-circle
      # ellipse()
      # https://www.w3.org/TR/css-shapes-1/#funcdef-ellipse
    - match: '\b(circle|ellipse)(?=\()'
      scope: support.function.shape.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - match: '\bat\b'
            scope: keyword.other.css
          - match: '\b(top|right|bottom|left|center|closest-side|farthest-side)\b'
            scope: support.constant.property-value.css
          - include: length-type
          - include: percentage-type

      # polygon()
      # https://www.w3.org/TR/css-shapes-1/#funcdef-polygon
    - match: '\b(polygon)(?=\()'
      scope: support.function.shape.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - match: '\b(nonzero|evenodd)\b'
            scope: support.constant.property-value.css
          - include: length-type
          - include: percentage-type

      # toggle()
      # https://www.w3.org/TR/css3-values/#toggle-notation
    - match: '\b(toggle)(?=\()'
      scope: support.function.toggle.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: comma-delimiter
          - include: vendor-prefix
          - include: property-value-constants
          - include: numeric-values
          - include: color-values
          - include: literal-string

      # repeat()
      # https://drafts.csswg.org/css-grid/#funcdef-repeat
    - match: '\b(repeat)(?=\()'
      scope: support.function.grid.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: comma-delimiter
          - include: length-type
          - include: percentage-type
          - include: minmax-function
          - include: integer-type
          - include: var-function
          - match: \b(auto-fill|auto-fit)\b
            scope: support.keyword.repetitions.css
          - match: \b(max-content|min-content|auto)\b
            scope: support.constant.property-value.css

  # var()
  # https://drafts.csswg.org/css-variables/#funcdef-var
  var-function:
    - match: '\b(var)(?=\()'
      scope: support.function.var.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: comma-delimiter
          - include: custom-property-name

  # Filter Functions
  # https://drafts.fxtf.org/filters/#typedef-filter-function
  filter-functions:
      # blur()
      # https://drafts.fxtf.org/filters/#funcdef-filter-blur
    - match: '\b(blur)(?=\()'
      scope: support.function.filter.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: length-type

      # brightness(), contrast(), grayscale(), invert(), opacity(), saturate(), sepia()
      # https://drafts.fxtf.org/filters/#funcdef-filter-brightness
    - match: '\b(brightness|contrast|grayscale|invert|opacity|saturate|sepia)(?=\()'
      scope: support.function.filter.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: percentage-type
          - include: number-type

      # drop-shadow()
      # https://drafts.fxtf.org/filters/#funcdef-filter-drop-shadow
    - match: '\b(drop-shadow)(?=\()'
      scope: support.function.filter.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: length-type
          - include: color-values

      # hue-rotate()
      # https://drafts.fxtf.org/filters/#funcdef-filter-hue-rotate
    - match: '\b(hue-rotate)(?=\()'
      scope: support.function.filter.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: angle-type

  # calc()
  # https://www.w3.org/TR/css3-values/#funcdef-calc
  calc-function:
    - match: '\b(calc)(?=\()'
      scope: support.function.calc.css
      push:
        - meta_scope: meta.function-call.css
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push: inside-calc-parens
        - match: ''
          pop: true

  inside-calc-parens:
    - meta_scope: meta.group.css
    - match: '(?=\))'
      set: function-notation-terminator
    - include: calc-function
    - include: var-function
    - include: numeric-values
    - include: attr-function
    - match: "[-/*+]"
      scope: keyword.operator.css
    - match: '\('
      scope: punctuation.definition.group.begin.css
      push: inside-calc-parens

  # attr()
  # https://www.w3.org/TR/css3-values/#funcdef-attr
  attr-function:
    - match: '\b(attr)(?=\()'
      scope: support.function.attr.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: qualified-name
          - include: literal-string
          - match: '({{ident}})'
            scope: entity.other.attribute-name.css
            push:
            - match: |-
                (?x)\b(
                    {{font_relative_lengths}}
                  | {{viewport_percentage_lengths}}
                  | {{absolute_lengths}}
                  | {{angle_units}}
                  | {{duration_units}}
                  | {{frequency_units}}
                  | {{resolution_units}}
                )\b
              scope: keyword.other.unit.css
            - match: '(?=\))'
              pop: true
            - include: comma-delimiter
            - include: property-value-constants
            - include: numeric-values
            - include: color-values

  # url()
  # https://drafts.csswg.org/css-images-3/#url-notation
  url-function:
    - match: '\b(url)(?=\()'
      scope: support.function.url.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: literal-string
          - include: unquoted-string

  # url-prefix()
  # https://www.w3.org/TR/2012/WD-css3-conditional-20120911/#url-prefix
  url-prefix-function:
    - match: '\b(url-prefix)(?=\()'
      scope: support.function.url-prefix.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: literal-string
          - include: unquoted-string

  # domain()
  # https://www.w3.org/TR/2012/WD-css3-conditional-20120911/#url-domain
  domain-function:
    - match: '\b(domain)(?=\()'
      scope: support.function.domain.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: literal-string
          - include: unquoted-string

  # regexp()
  # https://www.w3.org/TR/2012/WD-css3-conditional-20120911/#url-regexp
  regexp-function:
    - match: '\b(regexp)(?=\()'
      scope: support.function.regexp.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: literal-string

  # image()
  # https://drafts.csswg.org/css-images-3/#funcdef-image
  image-function:
    - match: '\b(image)(?=\()'
      scope: support.function.image.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: image-type
          - include: literal-string
          - include: color-values
          - include: comma-delimiter
          - include: unquoted-string

  # image-set()
  # https://drafts.csswg.org/css-images-3/#funcdef-image-set
  image-set-function:
    - match: '\b(image-set)(?=\()'
      scope: support.function.image.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: literal-string
          - include: color-values
          - include: comma-delimiter
          - include: resolution-type
          - include: image-type
          - match: '[0-9]+(x)'
            scope: constant.numeric.css
            captures:
              1: keyword.other.unit.css
          - include: unquoted-string

  # Gradient Functions
  # https://drafts.csswg.org/css-images-3/#gradients
  gradient-functions:
      # linear-gradient()
      # https://drafts.csswg.org/css-images-3/#linear-gradients
      # repeating-linear-gradient()
      # https://drafts.csswg.org/css-images-3/#funcdef-repeating-linear-gradient
    - match: '\b((?:repeating-)?linear-gradient)(?=\()'
      scope: support.function.gradient.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: angle-type
          - include: comma-delimiter
          - include: color-values
          - include: percentage-type
          - include: length-type
          - match: '\bto\b'
            scope: keyword.other.css
          - match: \b(top|right|bottom|left)\b
            scope: support.constant.property-value.css

      # radial-gradient()
      # https://drafts.csswg.org/css-images-3/#radial-gradients
      # repeating-radial-gradient()
      # https://drafts.csswg.org/css-images-3/#funcdef-repeating-radial-gradient
    - match: '\b((?:repeating-)?radial-gradient)(?=\()'
      scope: support.function.gradient.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: comma-delimiter
          - include: color-values
          - include: percentage-type
          - include: length-type
          - match: '\b(at|circle|ellipse)\b'
            scope: keyword.other.css
          - match: |-
              (?x)\b(
                  left
                | center
                | right
                | top
                | bottom
                | closest-corner
                | closest-side
                | farthest-corner
                | farthest-side
              )\b
            scope: support.constant.property-value.css

  # cross-fade()
  # https://drafts.csswg.org/css-images-3/#cross-fade-function
  cross-fade-function:
    - match: '\b(cross-fade)(?=\()'
      scope: support.function.image.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: comma-delimiter
          - include: percentage-type
          - include: color-values
          - include: image-type
          - include: literal-string
          - include: unquoted-string

  # minmax()
  # https://drafts.csswg.org/css-grid/#valdef-grid-template-columns-minmax
  minmax-function:
    - match: '\b(minmax)(?=\()'
      scope: support.function.grid.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: comma-delimiter
          - include: length-type
          - match: \b(max-content|min-content)\b
            scope: support.constant.property-value.css

  # Color Functions
  # https://drafts.csswg.org/css-color
  color-functions:
      # rgb(), rgba()
      # https://drafts.csswg.org/css-color/#rgb-functions
    - match: '\b(rgba?)(?=\()'
      scope: support.function.color.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: comma-delimiter
          - include: percentage-type
          - include: number-type

      # hsl(), hsla()
      # https://drafts.csswg.org/css-color/#the-hsl-notation
      # hwb() - Not yet implemented by browsers
      # https://drafts.csswg.org/css-color/#funcdef-hwb
    - match: '\b(hsla?|hwb)(?=\()'
      scope: support.function.color.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: comma-delimiter
          - include: angle-type
          - include: percentage-type
          - include: number-type

      # gray() - Not yet implemented by browsers
      # https://drafts.csswg.org/css-color/#funcdef-gray
    - match: '\b(gray)(?=\()'
      scope: support.function.color.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: comma-delimiter
          - include: percentage-type
          - include: number-type

      # device-cmyk() - Not yet implemented by browsers
      # https://drafts.csswg.org/css-color/#funcdef-device-cmyk
    - match: '\b(device-cmyk)(?=\()'
      scope: support.function.color.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: comma-delimiter
          - include: color-adjuster-functions # must be included before `color-values`
          - include: color-values
          - include: percentage-type
          - include: number-type

      # color-mod() - Not yet implemented by browsers
      # https://drafts.csswg.org/css-color/#funcdef-color-mod
    - match: '\b(color)(?=\()'
      scope: support.function.color.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: comma-delimiter
          - include: color-adjuster-functions # must be included before `color-values`
          - include: var-function
          - include: color-values
          - include: angle-type
          - include: number-type

  # Color Adjuster Functions - Not yet implemented by browsers
  # https://drafts.csswg.org/css-color/#typedef-color-adjuster
  color-adjuster-functions:
      # red(), green(), blue(), alpha() - Not yet implemented by browsers
    - match: '\b(red|green|blue|alpha|a)(?=\()'
      scope: support.function.color.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: color-adjuster-operators
          - include: percentage-type
          - include: number-type

      # hue() - Not yet implemented by browsers
    - match: '\b(hue|h)(?=\()'
      scope: support.function.color.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: color-adjuster-operators
          - include: angle-type

      # saturation(), lightness(), whiteness(), blackness() - Not yet implemented by browsers
    - match: '\b(saturation|lightness|whiteness|blackness|[slwb])(?=\()'
      scope: support.function.color.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: color-adjuster-operators
          - include: percentage-type

      # tint(), shade(), contrast() - Not yet implemented by browsers
      # contrast() interferes with the contrast() filter function;
      # therefore, it is not yet implemented here
    - match: '\b(tint|shade)(?=\()'
      scope: support.function.color.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - include: percentage-type

      # blend(), blenda() - Not yet implemented by browsers
    - match: '\b(blenda|blend)(?=\()'
      scope: support.function.color.css
      push:
        - meta_scope: meta.function-call.css
        - include: function-notation-terminator
        - match: '\('
          scope: punctuation.definition.group.begin.css
          push:
          - meta_scope: meta.group.css
          - match: '(?=\))'
            pop: true
          - match: '\b(rgb|hsl|hwb)\b'
            scope: keyword.other.color-space.css
          - include: color-values
          - include: percentage-type
          - include: var-function

  unicode-range:
    - match: |-
        (?xi)
            (u\+)
            ([0-9a-f?]{1,6}
            (?:(-)[0-9a-f]{1,6})?)
      scope: support.unicode-range.css
      captures:
        1: support.constant.unicode-range.prefix.css
        2: constant.codepoint-range.css
        3: punctuation.section.range.css

  # Qualified Name
  # https://drafts.csswg.org/css-namespaces-3/#css-qnames
  qualified-name:
    - match: '(?:({{ident}})|(\*))?([|])(?!=)'
      captures:
        1: entity.other.namespace-prefix.css
        2: entity.name.namespace.wildcard.css
        3: punctuation.separator.namespace.css

  # Custom Properties
  # https://drafts.csswg.org/css-variables/#typedef-custom-property-name
  custom-property-name:
    - match: '(--)({{nmchar}}+)'
      scope: support.type.custom-property.css
      captures:
        1: punctuation.definition.custom-property.css
        2: support.type.custom-property.name.css

  color-adjuster-operators:
    - match: '[\-\+*](?=\s+)'
      scope: keyword.operator.css

  comma-delimiter:
    - match: '\s*(,)\s*'
      captures:
        1: punctuation.separator.css

  vendor-prefix:
    - match: "-(?:webkit|moz|ms|o)-"
      scope: support.type.vendor-prefix.css

  function-notation-terminator:
    - match: '\)'
      scope: meta.group.css punctuation.definition.group.end.css
      pop: true

  at-rule-punctuation:
    - match: \;
      scope: punctuation.terminator.rule.css
    - match: (?=;|$)
      pop: true

  unquoted-string:
    - match: '[^\s''"]'
      scope: string.unquoted.css

  literal-string:
    - match: "'"
      scope: punctuation.definition.string.begin.css
      push:
        - meta_scope: string.quoted.single.css
        - match: (')|(\n)
          captures:
            1: punctuation.definition.string.end.css
            2: invalid.illegal.newline.css
          pop: true
        - include: string-content
    - match: '"'
      scope: punctuation.definition.string.begin.css
      push:
        - meta_scope: string.quoted.double.css
        - match: (")|(\n)
          captures:
            1: punctuation.definition.string.end.css
            2: invalid.illegal.newline.css
          pop: true
        - include: string-content

  string-content:
    - match: \\\s*\n
      scope: constant.character.escape.newline.css
    - match: '\\(\h{1,6}|.)'
      scope: constant.character.escape.css

  # https://www.w3.org/TR/css3-values/#numeric-types
  numeric-values:
    - include: dimensions
    - include: percentage-type
    - include: number-type

  integer-type:
    - match: '{{integer}}'
      scope: constant.numeric.css

  # Make sure `number-type` is included after any other numeric values
  # as `number-type` will consume all numeric values.
  number-type:
    - match: '{{number}}'
      scope: constant.numeric.css

  percentage-type:
    - match: '{{number}}(%)'
      scope: constant.numeric.css
      captures:
        1: keyword.other.unit.css

  dimensions:
    - include: angle-type
    - include: frequency-type
    - include: length-type
    - include: resolution-type
    - include: time-type

  length-type:
    - match: '{{number}}({{font_relative_lengths}}|{{viewport_percentage_lengths}}|{{absolute_lengths}})\b'
      scope: constant.numeric.css
      captures:
        1: keyword.other.unit.css
    - match: '0\b(?!%)'
      scope: constant.numeric.css

  time-type:
    - match: '{{number}}({{duration_units}})\b'
      scope: constant.numeric.css
      captures:
        1: keyword.other.unit.css

  frequency-type:
    - match: '{{number}}({{frequency_units}})\b'
      scope: constant.numeric.css
      captures:
        1: keyword.other.unit.css

  resolution-type:
    - match: '{{number}}({{resolution_units}})\b'
      scope: constant.numeric.css
      captures:
        1: keyword.other.unit.css

  angle-type:
    - match: '{{number}}({{angle_units}})\b'
      scope: constant.numeric.css
      captures:
        1: keyword.other.unit.css

  # https://drafts.csswg.org/css-images-3/#typedef-image
  image-type:
    - include: cross-fade-function
    - include: gradient-functions
    - include: image-function
    - include: image-set-function
    - include: url-function

================================================
FILE: assets/syntax/large/html.sublime-syntax
================================================
%YAML 1.2
---
name: HTML
file_extensions:
  - html
  - htm
  - shtml
  - xhtml
  - inc
  - tmpl
  - tpl
first_line_match: (?i)<(!DOCTYPE\s*)?html
scope: text.html.basic
contexts:
  main:
    - match: (<\?)(xml)
      captures:
        1: punctuation.definition.tag.begin.html
        2: entity.name.tag.xml.html
      push:
        - meta_scope: meta.tag.preprocessor.xml.html
        - match: '\?>'
          scope: punctuation.definition.tag.end.html
          pop: true
        - include: tag-generic-attribute
        - include: string-double-quoted
        - include: string-single-quoted
    - match: <!--
      scope: punctuation.definition.comment.begin.html
      push:
        - meta_scope: comment.block.html
        - match: '(-*)--\s*>'
          scope: punctuation.definition.comment.end.html
          captures:
            1: invalid.illegal.bad-comments-or-CDATA.html
          pop: true
        - match: -{2,}
          scope: invalid.illegal.bad-comments-or-CDATA.html
    - match: <!
      scope: punctuation.definition.tag.html
      push:
        - meta_scope: meta.tag.sgml.html
        - match: ">"
          scope: punctuation.definition.tag.html
          pop: true
        - match: (?i:DOCTYPE)
          scope: entity.name.tag.doctype.html
          push:
            - meta_scope: meta.tag.sgml.doctype.html
            - match: (?=>)
              pop: true
            - match: '"[^">]*"'
              scope: string.quoted.double.doctype.identifiers-and-DTDs.html
        - match: '\[CDATA\['
          push:
            - meta_scope: constant.other.inline-data.html
            - match: "]](?=>)"
              pop: true
        - match: (\s*)(?!--|>)\S(\s*)
          scope: invalid.illegal.bad-comments-or-CDATA.html
    - match: (</?)([a-z_][a-z0-9:_]*-[a-z0-9:_-]+)
      captures:
        1: punctuation.definition.tag.begin.html
        2: entity.name.tag.custom.html
      push:
        - meta_scope: meta.tag.custom.html
        - match: '(?: ?/)?>'
          scope: punctuation.definition.tag.end.html
          pop: true
        - include: tag-stuff
    - match: '(?:^\s+)?(<)((?i:style))\b(?![^>]*/>)'
      captures:
        0: meta.tag.style.begin.html
        1: punctuation.definition.tag.begin.html
        2: entity.name.tag.style.html
      push:
        - match: (?i)(</)(style)(>)
          captures:
            0: meta.tag.style.end.html
            1: punctuation.definition.tag.begin.html
            2: entity.name.tag.style.html
            3: punctuation.definition.tag.end.html
          pop: true
        - match: '(>)\s*'
          captures:
            1: meta.tag.style.begin.html punctuation.definition.tag.end.html
          embed: scope:source.css
          embed_scope: source.css.embedded.html
          escape: (?i)(?=</style)
        - match: ''
          push:
            - meta_scope: meta.tag.style.begin.html
            - match: '(?=>)'
              pop: true
            - include: tag-stuff
    - match: '(<)((?i:script))\b(?![^>]*/>)(?![^>]*(?i:type.?=.?text/((?!javascript).*)))'
      captures:
        0: meta.tag.script.begin.html
        1: punctuation.definition.tag.begin.html
        2: entity.name.tag.script.html
      push:
        - match: (?i)(-->)?\s*(</)(script)(>)
          captures:
            0: meta.tag.script.end.html
            1: comment.block.html punctuation.definition.comment.html
            2: punctuation.definition.tag.begin.html
            3: entity.name.tag.script.html
            4: punctuation.definition.tag.end.html
          pop: true
        - match: '(>)\s*(<!--)?'
          captures:
            1: meta.tag.script.begin.html punctuation.definition.tag.end.html
            2: comment.block.html punctuation.definition.comment.html
          embed: scope:source.js
          embed_scope: source.js.embedded.html
          escape: (?i)(?=(-->)?\s*</script)
        - match: ''
          push:
            - meta_scope: meta.tag.script.begin.html
            - match: '(?=>)'
              pop: true
            - include: tag-stuff
    - match: (</?)((?i:body|head|html)\b)
      captures:
        1: punctuation.definition.tag.begin.html
        2: entity.name.tag.structure.any.html
      push:
        - meta_scope: meta.tag.structure.any.html
        - match: '>'
          scope: punctuation.definition.tag.end.html
          pop: true
        - include: tag-stuff
    - match: (</?)((?i:address|blockquote|dd|div|section|article|aside|header|footer|nav|menu|dl|dt|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|pre)\b)
      captures:
        1: punctuation.definition.tag.begin.html
        2: entity.name.tag.block.any.html
      push:
        - meta_scope: meta.tag.block.any.html
        - match: '>'
          scope: punctuation.definition.tag.end.html
          pop: true
        - include: tag-stuff
    - match: (</?)((?i:hr)\b)
      captures:
        1: punctuation.definition.tag.begin.html
        2: entity.name.tag.block.any.html
      push:
        - meta_scope: meta.tag.block.any.html
        - match: '(?: ?/)?>'
          scope: punctuation.definition.tag.end.html
          pop: true
        - include: tag-stuff
    - match: (</?)((?i:form|fieldset)\b)
      captures:
        1: punctuation.definition.tag.begin.html
        2: entity.name.tag.block.form.html
      push:
        - meta_scope: meta.tag.block.form.html
        - match: '>'
          scope: punctuation.definition.tag.end.html
          pop: true
        - include: tag-stuff
    - match: (</?)((?i:abbr|acronym|area|b|base|basefont|bdo|big|br|caption|cite|code|del|dfn|em|font|head|html|i|img|ins|isindex|kbd|li|link|map|meta|noscript|param|q|s|samp|script|small|span|strike|strong|style|sub|sup|title|tt|u|var)\b)
      captures:
        1: punctuation.definition.tag.begin.html
        2: entity.name.tag.inline.any.html
      push:
        - meta_scope: meta.tag.inline.any.html
        - match: '(?: ?/)?>'
          scope: punctuation.definition.tag.end.html
          pop: true
        - include: tag-stuff
    - match: (</?)((?i:button|input|label|legend|optgroup|option|select|textarea)\b)
      captures:
        1: punctuation.definition.tag.begin.html
        2: entity.name.tag.inline.form.html
      push:
        - meta_scope: meta.tag.inline.form.html
        - match: '(?: ?/)?>'
          scope: punctuation.definition.tag.end.html
          pop: true
        - include: tag-stuff
    - match: (</?)((?i:a)\b)
      captures:
        1: punctuation.definition.tag.begin.html
        2: entity.name.tag.inline.a.html
      push:
        - meta_scope: meta.tag.inline.a.html
        - match: '(?: ?/)?>'
          scope: punctuation.definition.tag.end.html
          pop: true
        - include: tag-stuff
    - match: (</?)((?i:col|colgroup|table|tbody|td|tfoot|th|thead|tr)\b)
      captures:
        1: punctuation.definition.tag.begin.html
        2: entity.name.tag.inline.table.html
      push:
        - meta_scope: meta.tag.inline.table.html
        - match: '(?: ?/)?>'
          scope: punctuation.definition.tag.end.html
          pop: true
        - include: tag-stuff
    - match: (</?)([A-Za-z0-9:_]+-[A-Za-z0-9:_-]+)
      captures:
        1: punctuation.definition.tag.begin.html
        2: invalid.illegal.uppercase-custom-tag-name.html
      push:
        - meta_scope: meta.tag.custom.html
        - match: '(?: ?/)?>'
          scope: punctuation.definition.tag.end.html
          pop: true
        - include: tag-stuff
    - match: "(</?)([a-zA-Z0-9:]+)"
      captures:
        1: punctuation.definition.tag.begin.html
        2: entity.name.tag.other.html
      push:
        - meta_scope: meta.tag.other.html
        - match: '(?: ?/)?>'
          scope: punctuation.definition.tag.end.html
          pop: true
        - include: tag-stuff
    - include: entities
    - match: <>
      scope: invalid.illegal.incomplete.html
  entities-common:
    - match: "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)"
      scope: constant.character.entity.html
      captures:
        1: punctuation.definition.entity.html
        3: punctuation.definition.entity.html
  attribute-entities:
    - include: entities-common
  entities:
    - include: entities-common
    - match: "&"
      scope: invalid.illegal.bad-ampersand.html
  string-double-quoted:
    - match: '"'
      scope: punctuation.definition.string.begin.html
      push:
        - meta_scope: string.quoted.double.html
        - match: '"'
          scope: punctuation.definition.string.end.html
          pop: true
        - include: entities
  string-single-quoted:
    - match: "'"
      scope: punctuation.definition.string.begin.html
      push:
        - meta_scope: string.quoted.single.html
        - match: "'"
          scope: punctuation.definition.string.end.html
          pop: true
        - include: entities

  tag-generic-attribute:
    - match: '(?:^|\s+)(([a-zA-Z0-9:\-_.]+)\s*(=)\s*)'
      captures:
        1: meta.attribute-with-value.html
        2: entity.other.attribute-name.html
        3: punctuation.separator.key-value.html
      push:
        - match: '"'
          scope: punctuation.definition.string.begin.html
          set:
            - meta_scope: meta.attribute-with-value.html string.quoted.double.html
            - match: '"'
              scope: punctuation.definition.string.end.html
              pop: true
            - include: attribute-entities
        - match: "'"
          scope: punctuation.definition.string.begin.html
          set:
            - meta_scope: meta.attribute-with-value.html string.quoted.single.html
            - match: "'"
              scope: punctuation.definition.string.end.html
              pop: true
            - include: attribute-entities
        - match: '(?:[^\s<>/''"]|/(?!>))+'
          scope: meta.attribute-with-value.html string.unquoted.html
        - match: ''
          pop: true
    - match: '\s+([a-zA-Z0-9:\-_.]+)'
      captures:
        1: entity.other.attribute-name.html

  tag-class-attribute:
    - match: '(?:^|\s+)\b((class)\b\s*(=)\s*)'
      captures:
        1: meta.attribute-with-value.class.html
        2: entity.other.attribute-name.class.html
        3: punctuation.separator.key-value.html
      push:
        - match: '"'
          scope: punctuation.definition.string.begin.html
          set:
            - meta_scope: meta.attribute-with-value.class.html string.quoted.double.html
            - meta_content_scope: meta.class-name.html
            - match: '"'
              scope: punctuation.definition.string.end.html
              pop: true
            - include: attribute-entities
        - match: "'"
          scope: punctuation.definition.string.begin.html
          set:
            - meta_scope: meta.attribute-with-value.class.html string.quoted.single.html
            - meta_content_scope: meta.class-name.html
            - match: "'"
              scope: punctuation.definition.string.end.html
              pop: true
            - include: attribute-entities
        - match: '(?:[^\s<>/''"]|/(?!>))+'
          scope: meta.attribute-with-value.class.html string.unquoted.html meta.class-name.html
        - match: ''
          pop: true

  tag-id-attribute:
    - match: '(?:^|\s+)\b((id)\b\s*(=)\s*)'
      captures:
        1: meta.attribute-with-value.id.html
        2: entity.other.attribute-name.id.html
        3: punctuation.separator.key-value.html
      push:
        - match: '"'
          scope: punctuation.definition.string.begin.html
          set:
            - meta_scope: meta.attribute-with-value.id.html string.quoted.double.html
            - meta_content_scope: meta.toc-list.id.html
            - match: '"'
              scope: punctuation.definition.string.end.html
              pop: true
            - include: attribute-entities
        - match: "'"
          scope: punctuation.definition.string.begin.html
          set:
            - meta_scope: meta.attribute-with-value.id.html string.quoted.single.html
            - meta_content_scope: meta.toc-list.id.html
            - match: "'"
              scope: punctuation.definition.string.end.html
              pop: true
            - include: attribute-entities
        - match: '(?:[^\s<>/''"]|/(?!>))+'
          scope: meta.attribute-with-value.id.html string.unquoted.html meta.toc-list.id.html
        - match: ''
          pop: true

  tag-style-attribute:
    - match: '(?:^|\s+)\b((style)\b\s*(=)\s*)'
      captures:
        1: meta.attribute-with-value.style.html
        2: entity.other.attribute-name.style.html
        3: punctuation.separator.key-value.html
      push:
        - match: '"'
          scope: meta.attribute-with-value.style.html string.quoted.double punctuation.definition.string.begin.html
          embed: scope:source.css#rule-list-body
          embed_scope: meta.attribute-with-value.style.html source.css
          escape: '"'
          escape_captures:
            0: meta.attribute-with-value.style.html string.quoted.double punctuation.definition.string.end.html
        - match: "'"
          scope: meta.attribute-with-value.style.html string.quoted.single punctuation.definition.string.begin.html
          embed: scope:source.css#rule-list-body
          embed_scope: meta.attribute-with-value.style.html source.css
          escape: "'"
          escape_captures:
            0: meta.attribute-with-value.style.html string.quoted.single punctuation.definition.string.end.html
        - match: ''
          pop: true

  tag-event-attribute:
    - match: |-
        (?x)\s*\b((
        onabort|onautocomplete|onautocompleteerror|onblur|oncancel|oncanplay|
        oncanplaythrough|onchange|onclick|onclose|oncontextmenu|oncuechange|
        ondblclick|ondrag|ondragend|ondragenter|ondragexit|ondragleave|ondragover|
        ondragstart|ondrop|ondurationchange|onemptied|onended|onerror|onfocus|
        oninput|oninvalid|onkeydown|onkeypress|onkeyup|onload|onloadeddata|
        onloadedmetadata|onloadstart|onmousedown|onmouseenter|onmouseleave|
        onmousemove|onmouseout|onmouseover|onmouseup|onmousewheel|onpause|onplay|
        onplaying|onprogress|onratechange|onreset|onresize|onscroll|onseeked|
        onseeking|onselect|onshow|onsort|onstalled|onsubmit|onsuspend|
        ontimeupdate|ontoggle|onvolumechange|onwaiting)\b\s*(=)\s*)
      captures:
        1: meta.attribute-with-value.event.html
        2: entity.other.attribute-name.event.html
        3: punctuation.separator.key-value.html
      push:
        - match: '"'
          scope: meta.attribute-with-value.event.html string.quoted.double punctuation.definition.string.begin.html
          embed: scope:source.js
          embed_scope: meta.attribute-with-value.event.html
          escape: '"'
          escape_captures:
            0: meta.attribute-with-value.event.html string.quoted.double punctuation.definition.string.end.html
        - match: "'"
          scope: string.quoted.single punctuation.definition.string.begin.html meta.attribute-with-value.event.html
          embed: scope:source.js
          embed_scope: meta.attribute-with-value.event.html
          escape: "'"
          escape_captures:
            0: meta.attribute-with-value.event.html string.quoted.single punctuation.definition.string.end.html
        - match: ''
          pop: true

  tag-stuff:
    - include: tag-id-attribute
    - include: tag-class-attribute
    - include: tag-style-attribute
    - include: tag-event-attribute
    - include: tag-generic-attribute

================================================
FILE: assets/syntax/large/js.sublime-syntax
================================================
%YAML 1.2
---
# Derived from JavaScript Next: https://github.com/Benvie/JavaScriptNext.tmLanguage
name: JavaScript
file_extensions:
  - js
  - htc
first_line_match: ^#!\s*/.*\b(node|js)\b
scope: source.js
variables:
  identifier: '[_$[:alpha:]][_$[:alnum:]]*'
  constant_identifier: '[[:upper:]][_$[:digit:][:upper:]]*\b'
  dollar_only_identifier: '\$(?![_$[:alnum:]])'
  dollar_identifier: '(\$)[_$[:alnum:]]+'
  func_lookahead: '\s*\b(async\s+)?function\b'
  arrow_func_lookahead: '\s*(\basync\s*)?([_$[:alpha:]][_$[:alnum:]]*|\(([^()]|\([^()]*\))*\))\s*=>'

  method_name: >-
    (?x)(?:
      {{identifier}}
      | '(?:[^\\']|\\.)*'
      | "(?:[^\\"]|\\.)*"
      | \[ {{identifier}} (?:\.{{identifier}})* \]
    )

  line_continuation_lookahead: >-
    (?x)
    (?! \+\+ | -- )
    (?=
      != |
      [ -+*/% ><= &|^ \[( ;,.:? ]
    )

contexts:
  main:
    - include: comments
    - include: comments-top-level
    - include: keywords-top-level
    - include: statements

  prototype:
    - include: comments

  comments:
    - match: /\*\*(?!/)
      scope: punctuation.definition.comment.js
      push:
        - meta_include_prototype: false
        - meta_scope: comment.block.documentation.js
        - match: \*/
          scope: punctuation.definition.comment.js
          pop: true
    - match: /\*
      scope: punctuation.definition.comment.js
      push:
        - meta_include_prototype: false
        - meta_scope: comment.block.js
        - match: \*/
          scope: punctuation.definition.comment.js
          pop: true
    - match: //
      scope: punctuation.definition.comment.js
      push:
        - meta_include_prototype: false
        - meta_scope: comment.line.double-slash.js
        - match: \n
          pop: true

  comments-top-level:
    - match: ^(#!).*$\n?
      scope: comment.line.shebang.js
      captures:
        1: punctuation.definition.comment.js

  else-pop:
    - match: (?=\S)
      pop: true

  immediately-pop:
    - match: ''
      pop: true

  comma-separator:
    - match: ','
      scope: punctuation.separator.comma.js

  keywords-top-level:
    - match: \bimport\b
      scope: keyword.control.import-export.js
      push:
        - import-meta
        - import-export-final
        - import-extended

    - match: \bexport\b
      scope: keyword.control.import-export.js
      push:
        - export-meta
        - export-extended

    - match: \b(export|default|from|as)\b
      scope: keyword.control.import-export.js

  import-meta:
    - meta_scope: meta.import.js
    - include: immediately-pop

  import-export-alias:
    - match: \bas\b
      scope: keyword.control.import-export.js
      set:
        - match: \bdefault\b
          scope: keyword.control.import-export.js
          pop: true
        - match: '{{identifier}}'
          scope: variable.other.readwrite.js
          pop: true
        - include: else-pop
    - include: else-pop

  import-export-final:
    - match: '\bfrom\b'
      scope: keyword.control.import-export.js
    - match: (?=['"])
      push: literal-string
    - include: else-pop

  import-extended:
    - match: (?='|")
      pop: true
    - match: (?=\S)
      set:
        - import-list
        - import-export-alias
        - import-item

  import-list:
    - match: ','
      scope: punctuation.separator.comma.js
      push:
        - import-export-alias
        - import-item
    - include: else-pop

  import-item:
    - match: '\{'
      scope: punctuation.section.block.js
      set: import-brace
    - match: '{{identifier}}'
      scope: variable.other.readwrite.js
      pop: true
    - match: '\*'
      scope: constant.other.js
      pop: true
    - include: else-pop

  import-brace:
    - meta_scope: meta.block.js
    - include: comma-separator
    - match: '\}'
      scope: punctuation.section.block.js
      pop: true
    - match: '{{identifier}}'
      scope: variable.other.readwrite.js
      push: import-export-alias
    - match: '\*'
      scope: constant.other.js
      push: import-export-alias
    - include: else-pop

  export-meta:
    - meta_scope: meta.export.js
    - include: immediately-pop

  export-extended:
    - include: variable-declaration

    - match: '\bdefault\b'
      scope: keyword.control.import-export.js
      set:
        - match: (?=\bclass\b)
          set: class

        - match: (?=\bfunction\b)
          set: function-declaration

        - include: expression

    - match: (?=\S)
      set:
        - import-export-final
        - export-list
        - import-export-alias
        - export-item

  export-list:
    - match: ','
      scope: punctuation.separator.comma.js
      push:
        - import-export-alias
        - export-item
    - include: else-pop

  export-item:
    - match: '\{'
      scope: punctuation.section.block.js
      set:
        - export-brace
    - match: '{{identifier}}'
      scope: variable.other.readwrite.js
      pop: true
    - match: '\*'
      scope: constant.other.js
      pop: true
    - include: else-pop

  export-brace:
    - meta_scope: meta.block.js
    - include: comma-separator
    - match: '\}'
      scope: punctuation.section.block.js
      pop: true
    - match: '{{identifier}}'
      scope: variable.other.readwrite.js
      push: import-export-alias
    - match: '\*'
      scope: constant.other.js
      push: import-export-alias
    - include: else-pop

  statements:
    - match: \;
      scope: punctuation.terminator.statement.js

    - include: conditional
    - match: '\{'
      scope: punctuation.section.block.js
      push:
        - meta_scope: meta.block.js
        - match: '\}'
          scope: punctuation.section.block.js
          pop: true
        - include: statements
    - include: label

    - include: variable-declaration

    - match: \bthrow\b
      scope: keyword.control.trycatch.js
      push: restricted-production

    - match: \b(break|continue|goto)\b
      scope: keyword.control.loop.js

    - match: \b(yield)\b(?:\s*(\*))?
      captures:
        1: keyword.control.flow.js
        2: keyword.generator.asterisk.js
      push: restricted-production

    - match: \b(await|return)\b
      scope: keyword.control.flow.js
      push: restricted-production

    - include: function-or-class-declaration

    - match: (?=\S)
      push: expression-statement

  variable-declaration:
    - match: \b(const|let|var)\b
      scope: storage.type.js
      push: expression-statement

  function-or-class-declaration:
    - match: (?=\bclass\b)
      push: class

    - match: (?=\bfunction\b)
      push: function-declaration

  expression-statement:
    - match: (?=\S)
      set: [ expression-statement-end, expression-begin ]

  expression-statement-end:
    - match: \n
      set:
        - match: '{{line_continuation_lookahead}}'
          set: expression-statement-end
        - include: else-pop
    - include: expression-end

  restricted-production:
    - match: \n
      pop: true
    - match: (?=\S)
      set: expression-statement

  expect-case-colon:
    - match: ':'
      scope: punctuation.separator.js
      pop: true
    - include: else-pop

  conditional:
    - match: \bswitch\b
      scope: keyword.control.switch.js
      push:
        - meta_scope: meta.switch.js
        - match: (?=\()
          push: parenthesized-expression
        - match: '\}'
          scope: meta.block.js punctuation.section.block.js
          pop: true
        - match: '\{'
          scope: punctuation.section.block.js
          push:
            - meta_scope: meta.block.js

            - match: '(?=\})'
              pop: true

            - match: \b(case)\b
              scope: keyword.control.switch.js
              push:
                - expect-case-colon
                - expression

            - match: \b(default)\b
              scope: keyword.control.switch.js
              push:
                - expect-case-colon

            - include: statements

    - match: \bdo\b
      scope: keyword.control.loop.js
      push:
        - meta_scope: meta.do-while.js
        - match: '\{'
          scope: punctuation.section.block.js
          push:
            - meta_scope: meta.block.js
            - match: '\}'
              scope: punctuation.section.block.js
              pop: true
            - include: statements
        - match: \bwhile\b
          scope: keyword.control.loop.js
        - match: '\('
          scope: punctuation.section.group.js
          push:
            - meta_scope: meta.group.js
            - match: '(?=\))'
              pop: true
            - match: (?=\S)
              push: expression
        - match: '\)'
          scope: meta.group.js punctuation.section.group.js
          pop: true

    - match: \bfor\b
      scope: keyword.control.loop.js
      push:
        - meta_scope: meta.for.js
        - include: parens-block-scope

    - match: \bwhile\b
      scope: keyword.control.loop.js
      push:
        - meta_scope: meta.while.js
        - include: parens-block-scope

    - match: \bwith\b
      scope: keyword.control.with.js
      push:
        - meta_scope: meta.with.js
        - include: parens-block-scope

    - match: \b(else\s+if|if)\b
      scope: keyword.control.conditional.js
      push:
        - meta_scope: meta.conditional.js
        - include: parens-block-scope

    - match: \belse\b
      scope: keyword.control.conditional.js
      push:
        - meta_scope: meta.conditional.js
        - include: block-scope

    - match: \btry\b
      scope: keyword.control.trycatch.js
      push:
        - meta_scope: meta.try.js
        - include: block-scope

    - match: \bfinally\b
      scope: keyword.control.trycatch.js
      push:
        - meta_scope: meta.finally.js
        - include: block-scope

    - match: \bcatch\b
      scope: keyword.control.trycatch.js
      push:
        - meta_scope: meta.catch.js
        - include: parens-block-scope

  parens-block-scope:
    - match: '\('
      scope: punctuation.section.group.js
      push:
        - meta_scope: meta.group.js
        - match: '\)'
          scope: punctuation.section.group.js
          pop: true

        - match: ;
          scope: punctuation.terminator.statement.js

        - match: \b(const|let|var)\b
          scope: storage.type.js

        - include: expression-list
    - include: block-scope

  block-scope:
    - match: '\}'
      scope: meta.block.js punctuation.section.block.js
      pop: true
    - match: '\{'
      scope: punctuation.section.block.js
      push:
        - meta_scope: meta.block.js
        - match: (?=})
          pop: true
        - include: statements
    - include: else-pop

  block-meta:
    - meta_scope: meta.block.js
    - include: immediately-pop

  expression-break:
    - match: (?=[;})\]])
      pop: true

  expression:
    - match: (?=\S)
      set: [ expression-end, expression-begin ]

  expression-no-comma:
    - match: (?=\S)
      set: [ expression-end-no-comma, expression-begin ]

  expression-list:
    - include: expression-break
    - include: comma-separator
    - match: (?=\S)
      push: expression-no-comma

  expression-end:
    - include: expression-break

    - include: postfix-operators
    - include: binary-operators
    - include: ternary-operator

    - include: property-access
    - include: function-call

    - include: fallthrough

    - include: else-pop

  expression-end-no-comma:
    - match: (?=,)
      pop: true
    - include: expression-end

  expression-begin:
    - match: \)
      scope: invalid.illegal.stray-bracket-end.js
      pop: true

    - include: expression-break

    - include: literal-prototype

    - include: regexp-complete
    - include: literal-string
    - include: literal-string-template
    - include: constructor
    - include: prefix-operators

    - include: class
    - include: constants
    - include: function-assignment
    - include: either-function-declaration
    - include: object-literal

    - include: parenthesized-expression
    - include: array-literal

    - include: literal-number
    - include: literal-call
    - include: literal-variable

    - include: else-pop

  fallthrough:
    # If an arrow function has the ( and ) on different lines, we won't have matched
    - match: =>
      scope: storage.type.function.arrow.js

  literal-string:
    - match: "'"
      scope: punctuation.definition.string.begin.js
      set:
        - meta_include_prototype: false
        - meta_scope: string.quoted.single.js
        - match: (')|(\n)
          captures:
            1: punctuation.definition.string.end.js
            2: invalid.illegal.newline.js
          pop: true
        - include: string-content
    - match: '"'
      captures:
        0: punctuation.definition.string.begin.js
      set:
        - meta_include_prototype: false
        - meta_scope: string.quoted.double.js
        - match: (")|(\n)
          captures:
            1: punctuation.definition.string.end.js
            2: invalid.illegal.newline.js
          pop: true
        - include: string-content

  literal-string-template:
    - match: '({{identifier}})?(`)'
      captures:
        1: variable.function.tagged-template.js
        2: punctuation.definition.string.template.begin.js
      set:
        - meta_include_prototype: false
        - meta_scope: string.template.js
        - match: "`"
          scope: punctuation.definition.string.template.end.js
          pop: true
        - match: '\$\{'
          captures:
            0: punctuation.definition.template-expression.begin.js
          push:
            - clear_scopes: 1
            - meta_scope: meta.template.expression.js
            - meta_content_scope: source.js.embedded.expression
            - match: '\}'
              scope: punctuation.definition.template-expression.end.js
              pop: true
            - match: (?=\S)
              push: expression
        - include: string-content

  string-content:
    - match: \\\s*\n
      scope: constant.character.escape.newline.js
    - match: '\\(x[\da-fA-F][\da-fA-F]|u[\da-fA-F][\da-fA-F][\da-fA-F][\da-fA-F]|.)'
      scope: constant.character.escape.js

  regexp-complete:
    - match: '/'
      scope: punctuation.definition.string.begin.js
      set: regexp

  regexp:
      - meta_include_prototype: false
      - meta_scope: string.regexp.js
      - match: "(/)([gimyu]*)"
        captures:
          1: punctuation.definition.string.end.js
          2: keyword.other.js
        pop: true
      - match: '(?=.|\n)'
        push:
          - meta_include_prototype: false
          - match: '(?=/)'
            pop: true
          - include: scope:source.regexp.js

  constructor:
    - match: '\bnew\b'
      scope: keyword.operator.word.new.js
      set:
        - constructor-meta
        - constructor-body

  constructor-meta:
    - meta_scope: meta.instance.constructor.js
    - include: immediately-pop

  constructor-body:
    - match: ''
      set:
        - constructor-body-meta
        - constructor-body-expect-arguments
        - constructor-body-expect-property-access
        - constructor-body-expect-class

  constructor-body-meta:
    - meta_scope: meta.function-call.constructor.js
    - include: immediately-pop

  constructor-body-expect-arguments:
    - match: '(?=\()'
      set: function-call-params
    - include: else-pop

  constructor-body-expect-property-access:
    - include: property-access
    - include: else-pop

  constructor-body-expect-class:
    - include: expression-break

    - include: regexp-complete
    - include: literal-string
    - include: literal-string-template

    - include: class
    - include: constants
    - include: either-function-declaration
    - include: object-literal

    - include: parenthesized-expression
    - include: array-literal

    - include: literal-number

    - include: well-known-identifiers
    - include: language-identifiers

    - match: '{{dollar_only_identifier}}'
      scope: variable.type.dollar.only.js punctuation.dollar.js
    - match: '{{dollar_identifier}}'
      scope: variable.type.dollar.js
      captures:
        1: punctuation.dollar.js
    - match: '{{identifier}}'
      scope: variable.type.js
      pop: true

    - include: else-pop

  prefix-operators:
    - match: '~'
      scope: keyword.operator.bitwise.js
    - match: '!(?!=)'
      scope: keyword.operator.logical.js
    - match: '--'
      scope: keyword.operator.arithmetic.js
    - match: '\+\+'
      scope: keyword.operator.arithmetic.js
    - match: \.\.\.
      scope: keyword.operator.spread.js
    - match: \+|\-
      scope: keyword.operator.arithmetic.js

    - match: \bnew\b
      scope: keyword.operator.word.new.js
    - match: \b(?:delete|typeof|void)\b
      scope: keyword.operator.js

  binary-operators:
    - match: \binstanceof\b
      scope: keyword.operator.js
      push: expression-begin
    - match: \b(in|of)\b
      scope: keyword.operator.js
      push: expression-begin
    - match: '&&|\|\|'
      scope: keyword.operator.logical.js
      push: expression-begin
    - match: '=(?![=>])'
      scope: keyword.operator.assignment.js
      push: expression-begin
    - match: |-
        (?x)
        %=   | # assignment      right-to-left   both
        &=   | # assignment      right-to-left   both
        \*=  | # assignment      right-to-left   both
        \+=  | # assignment      right-to-left   both
        -=   | # assignment      right-to-left   both
        /=   | # assignment      right-to-left   both
        \^=  | # assignment      right-to-left   both
        \|=  | # assignment      right-to-left   both
        <<=  | # assignment      right-to-left   both
        >>=  | # assignment      right-to-left   both
        >>>=   # assignment      right-to-left   both
      scope: keyword.operator.assignment.augmented.js
      push: expression-begin
    - match: |-
        (?x)
        <<   | # bitwise-shift   left-to-right   both
        >>>  | # bitwise-shift   left-to-right   both
        >>   | # bitwise-shift   left-to-right   both
        &    | # bitwise-and     left-to-right   both
        \^   | # bitwise-xor     left-to-right   both
        \|     # bitwise-or      left-to-right   both
      scope: keyword.operator.bitwise.js
      push: expression-begin
    - match: |-
        (?x)
        <=   | # relational      left-to-right   both
        >=   | # relational      left-to-right   both
        <    | # relational      left-to-right   both
        >      # relational      left-to-right   both
      scope: keyword.operator.relational.js
      push: expression-begin
    - match: |-
        (?x)
        ===  | # equality        left-to-right   both
        !==  | # equality        left-to-right   both
        ==   | # equality        left-to-right   both
        !=     # equality        left-to-right   both
      scope: keyword.operator.comparison.js
      push: expression-begin
    - match: |-
        (?x)
        /    | # division        left-to-right   both
        %    | # modulus         left-to-right   both
        \*   | # multiplication  left-to-right   both
        \+   | # addition        left-to-right   both
        -      # subtraction     left-to-right   both
      scope: keyword.operator.arithmetic.js
      push: expression-begin
    - match: ','
      scope: punctuation.separator.comma.js # TODO: Change to keyword.operator.comma.js ?
      push: expression-begin

  ternary-operator:
    - match: '\?'
      scope: keyword.operator.ternary.js
      set:
        - ternary-operator-expect-colon
        - expression-no-comma

  ternary-operator-expect-colon:
    - match: ':'
      scope: keyword.operator.ternary.js
      set: expression-no-comma
    - include: else-pop

  postfix-operators:
    - match: '--'
      scope: keyword.operator.arithmetic.js
    - match: '\+\+'
      scope: keyword.operator.arithmetic.js

  class:
    - match: \bclass\b
      scope: storage.type.class.js
      set:
        - meta_scope: meta.class.js
        - match: '\{'
          scope: punctuation.section.block.js
          set: class-body
        - match: '\b(extends)\b\s+(?={{identifier}})'
          captures:
            1: storage.modifier.extends.js
          push:
            - match: '{{identifier}}'
              scope: entity.other.inherited-class.js
            - match: '\.'
              scope: punctuation.accessor.js
            - include: else-pop
        - match: '{{identifier}}'
          scope: entity.name.class.js

  class-body:
    - meta_scope: meta.class.js meta.block.js
    - match: '\}'
      scope: punctuation.section.block.js
      pop: true
    - include: method-declaration

  constants:
    - match: \btrue\b
      scope: constant.language.boolean.true.js
      pop: true
    - match: \bfalse\b
      scope: constant.language.boolean.false.js
      pop: true
    - match: \bnull\b
      scope: constant.language.null.js
      pop: true
    - match: \bundefined\b
      scope: constant.language.undefined.js
      pop: true
    - match: \bNaN\b
      scope: constant.language.nan.js
      pop: true

  literal-prototype:
    - match: '({{identifier}})\s*(\.)\s*(prototype)(?=\s*=\s*({{func_lookahead}}|{{arrow_func_lookahead}}))'
      scope: meta.prototype.declaration.js
      captures:
        1: support.class.js
        2: punctuation.accessor.js
        3: support.constant.prototype.js
      set:
        - meta_scope: meta.function.declaration.js
        - match: '='
          scope: keyword.operator.assignment.js
        - match: '(?={{func_lookahead}})'
          set: function-declaration
        - match: '(?={{arrow_func_lookahead}})'
          set: arrow-function-declaration
        - include: else-pop
    - match: '({{identifier}})\s*(\.)\s*(prototype)\s*(\.)\s*(?={{identifier}}\s*=\s*({{func_lookahead}}|{{arrow_func_lookahead}}))'
      captures:
        1: support.class.js
        2: punctuation.accessor.js
        3: support.constant.prototype.js
        4: punctuation.accessor.js
      set:
        - meta_scope: meta.function.declaration.js
        - match: '(?={{func_lookahead}})'
          set: function-declaration
        - match: '(?={{arrow_func_lookahead}})'
          set: arrow-function-declaration
        - include: function-declaration-final-identifier
    - match: '({{identifier}})(\.)(prototype)\b'
      scope: meta.prototype.access.js
      captures:
        1: support.class.js
        2: punctuation.accessor.js
        3: support.constant.prototype.js
      pop: true

  function-assignment:
    - match: '(?=(({{identifier}})\s*(\.)\s*)+({{identifier}})\s*(=)\s*({{func_lookahead}}|{{arrow_func_lookahead}}))'
      set:
        - meta_scope: meta.function.declaration.js
        - match: '(?={{func_lookahead}})'
          set: function-declaration
        - match: '(?={{arrow_func_lookahead}})'
          set: arrow-function-declaration
        - include: function-declaration-identifiers
    - match: '(?=({{identifier}})\s*(=)\s*({{func_lookahead}}|{{arrow_func_lookahead}}))'
      set:
        - meta_scope: meta.function.declaration.js
        - match: '(?={{func_lookahead}})'
          set: function-declaration
        - match: '(?={{arrow_func_lookahead}})'
          set: arrow-function-declaration
        - include: function-declaration-single-identifier

  function-declaration-identifiers:
    - match: '(?={{identifier}}\s*\.)'
      push:
        - function-declaration-identifiers-expect-dot
        - function-declaration-identifiers-expect-class
    - include: function-declaration-final-identifier

  function-declaration-identifiers-expect-dot:
    - match: '\.'
      scope: punctuation.accessor.js
      pop: true
    - include: else-pop

  function-declaration-identifiers-expect-class:
    - match: '\bprototype\b'
      scope: support.constant.prototype.js
    - include: language-identifiers
    - match: '{{dollar_only_identifier}}'
      scope: support.class.dollar.only.js punctuation.dollar.js
    - match: '{{dollar_identifier}}'
      scope: support.class.dollar.js
      captures:
        1: punctuation.dollar.js
    - match: '{{identifier}}'
      scope: support.class.js
    - include: else-pop

  function-declaration-final-identifier:
    - match: '(?={{identifier}}\s*(=)\s*)'
      push:
        - match: '{{dollar_only_identifier}}'
          scope: meta.property.object.dollar.only.js punctuation.dollar.js entity.name.function.js
        - match: '{{dollar_identifier}}'
          scope: meta.property.object.dollar.js entity.name.function.js
          captures:
            1: punctuation.dollar.js
        - match: '{{identifier}}'
          scope: meta.property.object.js entity.name.function.js
        - match: '\s*(=)\s*'
          captures:
            1: keyword.operator.assignment.js
          pop: true

  function-declaration-single-identifier:
    - match: '\s*(=)\s*'
      captures:
        1: keyword.operator.assignment.js
    - match: '(?={{identifier}})'
      push:
        # These matches have to be duplicated to get entity.name.function
        # on the end of the scope stack since most color schemes require it
        - match: '{{dollar_only_identifier}}'
          scope: variable.other.dollar.only.js punctuation.dollar.js entity.name.function.js
        - match: '{{dollar_identifier}}'
          scope: variable.other.dollar.js entity.name.function.js
          captures:
            1: punctuation.dollar.js
        - match: '{{constant_identifier}}'
          scope: variable.other.constant.js entity.name.function.js
        - match: '{{identifier}}'
          scope: variable.other.readwrite.js entity.name.function.js
        - match: (?=.)
          pop: true

  either-function-declaration:
    - match: '(?={{func_lookahead}})'
      set: function-declaration
    - match: '(?={{arrow_func_lookahead}})'
      set: arrow-function-declaration

  function-declaration:
    - match: ''
      set:
        - function-declaration-expect-body
        - function-declaration-meta
        - function-declaration-expect-parameters
        - function-declaration-expect-name
        - function-declaration-expect-function-keyword
        - function-declaration-expect-async

  function-declaration-expect-body:
    - match: (?=\S)
      set: function-block

  function-declaration-meta:
    - meta_scope: meta.function.declaration.js
    - include: immediately-pop

  function-declaration-expect-parameters:
    - include: function-declaration-parameters
    - include: else-pop

  function-declaration-expect-name:
    - match: '{{identifier}}'
      scope: entity.name.function.js
      pop: true
    - include: else-pop

  function-declaration-expect-function-keyword:
    - match: \b(function)\b\s*(\*)?
      captures:
        1: storage.type.function.js
        2: keyword.generator.asterisk.js
      pop: true
    - include: else-pop

  function-declaration-expect-async:
    - match: '\basync\b'
      scope: storage.type.js
      pop: true
    - include: else-pop

  arrow-function-declaration:
    - match: ''
      set:
        - arrow-function-expect-body
        - function-declaration-meta
        - arrow-function-expect-arrow
        - arrow-function-expect-parameters
        - function-declaration-expect-async

  arrow-function-expect-body:
    - match: (?=\{)
      set: function-block
    - match: (?=\S)
      set:
        - block-meta
        - expression-no-comma

  arrow-function-expect-arrow:
    - match: '=>'
      scope: storage.type.function.arrow.js
      pop: true
    - include: else-pop

  arrow-function-expect-parameters:
    - match: '{{identifier}}'
      scope: variable.parameter.function.js
      pop: true
    - include: function-declaration-parameters
    - include: else-pop

  function-block:
    - meta_scope: meta.block.js
    - match: '\}'
      scope: punctuation.section.block.js
      pop: true
    - match: '\{'
      scope: punctuation.section.block.js
      push:
        - match: '(?=\})'
          pop: true
        - include: statements
    - include: else-pop

  function-declaration-parameters:
    - match: \s+
      scope: meta.function.declaration.js
    - match: \(
      scope: punctuation.section.group.begin.js
      push:
        - match: \)
          scope: punctuation.section.group.end.js
          pop: true
        # Destructuring
        - match: \{
          scope: punctuation.section.block.begin.js
          push:
            - meta_scope: meta.block.js
            - match: \}
              scope: punctuation.section.block.end.js
              pop: true
            - match: '{{identifier}}'
              scope: variable.parameter.function.js
            - match: ','
              scope: punctuation.separator.parameter.function.js
            - match: '='
              scope: keyword.operator.assignment.js
              push:
                - meta_scope: meta.parameter.optional.js
                - match: "(?=[,)}])"
                  pop: true
                - match: (?=\S)
                  push: expression-no-comma
        - match: \.\.\.
          scope: keyword.operator.spread.js
        - match: '{{identifier}}'
          scope: variable.parameter.function.js
        - match: ','
          scope: punctuation.separator.parameter.function.js
        - match: '='
          scope: keyword.operator.assignment.js
          push:
            - meta_scope: meta.parameter.optional.js
            - match: "(?=[,)])"
              pop: true
            - match: (?=\S)
              push: expression-no-comma

  label:
    - match: '({{identifier}})\s*(:)'
      captures:
        1: entity.name.label.js
        2: punctuation.separator.js

  object-literal:
    - match: '\{'
      scope: punctuation.section.block.js
      set:
        - meta_scope: meta.object-literal.js
        - match: '\}'
          scope: punctuation.section.block.js
          pop: true

        - match: >-
            (?x)(?=
              {{method_name}}\s*:
              (?: {{func_lookahead}} | {{arrow_func_lookahead}} )
            )
          push:
            - either-function-declaration
            - function-declaration-meta
            - object-literal-expect-colon
            - object-literal-meta-key
            - method-name

        - include: method-declaration

        - match: '{{identifier}}(?=\s*(?:[},]|$|//|/\*))'
          scope: variable.other.readwrite.js
        - match: \[
          scope: punctuation.section.brackets.js
          push:
            - match: \]
              scope: punctuation.section.brackets.js
              pop: true
            - match: (?=\S)
              push: expression
        - match: "(?=\"|')"
          push:
            - object-literal-meta-key
            - literal-string
        - match: '(\$)[$\w]*(?=\s*:)'
          scope: meta.object-literal.key.dollar.js
          captures:
            1: punctuation.dollar.js
        - match: '{{identifier}}(?=\s*:)'
          scope: meta.object-literal.key.js
        - match: (?=[-+]?(?:\.[0-9]|0[bxo]|\d))
          push:
            - meta_scope: meta.object-literal.key.js
            - include: literal-number

        - include: comma-separator
        - match: ':'
          scope: punctuation.separator.key-value.js
          push: expression-no-comma

  object-literal-meta-key:
    - meta_scope: meta.object-literal.key.js 
    - include: else-pop

  object-literal-expect-colon:
    - match: ':'
      scope: punctuation.separator.key-value.js
    - include: else-pop

  method-name:
    - match: '(\$)[_$[:alnum:]]*'
      scope: meta.object-literal.key.dollar.js entity.name.function.js
      captures:
        1: punctuation.dollar.js
      pop: true
    - match: '{{identifier}}'
      scope: entity.name.function.js
      pop: true
    - match: "'"
      scope: punctuation.definition.string.begin.js
      set:
        - meta_include_prototype: false
        - meta_scope: string.quoted.single.js
        - meta_content_scope: entity.name.function.js
        - match: (')|(\n)
          captures:
            1: punctuation.definition.string.end.js
            2: invalid.illegal.newline.js
          pop: true
        - include: string-content
    - match: '"'
      scope: punctuation.definition.string.begin.js
      set:
        - meta_include_prototype: false
        - meta_scope: string.quoted.double.js
        - meta_content_scope: entity.name.function.js
        - match: (")|(\n)
          captures:
            1: punctuation.definition.string.end.js
            2: invalid.illegal.newline.js
          pop: true
        - include: string-content

    - match: '(\[)({{identifier}}(?:\.{{identifier}}|\.)*)?(\])?'
      captures:
        1: punctuation.definition.symbol.begin.js
        2: entity.name.function.js
        3: punctuation.definition.symbol.end.js
      pop: true

    - include: else-pop

  method-declaration:
    - match: |-
        (?x)(?=
          \b(?: get|set|async|static )\b
          | \*
          | {{method_name}} \s* \(
        )
      push:
        - function-declaration-expect-body
        - function-declaration-meta
        - function-declaration-expect-parameters
        - method-name
        - method-declaration-expect-prefix

  method-declaration-expect-prefix:
    - match: \*
      scope: keyword.generator.asterisk.js
    - match: \b(get|set)\b(?!\s*\()
      scope: storage.type.accessor.js
    - match: \bstatic\b
      scope: storage.type.js
    - include: else-pop

  parenthesized-expression:
    - match: \(
      scope: punctuation.section.group.js
      set:
        - meta_scope: meta.group.js
        - match: \)
          scope: punctuation.section.group.js
          pop: true
        - match: (?=\S)
          push: expression
    - match: \)
      scope: invalid.illegal.stray-bracket-end.js
      pop: true

  function-call:
    - match: \(
      scope: punctuation.section.group.js
      push:
        - meta_scope: meta.group.js
        - match: \)
          scope: punctuation.section.group.js
          pop: true
        - match: (?=\S)
          push: expression

  array-literal:
    - match: '\['
      scope: punctuation.section.brackets.js
      set:
        - meta_scope: meta.sequence.js
        - match: '\]'
          scope: punctuation.section.brackets.js
          pop: true
        - include: expression-list

  property-access:
    - match: '\['
      scope: punctuation.section.brackets.js
      push:
        - meta_scope: meta.brackets.js
        - match: '\]'
          scope: punctuation.section.brackets.js
          pop: true
        - match: (?=\S)
          push: expression

    - match: \.
      scope: punctuation.accessor.js
      push:
      # All of these matches use set (or effectively a set via the final
      # include/match/pop construct) instead of push so that we escape this
      # accessor state once a match has been made. Otherwise identifiers
      # following method definitions or method calls will be scoped as
      # properties.
        - match: '(?=({{identifier}})\s*(=)\s*({{func_lookahead}}|{{arrow_func_lookahead}}))'
          set:
            - meta_scope: meta.function.declaration.js
            - match: '(?={{func_lookahead}})'
              set: function-declaration
            - match: '(?={{arrow_func_lookahead}})'
              set: arrow-function-declaration
            - include: function-declaration-final-identifier
        - match: '(?={{identifier}}\s*\()'
          set:
            - include: method-call
            - match: '(?=.|\n)'
              pop: true
        - include: object-property

  literal-number:
    - match: '(?i)(?:\B[-+]|\b)0x[0-9a-f]*\.(\B|\b[0-9]+)'
      scope: invalid.illegal.numeric.hex.js
      pop: true
    - match: '(?:\B[-+]|\b)0[0-9]+\.(\B|\b[0-9]+)'
      scope: invalid.illegal.numeric.octal.js
      pop: true
    - match: |-
        (?xi)
        (?:\B[-+])?
        (?:
          \b0b[0-1]*|                 # binary
          \b0o[0-7]*|                 # octal
          \b0x[0-9a-f]*|              # hex
          (
            \B\.[0-9]+|               # e.g. .999
            \b[0-9]+(\.[0-9]*)?       # e.g. 999.999, 999. or 999
          )(e[-+]?[0-9]+)?            # e.g. e+123, E-123
        )
      scope: constant.numeric.js
      pop: true
    - match: '(?:\B[-+]|\b)(Infinity)\b'
      scope: constant.language.infinity.js
      pop: true

  literal-call:
    - match: (\$)(?=\s*\()
      scope: variable.function.js variable.other.dollar.only.js punctuation.dollar.js
      set:
        - meta_scope: meta.function-call.js
        - include: function-call-params
    - match: \b(clearTimeout|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|eval|isFinite|isNaN|parseFloat|parseInt|setTimeout|super|unescape)\b(?=\()
      scope: support.function.js
      set:
        - meta_scope: meta.function-call.js
        - include: function-call-params
    - match: '({{identifier}})(?=\s*\()'
      scope: variable.function.js
      set:
        - meta_scope: meta.function-call.js
        - include: function-call-params
    - match: '(?={{identifier}}\s*\.\s*{{identifier}}\s*\()'
      set:
        - match: \b(console)(?:(\.)(warn|info|log|error|time|timeEnd|assert|count|dir|group|groupCollapsed|groupEnd|profile|profileEnd|table|trace|timeStamp))?\b
          captures:
            1: support.type.object.console.js
            2: punctuation.accessor.js
            3: support.function.console.js
          set:
            - meta_scope: meta.function-call.method.js
            - include: function-call-params
        - match: \b(process)(?:(\.)(abort|chdir|cwd|disconnect|exit|[sg]ete?[gu]id|send|[sg]etgroups|initgroups|kill|memoryUsage|nextTick|umask|uptime|hrtime))?\b
          captures:
            1: support.type.object.process.js
            2: punctuation.accessor.js
            3: support.function.process.js
          set:
            - meta_scope: meta.function-call.method.js
            - include: function-call-params
        - match: '(?={{identifier}}\s*\.)'
          push:
            - include: well-known-identifiers
            - include: language-identifiers
            - match: '{{dollar_only_identifier}}'
              scope: variable.other.object.dollar.only.js punctuation.dollar.js
            - match: '{{dollar_identifier}}'
              scope: variable.other.object.dollar.js
              captures:
                1: punctuation.dollar.js
            - match: '{{identifier}}'
              scope: variable.other.object.js
            - match: \.
              scope: punctuation.accessor.js
              pop: true
        - match: \.
          scope: punctuation.accessor.js
        - include: method-call
        - match: '(?=[^ ])'
          pop: true

  method-call:
    - match: \b(shift|sort|splice|unshift|pop|push|reverse|copyWithin|fill)\b(?=\()
      scope: support.function.mutator.js
      set:
        - meta_scope: meta.function-call.method.js
        - include: function-call-params
    - match: \b(s(ub(stringData|mit)|plitText|e(t(NamedItem|Attribute(Node)?)|lect))|has(ChildNodes|Feature)|namedItem|c(l(ick|o(se|neNode))|reate(C(omment|DATASection|aption)|T(Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(ntityReference|lement)|Attribute))|tabIndex|i(nsert(Row|Before|Cell|Data)|tem)|open|delete(Row|C(ell|aption)|T(Head|Foot)|Data)|focus|write(ln)?|a(dd|ppend(Child|Data))|re(set|place(Child|Data)|move(NamedItem|Child|Attribute(Node)?)?)|get(NamedItem|Element(sBy(Name|TagName)|ById)|Attribute(Node)?)|blur)\b(?=\()
      scope: support.function.dom.js
      set:
        - meta_scope: meta.function-call.method.js
        - include: function-call-params
    - match: '({{identifier}})\s*(?=\()'
      scope: variable.function.js
      set:
        - meta_scope: meta.function-call.method.js
        - include: function-call-params

  function-call-params:
    - match: '\)'
      scope: meta.group.js punctuation.section.group.js
      pop: true
    - match: '\('
      scope: punctuation.section.group.js
      push:
        - meta_scope: meta.group.js
        - match: '(?=\))'
          pop: true
        # Consume comma plus any whitespace to prevent whitespace from
        # getting meta scopes when they don't really apply
        - match: '(,)\s+'
          captures:
            1: punctuation.separator.comma.js
        - match: (?=\S)
          push: expression-no-comma
    - include: else-pop

  literal-variable:
    - include: well-known-identifiers
    - include: language-identifiers
    - include: dollar-identifiers
    - include: support
    - match: '\b[[:upper:]][_$[:alnum:]]*(?=\s*[\[.])'
      scope: support.class.js
      pop: true
    - match: '{{identifier}}(?=\s*[\[.])'
      scope: variable.other.object.js
      pop: true
    - include: simple-identifiers

  well-known-identifiers:
    - match: \b(Array|Boolean|Date|Function|Map|Math|Number|Object|Promise|Proxy|RegExp|Set|String|WeakMap|XMLHttpRequest)\b
      scope: support.class.builtin.js
      pop: true
    - match: \b((Eval|Range|Reference|Syntax|Type|URI)?Error)\b
      scope: support.class.error.js
      pop: true
    - match: \b(document|window|navigator)\b
      scope: support.type.object.dom.js
      pop: true
    - match: \b(Buffer|EventEmitter|Server|Pipe|Socket|REPLServer|ReadStream|WriteStream|Stream|Inflate|Deflate|InflateRaw|DeflateRaw|GZip|GUnzip|Unzip|Zip)\b
      scope: support.class.node.js
      pop: true

  language-identifiers:
    - match: \b(arguments)\b
      scope: variable.language.arguments.js
      pop: true
    - match: \b(super)\b
      scope: variable.language.super.js
      pop: true
    - match: \b(this)\b
      scope: variable.language.this.js
      pop: true
    - match: \b(self)\b
      scope: variable.language.self.js
      pop: true

  dollar-identifiers:
    - match: '{{dollar_only_identifier}}'
      scope: variable.other.dollar.only.js punctuation.dollar.js
      pop: true
    - match: '{{dollar_identifier}}'
      scope: variable.other.dollar.js
      captures:
        1: punctuation.dollar.js
      pop: true

  simple-identifiers:
    - match: '{{constant_identifier}}'
      scope: variable.other.constant.js
      pop: true
    - match: '{{identifier}}'
      scope: variable.other.readwrite.js
      pop: true

  support:
    - match: \bdebugger\b
      scope: keyword.other.js
      pop: true
    - match: |-
        (?x)
        \b(
          ELEMENT_NODE|ATTRIBUTE_NODE|TEXT_NODE|CDATA_SECTION_NODE|ENTITY_REFERENCE_NODE|ENTITY_NODE|PROCESSING_INSTRUCTION_NODE|COMMENT_NODE|
          DOCUMENT_NODE|DOCUMENT_TYPE_NODE|DOCUMENT_FRAGMENT_NODE|NOTATION_NODE|INDEX_SIZE_ERR|DOMSTRING_SIZE_ERR|HIERARCHY_REQUEST_ERR|
          WRONG_DOCUMENT_ERR|INVALID_CHARACTER_ERR|NO_DATA_ALLOWED_ERR|NO_MODIFICATION_ALLOWED_ERR|NOT_FOUND_ERR|NOT_SUPPORTED_ERR|INUSE_ATTRIBUTE_ERR
        )\b
      scope: support.constant.dom.js
      pop: true
    - match: \b(assert|buffer|child_process|cluster|constants|crypto|dgram|dns|domain|events|fs|http|https|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|timers|tls|tty|url|util|vm|zlib)\b
      scope: support.module.node.js
      pop: true
    - match: \b(process)(?:(\.)(arch|argv|config|connected|env|execArgv|execPath|exitCode|mainModule|pid|platform|release|stderr|stdin|stdout|title|version|versions))?\b
      captures:
        1: support.type.object.process.js
        2: punctuation.accessor.js
        3: support.type.object.process.js
      pop: true
    - match: \b(exports|module(?:(\.)(exports|id|filename|loaded|parent|children))?)\b
      captures:
        1: support.type.object.module.js
        2: punctuation.accessor.js
        3: support.type.object.module.js
      pop: true
    - match: \b(global|GLOBAL|root|__dirname|__filename)\b
      scope: support.type.object.node.js
      pop: true

  object-property:
    - match: \b__proto__\b
      scope: variable.language.proto.js
      pop: true
    - match: \bconstructor\b
      scope: variable.language.constructor.js
      pop: true
    - match: \bprototype\b
      scope: variable.language.prototype.js
      pop: true
    - match: '{{dollar_only_identifier}}'
      scope: meta.property.object.dollar.only.js punctuation.dollar.js
      pop: true
    - match: '{{dollar_identifier}}'
      scope: meta.property.object.dollar.js
      captures:
        1: punctuation.dollar.js
      pop: true
    - match: '{{identifier}}'
      scope: meta.property.object.js
      pop: true
    - match: \b(s(hape|ystemId|c(heme|ope|rolling)|ta(ndby|rt)|ize|ummary|pecified|e(ctionRowIndex|lected(Index)?)|rc)|h(space|t(tpEquiv|mlFor)|e(ight|aders)|ref(lang)?)|n(o(Resize|tation(s|Name)|Shade|Href|de(Name|Type|Value)|Wrap)|extSibling|ame)|c(h(ildNodes|Off|ecked|arset)?|ite|o(ntent|o(kie|rds)|de(Base|Type)?|l(s|Span|or)|mpact)|ell(s|Spacing|Padding)|l(ear|assName)|aption)|t(ype|Bodies|itle|Head|ext|a(rget|gName)|Foot)|i(sMap|ndex|d|m(plementation|ages))|o(ptions|wnerDocument|bject)|d(i(sabled|r)|o(c(type|umentElement)|main)|e(clare|f(er|ault(Selected|Checked|Value)))|at(eTime|a))|useMap|p(ublicId|arentNode|r(o(file|mpt)|eviousSibling))|e(n(ctype|tities)|vent|lements)|v(space|ersion|alue(Type)?|Link|Align)|URL|f(irstChild|orm(s)?|ace|rame(Border)?)|width|l(ink(s)?|o(ngDesc|wSrc)|a(stChild|ng|bel))|a(nchors|c(ce(ssKey|pt(Charset)?)|tion)|ttributes|pplets|l(t|ign)|r(chive|eas)|xis|Link|bbr)|r(ow(s|Span|Index)|ules|e(v|ferrer|l|adOnly))|m(ultiple|e(thod|dia)|a(rgin(Height|Width)|xLength))|b(o(dy|rder)|ackground|gColor))\b
      scope: support.constant.dom.js
      pop: true
    - match: '(?=.|\n)'
      pop: true

================================================
FILE: assets/syntax/large/xml.sublime-syntax
================================================
%YAML 1.2
---
name: XML
file_extensions:
  - xml
  - xsd
  - xslt
  - tld
  - dtml
  - rss
  - opml
  - svg
first_line_match: |-
    (?x)
    ^(?:
        <\?xml\s
     |  \s*<([\w-]+):Envelope\s+xmlns:\1\s*=\s*"http://schemas.xmlsoap.org/soap/envelope/"\s*>
     )
scope: text.xml
variables:
  # This is the full XML Name production, but should not be used where namespaces
  # are possible. Those locations should use a qualified_name.
  name: '[[:alpha:]:_][[:alnum:]:_.-]*'
  # This is the form that allows a namespace prefix (ns:) followed by a local
  # name. The captures are:
  #  1: namespace prefix name
  #  2: namespace prefix colon
  #  3: local tag name
  qualified_name: '(?:([[:alpha:]_][[:alnum:]_.-]*)(:))?([[:alpha:]_][[:alnum:]_.-]*)'

contexts:
  main:
    - match: '(<\?)(xml)(?=\s)'
      captures:
        1: punctuation.definition.tag.begin.xml
        2: entity.name.tag.xml
      push:
        - meta_scope: meta.tag.preprocessor.xml
        - match: \?>
          scope: punctuation.definition.tag.end.xml
          pop: true
        - match: '\s+{{qualified_name}}(=)?'
          captures:
            1: entity.other.attribute-name.namespace.xml
            2: entity.other.attribute-name.xml punctuation.separator.namespace.xml
            3: entity.other.attribute-name.localname.xml
            4: punctuation.separator.key-value.xml
        - include: double-quoted-string
        - include: single-quoted-string
    - match: '(<!)(DOCTYPE)(?:\s+({{name}}))?'
      captures:
        1: punctuation.definition.tag.begin.xml
        2: keyword.doctype.xml
        3: variable.documentroot.xml
      push:
        - meta_scope: meta.tag.sgml.doctype.xml
        - match: \s*(>)
          captures:
            1: punctuation.definition.tag.end.xml
          pop: true
        - include: internal-subset
    - include: comment
    - match: '(</?){{qualified_name}}([^/>\s]*)'
      captures:
        1: punctuation.definition.tag.begin.xml
        2: entity.name.tag.namespace.xml
        3: entity.name.tag.xml punctuation.separator.namespace.xml
        4: entity.name.tag.localname.xml
        5: invalid.illegal.bad-tag-name.xml
      push:
        - meta_scope: meta.tag.xml
        - match: /?>
          scope: punctuation.definition.tag.end.xml
          pop: true
        - include: tag-stuff
    - match: '(</?)([[:digit:].-][[:alnum:]:_.-]*)'
      captures:
        1: punctuation.definition.tag.begin.xml
        2: invalid.illegal.bad-tag-name.xml
      push:
        - meta_scope: meta.tag.xml
        - match: /?>
          scope: punctuation.definition.tag.end.xml
          pop: true
        - include: tag-stuff
    - match: '(<\?)(xml-stylesheet|xml-model)(?=\s|\?>)'
      captures:
        1: punctuation.definition.tag.begin.xml
        2: entity.name.tag.xml
      push:
        - meta_scope: meta.tag.preprocessor.xml
        - match: \?>
          scope: punctuation.definition.tag.end.xml
          pop: true
        - include: tag-stuff
    - match: '(<\?)((?![xX][mM][lL]){{qualified_name}})(?=\s|\?>)'
      captures:
        1: punctuation.definition.tag.begin.xml
        2: entity.name.tag.xml
      push:
        - meta_scope: meta.tag.preprocessor.xml
        - match: \?>
          scope: punctuation.definition.tag.end.xml
          pop: true
    - include: entity
    - match: '<!\[CDATA\['
      scope: punctuation.definition.string.begin.xml
      push:
        - meta_scope: string.unquoted.cdata.xml
        - match: ']]>'
          scope: punctuation.definition.string.end.xml
          pop: true
    - match: ']]>'
      scope: invalid.illegal.missing-entity.xml
    - include: should-be-entity
  should-be-entity:
    - match: '&'
      scope: invalid.illegal.bad-ampersand.xml
    - match: '<'
      scope: invalid.illegal.missing-entity.xml
  double-quoted-string:
    - match: '"'
      scope: punctuation.definition.string.begin.xml
      push:
        - meta_scope: string.quoted.double.xml
        - match: '"'
          scope: punctuation.definition.string.end.xml
          pop: true
        - include: entity
        - include: should-be-entity
  entity:
    - match: '(&)(?:{{name}}|#[0-9]+|#x\h+)(;)'
      scope: constant.character.entity.xml
      captures:
        1: punctuation.definition.constant.xml
        2: punctuation.definition.constant.xml
  comment:
    - match: '<!--'
      scope: punctuation.definition.comment.begin.xml
      push:
        - meta_scope: comment.block.xml
        - match: '-->'
          scope: punctuation.definition.comment.end.xml
          pop: true
        - match: '-{2,}'
          scope: invalid.illegal.double-hyphen-within-comment.xml
  internal-subset:
    - match: \[
      scope: punctuation.definition.constant.xml
      push:
        - meta_scope: meta.internalsubset.xml
        - match: \]
          pop: true
        - include: comment
        - include: entity-decl
        - include: element-decl
        - include: attlist-decl
        - include: notation-decl
        - include: parameter-entity
  entity-decl:
    - match: '(<!)(ENTITY)\s+(%\s+)?({{name}})(\s+(?:SYSTEM|PUBLIC)\s+)?'
      captures:
        1: punctuation.definition.tag.begin.xml
        2: keyword.entity.xml
        3: punctuation.definition.entity.xml
        4: variable.entity.xml
        5: keyword.entitytype.xml
      push:
        - match: '>'
          scope: punctuation.definition.tag.end.xml
          pop: true
        - include: double-quoted-string
        - include: single-quoted-string
  element-decl:
    - match: '(<!)(ELEMENT)\s+({{name}})\s+'
      captures:
        1: punctuation.definition.tag.begin.xml
        2: keyword.element.xml
        3: variable.element.xml
      push:
        - match: '>'
          scope: punctuation.definition.tag.end.xml
          pop: true
        - match: '\b(EMPTY|ANY)\b'
          scope: constant.other.xml
        - include: element-parens
  element-parens:
    - match: \(
      scope: punctuation.definition.group.xml
      push:
        - match: (\))([*?+])?
          captures:
            1: punctuation.definition.group.xml
            2: keyword.operator.xml
          pop: true
        - match: '#PCDATA'
          scope: constant.other.xml
        - match: '[*?+]'
          scope: keyword.operator.xml
        - match: '[,|]'
          scope: punctuation.separator.xml
        - include: element-parens
  attlist-decl:
    - match: '(<!)(ATTLIST)\s+({{name}})\s+({{name}})'
      captures:
        1: punctuation.definition.tag.begin.xml
        2: keyword.attlist.xml
        3: variable.element.xml
        4: variable.attribute-name.xml
      push:
        - match: '>'
          scope: punctuation.definition.tag.end.xml
          pop: true
        - include: double-quoted-string
        - include: single-quoted-string
  notation-decl:
    - match: '(<!)(NOTATION)\s+({{name}})'
      captures:
        1: punctuation.definition.tag.begin.xml
        2: keyword.notation.xml
        3: variable.notation.xml
      push:
        - match: '>'
          scope: punctuation.definition.tag.end.xml
          pop: true
        - include: double-quoted-string
        - include: single-quoted-string
  parameter-entity:
    - match: '(%){{name}}(;)'
      scope: constant.character.parameter-entity.xml
      captures:
        1: punctuation.definition.constant.xml
        2: punctuation.definition.constant.xml
  single-quoted-string:
    - match: "'"
      scope: punctuation.definition.string.begin.xml
      push:
        - meta_scope: string.quoted.single.xml
        - match: "'"
          scope: punctuation.definition.string.end.xml
          pop: true
        - include: entity
        - include: should-be-entity
  tag-stuff:
    - match: '(?:\s+|^){{qualified_name}}\s*(=)'
      captures:
        1: entity.other.attribute-name.namespace.xml
        2: entity.other.attribute-name.xml punctuation.separator.namespace.xml
        3: entity.other.attribute-name.localname.xml
        4: punctuation.separator.key-value.xml
    - match: '(?:\s+|^)([[:alnum:]:_.-]+)\s*(=)'
      captures:
        1: invalid.illegal.bad-attribute-name.xml
        2: punctuation.separator.key-value.xml
    - include: double-quoted-string
    - include: single-quoted-string

================================================
FILE: assets/themes/ansi.tmTheme
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <!--
        The colors in this theme are encoded as #RRGGBBAA where RR is an ANSI
        palette number from 00 to 0f, and AA is the special value 00 to indicate
        that this encoding is being used.
        -->
        <key>name</key>
        <string>ANSI Dark</string>
        <key>colorSpaceName</key>
        <string>sRGB</string>
        <key>settings</key>
        <array>
            <dict>
                <key>settings</key>
                <dict>
                    <key>foreground</key>
                    <string>#07000000</string>
                </dict>
            </dict>
            <dict>
                <key>name</key>
                <string>Integers</string>
                <key>scope</key>
                <string>constant.numeric</string>
                <key>settings</key>
                <dict>
                    <key>foreground</key>
                    <string>#04000000</string>
                </dict>
            </dict>
            <dict>
                <key>name</key>
                <string>Constants</string>
                <key>scope</key>
                <string>constant</string>
                <key>settings</key>
                <dict>
                    <key>foreground</key>
                    <string>#04000000</string>
                </dict>
            </dict>
            <dict>
                <key>name</key>
                <string>Strings</string>
                <key>scope</key>
                <string>string.quoted, punctuation.definition.string.begin, punctuation.definition.string.end</string>
                <key>settings</key>
                <dict>
                    <key>foreground</key>
                    <string>#03000000</string>
                </dict>
            </dict>
            <dict>
                <key>name</key>
                <string>Doctype</string>
                <key>scope</key>
                <string>meta.tag.sgml, entity.name.tag.doctype</string>
                <key>settings</key>
                <dict>
                    <key>foreground</key>
                    <string>#06000000</string>
                </dict>
            </dict>
            <dict>
                <key>name</key>
                <string>Tags</string>
                <key>scope</key>
                <string>entity.name.tag</string>
                <key>settings</key>
                <dict>
                    <key>foreground</key>
                    <string>#0C000000</string>
                </dict>
            </dict>
            <dict>
                <key>name</key>
                <string>Attributes</string>
                <key>scope</key>
                <string>entity.other.attribute-name</string>
                <key>settings</key>
                <dict>
                    <key>foreground</key>
                    <string>#06000000</string>
                </dict>
            </dict>
            <dict>
                <key>name</key>
                <string>Header keys</string>
                <key>scope</key>
                <string>source.http http.requestheaders support.variable.http</string>
                <key>settings</key>
                <dict>
                    <key>foreground</key>
                    <string>#06000000</string>
                </dict>
            </dict>
            <dict>
                <key>name</key>
                <string>Header values</string>
                <key>scope</key>
                <string>source.http http.requestheaders string.other.http</string>
                <key>settings</key>
                <dict>
                    <key>foreground</key>
                    <string>#07000000</string>
                </dict>
            </dict>
            <dict>
                <key>name</key>
                <string>HTTP version</string>
                <key>scope</key>
                <string>constant.numeric.http, keyword.other.http</string>
                <key>settings</key>
                <dict>
                    <key>foreground</key>
                    <string>#04000000</string>
                </dict>
            </dict>
            <dict>
                <key>name</key>
                <string>HTTP reason phrase</string>
                <key>scope</key>
                <string>keyword.reason.http</string>
                <key>settings</key>
                <dict>
                    <key>foreground</key>
                    <string>#06000000</string>
                </dict>
            </dict>
            <dict>
                <key>name</key>
                <string>HTTP method</string>
                <key>scope</key>
                <string>keyword.control.http</string>
                <key>settings</key>
                <dict>
                    <key>foreground</key>
                    <string>#02000000</string>
                </dict>
            </dict>
            <dict>
                <key>name</key>
                <string>HTTP URL</string>
                <key>scope</key>
                <string>const.language.http</string>
                <key>settings</key>
                <dict>
                    <key>fontStyle</key>
                    <string>underline</string>
                    <key>foreground</key>
                    <string>#06000000</string>
                </dict>
            </dict>
            <dict>
                <key>name</key>
                <string>JSON keys</string>
                <key>scope</key>
                <string>keyword.other.name.jsonkv</string>
                <key>settings</key>
                <dict>
                    <key>foreground</key>
                    <string>#0C000000</string>
                </dict>
            </dict>
            <dict>
                <key>name</key>
                <string>Error</string>
                <key>scope</key>
                <string>error</string>
                <key>settings</key>
                <dict>
                    <key>foreground</key>
                    <string>#01000000</string>
                </dict>
            </dict>
        </array>
    </dict>
</plist>


================================================
FILE: assets/themes/fruity.tmTheme
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <!--
        The colors in this theme are encoded as #RRGGBBAA where RR is an ANSI
        palette number from 00 to 0f, and AA is the special value 00 to indicate
        that this encoding is being used.
        -->
        <key>name</key>
        <string>Fruity</string>
        <key>colorSpaceName</key>
        <string>sRGB</string>
        <key>settings</key>
        <ar
Download .txt
gitextract_9556vlw0/

├── .github/
│   └── workflows/
│       ├── ci.yaml
│       └── release.yaml
├── .gitignore
├── CHANGELOG.md
├── Cargo.toml
├── FAQ.md
├── LICENSE
├── README.md
├── RELEASE-CHECKLIST.md
├── assets/
│   ├── README.md
│   ├── syntax/
│   │   ├── basic/
│   │   │   └── json.sublime-syntax
│   │   └── large/
│   │       ├── css.sublime-syntax
│   │       ├── html.sublime-syntax
│   │       ├── js.sublime-syntax
│   │       └── xml.sublime-syntax
│   └── themes/
│       ├── ansi.tmTheme
│       ├── fruity.tmTheme
│       ├── monokai.tmTheme
│       └── solarized.tmTheme
├── build.rs
├── completions/
│   ├── _xh
│   ├── _xh.ps1
│   ├── xh.bash
│   ├── xh.elv
│   ├── xh.fish
│   └── xh.nu
├── doc/
│   ├── man-template.roff
│   └── xh.1
├── install.ps1
├── install.sh
├── src/
│   ├── auth.rs
│   ├── buffer.rs
│   ├── cli.rs
│   ├── content_disposition.rs
│   ├── decoder.rs
│   ├── download.rs
│   ├── error_reporting.rs
│   ├── formatting/
│   │   ├── headers.rs
│   │   ├── mod.rs
│   │   └── palette.rs
│   ├── generation.rs
│   ├── main.rs
│   ├── message_signature.rs
│   ├── middleware.rs
│   ├── nested_json.rs
│   ├── netrc.rs
│   ├── printer.rs
│   ├── redacted.rs
│   ├── redirect.rs
│   ├── request_items.rs
│   ├── session.rs
│   ├── to_curl.rs
│   └── utils.rs
└── tests/
    ├── cases/
    │   ├── auth_message_signature.rs
    │   ├── compress_request_body.rs
    │   ├── download.rs
    │   ├── logging.rs
    │   ├── mod.rs
    │   ├── unix_socket.rs
    │   └── xml.rs
    ├── cli.rs
    ├── fixtures/
    │   ├── certs/
    │   │   ├── README.md
    │   │   ├── client.badssl.com.crt
    │   │   ├── client.badssl.com.key
    │   │   └── wildcard-self-signed.pem
    │   ├── keys/
    │   │   └── rsa_private_key_pkcs8.pem
    │   └── responses/
    │       ├── README.md
    │       ├── hello_world.br
    │       ├── hello_world.zst
    │       └── hello_world.zz
    └── server/
        └── mod.rs
Download .txt
SYMBOL INDEX (735 symbols across 32 files)

FILE: build.rs
  function build_syntax (line 9) | fn build_syntax(dir: &str, out: &str) {
  function feature_status (line 17) | fn feature_status(feature: &str) -> String {
  function features (line 30) | fn features() -> String {
  function main (line 38) | fn main() {

FILE: src/auth.rs
  type Auth (line 15) | pub enum Auth {
    method from_str (line 22) | pub fn from_str(auth: &str, auth_type: AuthType, host: &str) -> Result...
    method from_netrc (line 39) | pub fn from_netrc(auth_type: AuthType, entry: netrc::Entry) -> Option<...
  function parse_auth (line 48) | pub fn parse_auth(auth: &str, host: &str) -> io::Result<(String, Option<...
  type DigestAuthMiddleware (line 63) | pub struct DigestAuthMiddleware<'a> {
  function new (line 69) | pub fn new(username: &'a str, password: &'a str) -> Self {
  method handle (line 75) | fn handle(&mut self, mut ctx: Context, mut request: Request) -> Result<R...
  function parsing (line 105) | fn parsing() {

FILE: src/buffer.rs
  type Buffer (line 35) | pub struct Buffer {
    method stdout (line 48) | pub fn stdout() -> Self {
    method stderr (line 56) | pub fn stderr() -> Self {
    method redirect (line 64) | pub fn redirect() -> Self {
    method file (line 72) | pub fn file(file: std::fs::File) -> Self {
    method is_terminal (line 80) | pub fn is_terminal(&self) -> bool {
    method is_redirect (line 84) | pub fn is_redirect(&self) -> bool {
    method is_stdout (line 89) | pub fn is_stdout(&self) -> bool {
    method is_stderr (line 94) | pub fn is_stderr(&self) -> bool {
    method is_file (line 99) | pub fn is_file(&self) -> bool {
    method stdout (line 179) | pub fn stdout() -> Self {
    method stderr (line 187) | pub fn stderr() -> Self {
    method redirect (line 195) | pub fn redirect() -> Self {
    method file (line 199) | pub fn file(file: std::fs::File) -> Self {
    method is_terminal (line 203) | pub fn is_terminal(&self) -> bool {
    method is_redirect (line 207) | pub fn is_redirect(&self) -> bool {
    method is_stdout (line 212) | pub fn is_stdout(&self) -> bool {
    method is_stderr (line 217) | pub fn is_stderr(&self) -> bool {
    method is_file (line 222) | pub fn is_file(&self) -> bool {
    method new (line 289) | pub fn new(download: bool, output: Option<&Path>, is_stdout_tty: bool)...
    method print (line 304) | pub fn print(&mut self, s: &str) -> io::Result<()> {
    method guess_pretty (line 308) | pub fn guess_pretty(&self) -> Pretty {
  type Inner (line 41) | enum Inner {
  method write (line 105) | fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
  method write_all (line 113) | fn write_all(&mut self, buf: &[u8]) -> std::io::Result<()> {
  method flush (line 121) | fn flush(&mut self) -> std::io::Result<()> {
  method write (line 131) | fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
  method write_all (line 135) | fn write_all(&mut self, buf: &[u8]) -> std::io::Result<()> {
  method flush (line 141) | fn flush(&mut self) -> std::io::Result<()> {
  method supports_color (line 147) | fn supports_color(&self) -> bool {
  method set_color (line 151) | fn set_color(&mut self, spec: &termcolor::ColorSpec) -> std::io::Result<...
  method reset (line 155) | fn reset(&mut self) -> std::io::Result<()> {
  type Buffer (line 169) | pub enum Buffer {
    method stdout (line 48) | pub fn stdout() -> Self {
    method stderr (line 56) | pub fn stderr() -> Self {
    method redirect (line 64) | pub fn redirect() -> Self {
    method file (line 72) | pub fn file(file: std::fs::File) -> Self {
    method is_terminal (line 80) | pub fn is_terminal(&self) -> bool {
    method is_redirect (line 84) | pub fn is_redirect(&self) -> bool {
    method is_stdout (line 89) | pub fn is_stdout(&self) -> bool {
    method is_stderr (line 94) | pub fn is_stderr(&self) -> bool {
    method is_file (line 99) | pub fn is_file(&self) -> bool {
    method stdout (line 179) | pub fn stdout() -> Self {
    method stderr (line 187) | pub fn stderr() -> Self {
    method redirect (line 195) | pub fn redirect() -> Self {
    method file (line 199) | pub fn file(file: std::fs::File) -> Self {
    method is_terminal (line 203) | pub fn is_terminal(&self) -> bool {
    method is_redirect (line 207) | pub fn is_redirect(&self) -> bool {
    method is_stdout (line 212) | pub fn is_stdout(&self) -> bool {
    method is_stderr (line 217) | pub fn is_stderr(&self) -> bool {
    method is_file (line 222) | pub fn is_file(&self) -> bool {
    method new (line 289) | pub fn new(download: bool, output: Option<&Path>, is_stdout_tty: bool)...
    method print (line 304) | pub fn print(&mut self, s: &str) -> io::Result<()> {
    method guess_pretty (line 308) | pub fn guess_pretty(&self) -> Pretty {
  method write (line 228) | fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
  method write_all (line 236) | fn write_all(&mut self, buf: &[u8]) -> std::io::Result<()> {
  method flush (line 244) | fn flush(&mut self) -> std::io::Result<()> {
  method supports_color (line 254) | fn supports_color(&self) -> bool {
  method set_color (line 262) | fn set_color(&mut self, spec: &termcolor::ColorSpec) -> std::io::Result<...
  method reset (line 270) | fn reset(&mut self) -> std::io::Result<()> {
  method is_synchronous (line 278) | fn is_synchronous(&self) -> bool {

FILE: src/cli.rs
  constant STYLES (line 27) | const STYLES: Styles = Styles::styled()
  type Cli (line 56) | pub struct Cli {
    method parse (line 502) | pub fn parse() -> Self {
    method parse_from (line 515) | pub fn parse_from<I>(iter: I) -> Self
    method try_parse_from (line 526) | pub fn try_parse_from<I>(iter: I) -> clap::error::Result<Self>
    method process_relations (line 605) | fn process_relations(&mut self, matches: &clap::ArgMatches) -> clap::e...
    method into_app (line 656) | pub fn into_app() -> clap::Command {
    method logger_config (line 690) | pub fn logger_config(&self) -> env_logger::Builder {
  type Config (line 737) | struct Config {
  function default_cli_args (line 741) | fn default_cli_args() -> Option<Vec<String>> {
  function parse_method (line 770) | fn parse_method(method: &str) -> Option<Method> {
  function construct_url (line 781) | fn construct_url(
  type AuthType (line 805) | pub enum AuthType {
  type MessageSignature (line 813) | pub struct MessageSignature {
    method has_key_pair (line 865) | pub fn has_key_pair(&self) -> bool {
    method key_pair (line 869) | pub fn key_pair(&self) -> Option<(&str, &str)> {
    method algorithm (line 873) | pub fn algorithm(&self) -> Option<MessageSignatureAlgorithm> {
    method has_components (line 877) | pub fn has_components(&self) -> bool {
    method flattened_components (line 884) | pub fn flattened_components(&self) -> Vec<String> {
  type MessageSignatureComponents (line 893) | pub struct MessageSignatureComponents(pub Vec<String>);
  type Err (line 896) | type Err = std::convert::Infallible;
  method from_str (line 897) | fn from_str(s: &str) -> Result<Self, Self::Err> {
  type MessageSignatureAlgorithm (line 915) | pub enum MessageSignatureAlgorithm {
  function from (line 932) | fn from(value: MessageSignatureAlgorithm) -> Self {
  type TlsVersion (line 945) | pub enum TlsVersion {
  function from (line 960) | fn from(version: TlsVersion) -> Self {
  type Pretty (line 972) | pub enum Pretty {
    method color (line 984) | pub fn color(self) -> bool {
    method format (line 988) | pub fn format(self) -> bool {
  type FormatOptions (line 994) | pub struct FormatOptions {
    method merge (line 1003) | pub fn merge(mut self, other: &Self) -> Self {
  type Err (line 1014) | type Err = anyhow::Error;
  method from_str (line 1015) | fn from_str(options: &str) -> anyhow::Result<FormatOptions> {
  type Theme (line 1054) | pub enum Theme {
    method as_str (line 1063) | pub fn as_str(&self) -> &'static str {
    method as_syntect_theme (line 1072) | pub(crate) fn as_syntect_theme(&self) -> &'static syntect::highlightin...
  type Print (line 1078) | pub struct Print {
    method new (line 1087) | pub fn new(
  type Err (line 1157) | type Err = anyhow::Error;
  method from_str (line 1158) | fn from_str(s: &str) -> anyhow::Result<Print> {
  type Timeout (line 1188) | pub struct Timeout(Duration);
    method as_duration (line 1191) | pub fn as_duration(&self) -> Option<Duration> {
  type Err (line 1197) | type Err = anyhow::Error;
  method from_str (line 1199) | fn from_str(sec: &str) -> anyhow::Result<Timeout> {
  type Proxy (line 1216) | pub enum Proxy {
  type Err (line 1223) | type Err = anyhow::Error;
  method from_str (line 1225) | fn from_str(s: &str) -> anyhow::Result<Self> {
  type Resolve (line 1253) | pub struct Resolve {
  type Err (line 1259) | type Err = anyhow::Error;
  method from_str (line 1261) | fn from_str(s: &str) -> anyhow::Result<Self> {
  type Verify (line 1290) | pub enum Verify {
    type Parser (line 1297) | type Parser = VerifyParser;
    method value_parser (line 1298) | fn value_parser() -> Self::Parser {
    method fmt (line 1323) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type VerifyParser (line 1304) | pub struct VerifyParser;
    type Value (line 1306) | type Value = Verify;
    method parse_ref (line 1308) | fn parse_ref(
  type BodyType (line 1333) | pub enum BodyType {
  type HttpVersion (line 1341) | pub enum HttpVersion {
  type Generate (line 1355) | pub enum Generate {
  function parse_encoding (line 1379) | fn parse_encoding(encoding: &str) -> anyhow::Result<&'static Encoding> {
  function safe_exit (line 1420) | fn safe_exit() -> ! {
  function long_version (line 1426) | fn long_version() -> &'static str {
  function parse (line 1436) | fn parse<I>(args: I) -> clap::error::Result<Cli>
  function implicit_method (line 1449) | fn implicit_method() {
  function explicit_method (line 1457) | fn explicit_method() {
  function method_edge_cases (line 1465) | fn method_edge_cases() {
  function missing_url (line 1479) | fn missing_url() {
  function space_in_url (line 1484) | fn space_in_url() {
  function url_with_leading_double_slash_colon (line 1492) | fn url_with_leading_double_slash_colon() {
  function url_with_leading_colon (line 1498) | fn url_with_leading_colon() {
  function url_with_scheme (line 1513) | fn url_with_scheme() {
  function url_without_scheme (line 1519) | fn url_without_scheme() {
  function request_items (line 1525) | fn request_items() {
  function request_items_implicit_method (line 1540) | fn request_items_implicit_method() {
  function request_type_overrides (line 1555) | fn request_type_overrides() {
  function superfluous_arg (line 1576) | fn superfluous_arg() {
  function superfluous_arg_implicit_method (line 1581) | fn superfluous_arg_implicit_method() {
  function multiple_methods (line 1586) | fn multiple_methods() {
  function proxy_invalid_protocol (line 1591) | fn proxy_invalid_protocol() {
  function proxy_invalid_proxy_url (line 1602) | fn proxy_invalid_proxy_url() {
  function proxy_http (line 1608) | fn proxy_http() {
  function proxy_https (line 1620) | fn proxy_https() {
  function proxy_all (line 1632) | fn proxy_all() {
  function executable_name (line 1644) | fn executable_name() {
  function executable_name_extension (line 1650) | fn executable_name_extension() {
  function negated_flags (line 1656) | fn negated_flags() {
  function negating_check_status (line 1755) | fn negating_check_status() {
  function negating_stream (line 1773) | fn negating_stream() {
  function parse_encoding_label (line 1791) | fn parse_encoding_label() {
  function parse_format_options (line 1817) | fn parse_format_options() {
  function merge_format_options (line 1852) | fn merge_format_options() {
  function parse_repeated_message_signature_components (line 1869) | fn parse_repeated_message_signature_components() {
  function parse_message_signature_algorithm (line 1886) | fn parse_message_signature_algorithm() {
  function parse_resolve (line 1907) | fn parse_resolve() {
  function generate (line 1929) | fn generate() {
  function generate_with_url (line 1936) | fn generate_with_url() {

FILE: src/content_disposition.rs
  function parse_filename_from_content_disposition (line 5) | pub fn parse_filename_from_content_disposition(content_disposition: &str...
  function parse_regular_filename (line 32) | fn parse_regular_filename(filename: &str) -> Option<String> {
  function parse_encoded_filename (line 58) | fn parse_encoded_filename(content: &str) -> Option<String> {
  function test_simple_filename (line 107) | fn test_simple_filename() {
  function test_filename_without_quotes (line 116) | fn test_filename_without_quotes() {
  function test_encoded_filename (line 125) | fn test_encoded_filename() {
  function test_both_filenames (line 135) | fn test_both_filenames() {
  function test_decode_with_windows_1252 (line 145) | fn test_decode_with_windows_1252() {
  function test_both_filenames_with_bad_format (line 154) | fn test_both_filenames_with_bad_format() {
  function test_no_filename (line 164) | fn test_no_filename() {
  function test_iso_8859_1 (line 170) | fn test_iso_8859_1() {
  function test_bad_encoding_fallback_to_utf8 (line 179) | fn test_bad_encoding_fallback_to_utf8() {

FILE: src/decoder.rs
  type CompressionType (line 12) | pub enum CompressionType {
  type Err (line 20) | type Err = anyhow::Error;
  method from_str (line 21) | fn from_str(value: &str) -> anyhow::Result<CompressionType> {
  function get_compression_type (line 37) | pub fn get_compression_type(headers: &HeaderMap) -> Option<CompressionTy...
  type OuterReader (line 83) | struct OuterReader<'a> {
  type Status (line 88) | struct Status {
  method read (line 95) | fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
  type InnerReader (line 122) | struct InnerReader<R: Read> {
  method read (line 128) | fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
  type DecodeError (line 155) | struct DecodeError {
    method fmt (line 161) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
    method source (line 167) | fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
  function decompress (line 172) | pub fn decompress(
  type LazyZstdDecoder (line 213) | enum LazyZstdDecoder<R: Read> {
  method read (line 219) | fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
  function decode_errors_are_prepended_with_custom_message (line 245) | fn decode_errors_are_prepended_with_custom_message() {
  function underlying_read_errors_are_not_modified (line 262) | fn underlying_read_errors_are_not_modified() {
  function interrupts_are_handled_gracefully (line 282) | fn interrupts_are_handled_gracefully() {
  function empty_inputs_do_not_cause_errors (line 319) | fn empty_inputs_do_not_cause_errors() {
  function read_errors_keep_their_context (line 342) | fn read_errors_keep_their_context() {
  function true_decode_errors_are_preserved (line 376) | fn true_decode_errors_are_preserved() {

FILE: src/download.rs
  function get_content_length (line 19) | fn get_content_length(headers: &HeaderMap) -> Option<u64> {
  function get_file_name (line 28) | fn get_file_name(response: &Response, orig_url: &reqwest::Url) -> String {
  function get_file_size (line 75) | pub fn get_file_size(path: Option<&Path>) -> Option<u64> {
  function open_new_file (line 80) | fn open_new_file(file_name: PathBuf) -> io::Result<(PathBuf, File)> {
  function total_for_content_range (line 110) | fn total_for_content_range(header: &str, expected_start: u64) -> Result<...
  constant BAR_TEMPLATE (line 159) | const BAR_TEMPLATE: &str =
  constant UNCOLORED_BAR_TEMPLATE (line 161) | const UNCOLORED_BAR_TEMPLATE: &str =
  constant SPINNER_TEMPLATE (line 163) | const SPINNER_TEMPLATE: &str = "{spinner:.green} {bytes} {bytes_per_sec}...
  constant UNCOLORED_SPINNER_TEMPLATE (line 164) | const UNCOLORED_SPINNER_TEMPLATE: &str = "{spinner} {bytes} {bytes_per_s...
  function download_file (line 166) | pub fn download_file(
  function content_range_parsing (line 292) | fn content_range_parsing() {

FILE: src/error_reporting.rs
  function additional_messages (line 3) | pub(crate) fn additional_messages(err: &anyhow::Error, native_tls: bool)...
  function format_rustls_error (line 23) | fn format_rustls_error(err: &anyhow::Error) -> Option<String> {
  function exit_code (line 63) | pub(crate) fn exit_code(err: &anyhow::Error) -> ExitCode {

FILE: src/formatting/headers.rs
  type HeaderFormatter (line 39) | pub(crate) struct HeaderFormatter<'a, W: WriteColor> {
  function new (line 47) | pub(crate) fn new(
  function print (line 61) | fn print(&mut self, text: &str) -> Result<()> {
  function print_plain (line 65) | fn print_plain(&mut self, text: &str) -> Result<()> {
  function print_request_headers (line 70) | pub(crate) fn print_request_headers(
  function print_response_headers (line 101) | pub(crate) fn print_response_headers(
  function print_http_version (line 130) | fn print_http_version(&mut self, version: Version) -> Result<()> {
  function print_headers (line 144) | fn print_headers(&mut self, headers: &HeaderMap, version: Version) -> Re...
  function titlecase_header (line 216) | fn titlecase_header<'b>(name: &HeaderName, buffer: &'b mut String) -> &'...
  function sanitize_header_value (line 240) | fn sanitize_header_value(value: &str) -> String {
  function test_header_casing (line 252) | fn test_header_casing() {

FILE: src/formatting/mod.rs
  function get_json_formatter (line 20) | pub fn get_json_formatter(indent_level: usize) -> jsonxf::Formatter {
  function format_xml (line 30) | pub fn format_xml(indent: usize, text: &str) -> io::Result<Vec<u8>> {
  function serde_json_format (line 48) | pub fn serde_json_format(indent_level: usize, text: &str, write: impl Wr...
  type Highlighter (line 68) | pub struct Highlighter<'a> {
  function new (line 76) | pub fn new(syntax: &'static str, theme: Theme, out: &'a mut Buffer) -> S...
  function highlight (line 94) | pub fn highlight(&mut self, text: &str) -> io::Result<()> {
  function highlight_bytes (line 108) | pub fn highlight_bytes(&mut self, line: &[u8]) -> io::Result<()> {
  function flush (line 112) | pub fn flush(&mut self) -> io::Result<()> {
  method drop (line 118) | fn drop(&mut self) {
  function convert_style (line 124) | fn convert_style(style: syntect::highlighting::Style) -> termcolor::Colo...
  function convert_color (line 135) | fn convert_color(color: syntect::highlighting::Color) -> Option<termcolo...
  function supports_hyperlinks (line 170) | pub(crate) fn supports_hyperlinks() -> bool {
  function create_hyperlink (line 175) | pub(crate) fn create_hyperlink(text: &str, url: &str) -> String {

FILE: src/formatting/palette.rs
  function extract_color (line 49) | pub(crate) fn extract_color(
  function extract_default (line 61) | pub(crate) fn extract_default(theme: &Theme) -> ColorSpec {

FILE: src/generation.rs
  constant MAN_TEMPLATE (line 9) | const MAN_TEMPLATE: &str = include_str!("../doc/man-template.roff");
  function generate (line 11) | pub fn generate(bin_name: &str, generate: Generate) {
  function generate_manpages (line 55) | fn generate_manpages(app: &mut clap::Command) {

FILE: src/main.rs
  function get_user_agent (line 59) | fn get_user_agent() -> &'static str {
  function main (line 68) | fn main() -> ExitCode {
  function run (line 99) | fn run(args: Cli) -> Result<ExitCode> {
  function setup_backtraces (line 795) | fn setup_backtraces() {

FILE: src/message_signature.rs
  function sign_request (line 14) | pub fn sign_request(
  function resolve_components (line 76) | fn resolve_components(request: &Request, components: Option<&[String]>) ...
  function ensure_content_digest (line 126) | fn ensure_content_digest(request: &mut Request, components: &[String]) -...
  function build_signature_params (line 145) | fn build_signature_params(components: &[String]) -> Result<HttpSignature...
  function component_uniqueness_key (line 177) | fn component_uniqueness_key(component_id: &HttpMessageComponentId) -> St...
  function normalize_component_id (line 206) | fn normalize_component_id(component: &str) -> String {
  function buffer_request_body (line 217) | fn buffer_request_body(request: &mut Request) -> Result<Vec<u8>> {
  function parse_key_input (line 230) | fn parse_key_input(key_material: &str) -> Result<Vec<u8>> {
  function build_signing_key (line 243) | fn build_signing_key(
  function build_hmac_signing_key (line 284) | fn build_hmac_signing_key(
  function build_signing_key_with_algorithm (line 297) | fn build_signing_key_with_algorithm(
  function parse_pem_secret_key (line 334) | fn parse_pem_secret_key(pem: &str, algorithms: &[AlgorithmName]) -> Opti...
  type MessageSigningKey (line 343) | enum MessageSigningKey {
  method sign (line 349) | fn sign(&self, data: &[u8]) -> HttpSigResult<Vec<u8>> {
  method key_id (line 356) | fn key_id(&self) -> String {
  method alg (line 363) | fn alg(&self) -> AlgorithmName {
  function test_content_digest_generation (line 377) | fn test_content_digest_generation() {
  function test_sign_request_with_query_param (line 400) | fn test_sign_request_with_query_param() {
  function test_sign_request_hmac (line 422) | fn test_sign_request_hmac() {
  function test_bs_parameter_unsupported (line 452) | fn test_bs_parameter_unsupported() {
  function test_sf_parameter_success (line 473) | fn test_sf_parameter_success() {
  function test_key_parameter_success (line 487) | fn test_key_parameter_success() {
  function test_tr_parameter_unsupported (line 501) | fn test_tr_parameter_unsupported() {
  function test_name_parameter_error_on_field (line 518) | fn test_name_parameter_error_on_field() {
  function test_resolve_components_defaults (line 536) | fn test_resolve_components_defaults() {
  function test_resolve_components_query_params_deduplicates_names (line 544) | fn test_resolve_components_query_params_deduplicates_names() {
  function test_duplicate_component_rejected (line 559) | fn test_duplicate_component_rejected() {
  function test_equivalent_component_with_different_param_order_rejected (line 567) | fn test_equivalent_component_with_different_param_order_rejected() {
  function test_normalize_component_id (line 585) | fn test_normalize_component_id() {
  function test_invalid_pem_key_does_not_fall_back_to_hmac (line 603) | fn test_invalid_pem_key_does_not_fall_back_to_hmac() {
  function test_rsa_pem_requires_explicit_algorithm (line 615) | fn test_rsa_pem_requires_explicit_algorithm() {
  function test_rsa_pem_with_explicit_algorithm_succeeds (line 628) | fn test_rsa_pem_with_explicit_algorithm_succeeds() {

FILE: src/middleware.rs
  type ResponseMeta (line 7) | pub struct ResponseMeta {
  type ResponseExt (line 12) | pub trait ResponseExt {
    method meta (line 13) | fn meta(&self) -> &ResponseMeta;
    method meta_mut (line 14) | fn meta_mut(&mut self) -> &mut ResponseMeta;
    method meta (line 18) | fn meta(&self) -> &ResponseMeta {
    method meta_mut (line 22) | fn meta_mut(&mut self) -> &mut ResponseMeta {
  type Printer (line 27) | type Printer<'a, 'b> = &'a mut (dyn FnMut(&mut Response, &mut Request) -...
  type Context (line 29) | pub struct Context<'a, 'b> {
  function new (line 36) | fn new(
  function execute (line 48) | fn execute(&mut self, request: Request) -> Result<Response> {
  type Middleware (line 68) | pub trait Middleware {
    method handle (line 69) | fn handle(&mut self, ctx: Context, request: Request) -> Result<Response>;
    method next (line 71) | fn next(&self, ctx: &mut Context, request: Request) -> Result<Response> {
    method print (line 75) | fn print(
  type ClientWithMiddleware (line 89) | pub struct ClientWithMiddleware<'a, T>
  function new (line 102) | pub fn new(client: &'a Client) -> Self {
  function with_printer (line 110) | pub fn with_printer(mut self, printer: T) -> Self {
  function with (line 115) | pub fn with(mut self, middleware: impl Middleware + 'a) -> Self {
  function execute (line 120) | pub fn execute(&mut self, request: Request) -> Result<Response> {

FILE: src/nested_json.rs
  type Token (line 28) | enum Token {
    method literal (line 36) | fn literal(json_path: &str, start: Option<usize>, end: Option<usize>) ...
    method is_empty (line 58) | fn is_empty(&self) -> bool {
  function tokenize (line 66) | fn tokenize(json_path: &str) -> impl IntoIterator<Item = Token> {
  type PathAction (line 94) | pub enum PathAction {
  function parse_path (line 100) | pub fn parse_path(json_path: &str) -> Result<Vec<PathAction>> {
  function insert (line 160) | pub fn insert(
  function arr_insert (line 221) | fn arr_insert(arr: &mut Vec<Value>, index: usize, value: Value) {
  function remove_from_arr (line 229) | fn remove_from_arr(arr: &mut [Value], index: usize) -> Option<Value> {
  function syntax_error (line 237) | fn syntax_error(expected: &'static str, pos: usize, json_path: &str) -> ...
  function highlight_error (line 245) | fn highlight_error(text: &str, start: usize, mut end: usize) -> String {
  type TypeError (line 262) | pub struct TypeError {
    method new (line 269) | fn new(root: Value, path_component: PathAction) -> Self {
    method with_json_path (line 277) | pub fn with_json_path(mut self, json_path: String) -> TypeError {
    method fmt (line 286) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
  function deeply_nested_object (line 327) | fn deeply_nested_object() {
  function deeply_nested_array (line 333) | fn deeply_nested_array() {
  function can_override_value (line 339) | fn can_override_value() {
  function type_clashes (line 359) | fn type_clashes() {
  function json_path_parser (line 390) | fn json_path_parser() {

FILE: src/netrc.rs
  type Entry (line 40) | pub struct Entry {
  function find_entry (line 45) | pub fn find_entry(host: url::Host<&str>) -> Option<Entry> {
  function open_netrc (line 60) | fn open_netrc() -> Option<File> {
  type EntryState (line 77) | enum EntryState {
  type Parser (line 86) | struct Parser<'a, R> {
  function new (line 109) | fn new(reader: R, host: url::Host<&'a str>) -> Self {
  function parse (line 125) | fn parse(mut self) -> io::Result<Option<Entry>> {
  function finish_entry (line 215) | fn finish_entry(&mut self) {
  function arg (line 234) | fn arg(&mut self) -> io::Result<Option<String>> {
  function advance_line (line 244) | fn advance_line(&mut self) -> io::Result<usize> {
  function word (line 251) | fn word(&mut self) -> io::Result<Option<&str>> {
  function cases (line 277) | fn cases() {
  function found (line 452) | fn found(
  function notfound (line 465) | fn notfound(netrc: &str, host: url::Host<&str>) {

FILE: src/printer.rs
  constant BINARY_SUPPRESSOR (line 26) | const BINARY_SUPPRESSOR: &str = concat!(
  type BinaryGuard (line 41) | struct BinaryGuard<'a, T: Read> {
  type FoundBinaryData (line 48) | struct FoundBinaryData;
    method fmt (line 51) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  function new (line 59) | fn new(reader: &'a mut T, checked: bool) -> Self {
  function read_lines (line 83) | fn read_lines(&mut self) -> io::Result<Option<&[u8]>> {
  type Printer (line 119) | pub struct Printer {
    method new (line 132) | pub fn new(
    method get_highlighter (line 152) | fn get_highlighter(&mut self, syntax: &'static str) -> Highlighter<'_> {
    method get_header_formatter (line 156) | fn get_header_formatter(&mut self) -> HeaderFormatter<'_, Buffer> {
    method print_colorized_text (line 166) | fn print_colorized_text(&mut self, text: &str, syntax: &'static str) -...
    method print_syntax_text (line 170) | fn print_syntax_text(&mut self, text: &str, syntax: &'static str) -> i...
    method print_json_text (line 178) | fn print_json_text(&mut self, text: &str, check_valid: bool) -> io::Re...
    method print_xml_text (line 207) | fn print_xml_text(&mut self, body: &str) -> io::Result<()> {
    method print_body_text (line 231) | fn print_body_text(&mut self, content_type: ContentType, body: &str) -...
    method print_stream (line 248) | fn print_stream(&mut self, reader: &mut impl Read) -> io::Result<()> {
    method print_colorized_stream (line 260) | fn print_colorized_stream(
    method print_syntax_stream (line 276) | fn print_syntax_stream(
    method print_json_stream (line 288) | fn print_json_stream(&mut self, stream: &mut impl Read) -> io::Result<...
    method print_body_stream (line 331) | fn print_body_stream(
    method print_separator (line 347) | pub fn print_separator(&mut self) -> io::Result<()> {
    method print_request_headers (line 353) | pub fn print_request_headers<T>(&mut self, request: &Request, cookie_j...
    method print_response_headers (line 407) | pub fn print_response_headers(&mut self, response: &Response) -> io::R...
    method print_request_body (line 420) | pub fn print_request_body(&mut self, request: &mut Request) -> anyhow:...
    method print_response_body (line 437) | pub fn print_response_body(
    method print_response_meta (line 517) | pub fn print_response_meta(&mut self, response: &Response) -> anyhow::...
  type ContentType (line 536) | enum ContentType {
    method is_text (line 550) | fn is_text(&self) -> bool {
    method is_stream (line 562) | fn is_stream(&self) -> bool {
    method from (line 579) | fn from(content_type: &str) -> Self {
  function get_content_type (line 608) | fn get_content_type(headers: &HeaderMap) -> ContentType {
  function valid_json (line 615) | fn valid_json(text: &str) -> bool {
  function decode_blob (line 624) | fn decode_blob<'a>(
  function decode_blob_unconditional (line 649) | fn decode_blob_unconditional<'a>(
  function decode_stream (line 663) | fn decode_stream<'a>(
  function detect_encoding (line 698) | fn detect_encoding(mut bytes: &[u8], mut complete: bool, url: &Url) -> &...
  function get_tld (line 732) | fn get_tld(domain: &str) -> Option<&str> {
  function get_charset (line 742) | fn get_charset(response: &Response) -> Option<&'static Encoding> {
  function run_cmd (line 756) | fn run_cmd(args: impl IntoIterator<Item = String>, is_stdout_tty: bool) ...
  function temp_path (line 764) | fn temp_path() -> String {
  function terminal_mode (line 772) | fn terminal_mode() {
  function redirect_mode (line 779) | fn redirect_mode() {
  function terminal_mode_with_output_file (line 786) | fn terminal_mode_with_output_file() {
  function redirect_mode_with_output_file (line 794) | fn redirect_mode_with_output_file() {
  function terminal_mode_download (line 805) | fn terminal_mode_download() {
  function redirect_mode_download (line 812) | fn redirect_mode_download() {
  function terminal_mode_download_with_output_file (line 819) | fn terminal_mode_download_with_output_file() {
  function redirect_mode_download_with_output_file (line 830) | fn redirect_mode_download_with_output_file() {

FILE: src/redacted.rs
  type SecretString (line 11) | pub struct SecretString(String);
  type Err (line 14) | type Err = std::convert::Infallible;
  method from_str (line 16) | fn from_str(s: &str) -> Result<Self, Self::Err> {
  type Target (line 22) | type Target = String;
  method deref (line 24) | fn deref(&self) -> &String {
  method fmt (line 30) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method from (line 41) | fn from(string: SecretString) -> OsString {

FILE: src/redirect.rs
  type RedirectFollower (line 14) | pub struct RedirectFollower {
    method new (line 21) | pub fn new(
  method handle (line 34) | fn handle(&mut self, mut ctx: Context, mut first_request: Request) -> Re...
  type TooManyRedirects (line 79) | pub(crate) struct TooManyRedirects {
    method fmt (line 84) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  function get_next_request (line 96) | fn get_next_request(mut request: Request, response: &Response) -> Option...
  function is_cross_domain_redirect (line 144) | fn is_cross_domain_redirect(next: &Url, previous: &Url) -> bool {
  function remove_sensitive_headers (line 150) | fn remove_sensitive_headers(headers: &mut HeaderMap) {
  function remove_content_headers (line 160) | fn remove_content_headers(headers: &mut HeaderMap) {
  function remove_signature_headers (line 169) | fn remove_signature_headers(headers: &mut HeaderMap) {
  function remove_content_headers_removes_content_digest (line 181) | fn remove_content_headers_removes_content_digest() {

FILE: src/request_items.rs
  constant FORM_CONTENT_TYPE (line 18) | pub const FORM_CONTENT_TYPE: &str = "application/x-www-form-urlencoded";
  constant JSON_CONTENT_TYPE (line 19) | pub const JSON_CONTENT_TYPE: &str = "application/json";
  constant JSON_ACCEPT (line 20) | pub const JSON_ACCEPT: &str = "application/json, */*;q=0.5";
  type RequestItem (line 23) | pub enum RequestItem {
  type Err (line 50) | type Err = clap::Error;
  method from_str (line 51) | fn from_str(request_item: &str) -> clap::error::Result<RequestItem> {
  type PartWithParams (line 139) | struct PartWithParams {
  function parse_part_params (line 162) | fn parse_part_params(mut text: &str) -> PartWithParams {
  function rsplit_once_any (line 191) | fn rsplit_once_any<'a>(
  type RequestItems (line 209) | pub struct RequestItems {
    method has_form_files (line 253) | pub fn has_form_files(&self) -> bool {
    method headers (line 259) | pub fn headers(&self) -> Result<(HeaderMap<HeaderValue>, HashSet<Heade...
    method query (line 295) | pub fn query(&self) -> Result<Vec<(&str, Cow<'_, str>)>> {
    method body_as_json (line 308) | fn body_as_json(self) -> Result<Body> {
    method body_as_form (line 338) | fn body_as_form(self) -> Result<Body> {
    method body_as_multipart (line 361) | fn body_as_multipart(self) -> Result<Body> {
    method body_from_file (line 400) | fn body_from_file(self) -> Result<Body> {
    method body (line 452) | pub fn body(self) -> Result<Body> {
    method is_multipart (line 465) | pub fn is_multipart(&self) -> bool {
    method pick_method (line 478) | pub fn pick_method(&self) -> Method {
    method is_body_empty (line 486) | pub fn is_body_empty(&self) -> bool {
  type Body (line 214) | pub enum Body {
    method is_empty (line 227) | pub fn is_empty(&self) -> bool {
    method pick_method (line 243) | pub fn pick_method(&self) -> Method {
  function file_to_part (line 508) | pub fn file_to_part(path: impl AsRef<Path>) -> io::Result<multipart::Par...
  function request_item_parsing (line 529) | fn request_item_parsing() {
  function param_parsing (line 691) | fn param_parsing() {

FILE: src/session.rs
  type Meta (line 18) | enum Meta {
  method default (line 32) | fn default() -> Self {
  type Auth (line 41) | struct Auth {
  type LegacyCookie (line 49) | struct LegacyCookie {
  type Cookie (line 60) | struct Cookie {
  type Cookies (line 75) | enum Cookies {
  method default (line 83) | fn default() -> Self {
  type Header (line 89) | struct Header {
  type Headers (line 96) | enum Headers {
  method default (line 104) | fn default() -> Self {
  type Content (line 110) | struct Content {
    method migrate (line 119) | fn migrate(mut self) -> Self {
  type Session (line 159) | pub struct Session {
    method load_session (line 167) | pub fn load_session(url: Url, mut name_or_path: OsString, read_only: b...
    method headers (line 196) | pub fn headers(&self) -> Result<HeaderMap> {
    method save_headers (line 206) | pub fn save_headers(&mut self, headers: &HeaderMap) -> Result<()> {
    method auth (line 229) | pub fn auth(&self) -> Result<Option<auth::Auth>> {
    method save_auth (line 255) | pub fn save_auth(&mut self, auth: &auth::Auth) {
    method cookies (line 279) | pub fn cookies(&self) -> impl Iterator<Item = Result<cookie_store::Coo...
    method save_cookies (line 315) | pub fn save_cookies<'b, I>(&mut self, cookies: I)
    method persist (line 346) | pub fn persist(&self) -> Result<()> {
  function xh_version (line 362) | fn xh_version() -> String {
  function is_path (line 370) | fn is_path(value: &OsString) -> bool {
  function path_from_url (line 374) | fn path_from_url(url: &Url) -> Result<String> {
  function load_session_from_str (line 391) | fn load_session_from_str(s: &str) -> Result<Session> {
  function can_parse_old_httpie_session (line 401) | fn can_parse_old_httpie_session() -> Result<()> {
  function can_parse_old_xh_session (line 432) | fn can_parse_old_xh_session() -> Result<()> {
  function can_parse_session_with_unknown_meta (line 467) | fn can_parse_session_with_unknown_meta() {
  function can_parse_session_with_new_style_headers (line 482) | fn can_parse_session_with_new_style_headers() -> Result<()> {
  function can_parse_session_with_new_style_cookies (line 514) | fn can_parse_session_with_new_style_cookies() -> Result<()> {

FILE: src/to_curl.rs
  function print_curl_translation (line 12) | pub fn print_curl_translation(args: Cli) -> Result<()> {
  type Command (line 25) | pub struct Command {
    method new (line 33) | fn new(long: bool) -> Command {
    method opt (line 42) | fn opt(&mut self, short: &'static str, long: &'static str) {
    method arg (line 50) | fn arg(&mut self, arg: impl Into<OsString>) {
    method header (line 54) | fn header(&mut self, name: &str, value: &str) {
    method env (line 59) | fn env(&mut self, var: &'static str, value: impl Into<String>) {
    method warn (line 63) | fn warn(&mut self, message: impl Into<String>) {
    method fmt (line 69) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  function translate (line 83) | pub fn translate(args: Cli) -> Result<Command> {
  function examples (line 479) | fn examples() {

FILE: src/utils.rs
  function unescape (line 12) | pub fn unescape(text: &str, special_chars: &'static str) -> String {
  function clone_request (line 39) | pub fn clone_request(request: &mut Request) -> Result<Request> {
  function test_mode (line 49) | pub fn test_mode() -> bool {
  function test_pretend_term (line 58) | pub fn test_pretend_term() -> bool {
  function test_default_color (line 62) | pub fn test_default_color() -> bool {
  function random_string (line 67) | pub fn random_string() -> String {
  function config_dir (line 77) | pub fn config_dir() -> Option<PathBuf> {
  function get_home_dir (line 102) | pub fn get_home_dir() -> Option<PathBuf> {
  function expand_tilde (line 116) | pub fn expand_tilde(path: impl AsRef<Path>) -> PathBuf {
  function url_with_query (line 127) | pub fn url_with_query(mut url: Url, query: &[(&str, Cow<str>)]) -> Url {
  constant BUFFER_SIZE (line 152) | pub const BUFFER_SIZE: usize = 128 * 1024;
  function copy_largebuf (line 162) | pub fn copy_largebuf(
  type HeaderValueExt (line 183) | pub(crate) trait HeaderValueExt {
    method to_utf8_str (line 184) | fn to_utf8_str(&self) -> Result<&str, Utf8Error>;
    method to_ascii_or_latin1 (line 186) | fn to_ascii_or_latin1(&self) -> Result<&str, BadHeaderValue<'_>>;
    method to_utf8_str (line 190) | fn to_utf8_str(&self) -> Result<&str, Utf8Error> {
    method to_ascii_or_latin1 (line 198) | fn to_ascii_or_latin1(&self) -> Result<&str, BadHeaderValue<'_>> {
  type BadHeaderValue (line 204) | pub(crate) struct BadHeaderValue<'a> {
  function latin1 (line 217) | pub(crate) fn latin1(self) -> String {
  function utf8 (line 225) | pub(crate) fn utf8(self) -> Option<&'a str> {
  function reason_phrase (line 230) | pub(crate) fn reason_phrase(response: &Response) -> Cow<'_, str> {
  function test_latin1 (line 257) | fn test_latin1() {

FILE: tests/cases/auth_message_signature.rs
  constant KEY_MATERIAL (line 6) | const KEY_MATERIAL: &str = "secret-key-material";
  constant RSA_KEY_FIXTURE (line 7) | const RSA_KEY_FIXTURE: &str = "tests/fixtures/keys/rsa_private_key_pkcs8...
  function fixture_path (line 9) | fn fixture_path(relative_path: &str) -> String {
  function reconstruct_absolute_uri (line 13) | fn reconstruct_absolute_uri<B>(req: &mut hyper::Request<B>) {
  function message_signature_verification_on_server (line 23) | fn message_signature_verification_on_server() {
  function message_signature_redirect_follow_re_signs_request (line 67) | fn message_signature_redirect_follow_re_signs_request() {
  function message_signature_auth_defaults (line 116) | fn message_signature_auth_defaults() {
  function message_signature_auth_with_resolve_override (line 170) | fn message_signature_auth_with_resolve_override() {
  function message_signature_auth_ipv6_authority (line 216) | fn message_signature_auth_ipv6_authority() {
  function message_signature_auth_with_custom_components_and_digest (line 274) | fn message_signature_auth_with_custom_components_and_digest() {
  function message_signature_auth_with_multiple_set_cookie (line 331) | fn message_signature_auth_with_multiple_set_cookie() {
  function message_signature_auth_sf_parameter (line 386) | fn message_signature_auth_sf_parameter() {
  function message_signature_auth_key_parameter (line 430) | fn message_signature_auth_key_parameter() {
  function message_signature_auth_unsupported_parameters (line 475) | fn message_signature_auth_unsupported_parameters() {
  function message_signature_components_require_key_pair (line 505) | fn message_signature_components_require_key_pair() {
  function message_signature_with_basic_auth (line 519) | fn message_signature_with_basic_auth() {
  function message_signature_auth_normalization_assertion (line 574) | fn message_signature_auth_normalization_assertion() {
  function message_signature_auth_ed25519_pem (line 602) | fn message_signature_auth_ed25519_pem() {
  function message_signature_auth_rsa_pem (line 648) | fn message_signature_auth_rsa_pem() {
  function message_signature_auth_rsa_pem_requires_explicit_algorithm (line 694) | fn message_signature_auth_rsa_pem_requires_explicit_algorithm() {

FILE: tests/cases/compress_request_body.rs
  function zlib_decode (line 9) | fn zlib_decode(bytes: Vec<u8>) -> std::io::Result<String> {
  function server (line 16) | fn server() -> server::Server {
  function compress_request_body_json (line 49) | fn compress_request_body_json() {
  function compress_request_body_form (line 72) | fn compress_request_body_form() {
  function skip_compression_when_compression_ratio_is_negative (line 96) | fn skip_compression_when_compression_ratio_is_negative() {
  function test_compress_force_with_negative_ratio (line 113) | fn test_compress_force_with_negative_ratio() {
  function dont_compress_request_body_if_content_encoding_have_value (line 130) | fn dont_compress_request_body_if_content_encoding_have_value() {
  function compress_body_from_file (line 168) | fn compress_body_from_file() {
  function compress_body_from_file_unless_compress_rate_less_1 (line 198) | fn compress_body_from_file_unless_compress_rate_less_1() {
  function test_cannot_combine_compress_with_multipart (line 225) | fn test_cannot_combine_compress_with_multipart() {

FILE: tests/cases/download.rs
  function download (line 12) | fn download() {
  function accept_encoding_not_modifiable_in_download_mode (line 32) | fn accept_encoding_not_modifiable_in_download_mode() {
  function download_generated_filename (line 49) | fn download_generated_filename() {
  function download_supplied_filename (line 81) | fn download_supplied_filename() {
  function download_supplied_unicode_filename (line 102) | fn download_supplied_unicode_filename() {
  function download_support_filename_rfc_5987 (line 123) | fn download_support_filename_rfc_5987() {
  function download_support_filename_rfc_5987_percent_encoded (line 146) | fn download_support_filename_rfc_5987_percent_encoded() {
  function download_support_filename_rfc_5987_percent_encoded_with_iso_8859_1 (line 170) | fn download_support_filename_rfc_5987_percent_encoded_with_iso_8859_1() {
  function download_filename_star_with_high_priority (line 194) | fn download_filename_star_with_high_priority() {
  function download_supplied_unquoted_filename (line 218) | fn download_supplied_unquoted_filename() {
  function download_filename_with_directory_traversal (line 239) | fn download_filename_with_directory_traversal() {
  function download_filename_with_windows_directory_traversal (line 264) | fn download_filename_with_windows_directory_traversal() {
  function it_can_resume_a_download (line 292) | fn it_can_resume_a_download() {
  function it_can_resume_a_download_with_one_byte (line 327) | fn it_can_resume_a_download_with_one_byte() {
  function it_rejects_incorrect_content_range_headers (line 362) | fn it_rejects_incorrect_content_range_headers() {
  function it_refuses_to_combine_continue_and_range (line 396) | fn it_refuses_to_combine_continue_and_range() {
  function error_code_416_is_ignored_when_resuming_download (line 433) | fn error_code_416_is_ignored_when_resuming_download() {
  function error_code_416_is_not_ignored_when_not_resuming_download (line 471) | fn error_code_416_is_not_ignored_when_not_resuming_download() {

FILE: tests/cases/logging.rs
  function logs_are_printed_in_debug_mode (line 7) | fn logs_are_printed_in_debug_mode() {
  function logs_are_not_printed_outside_debug_mode (line 19) | fn logs_are_not_printed_outside_debug_mode() {
  function backtrace_is_printed_in_debug_mode (line 30) | fn backtrace_is_printed_in_debug_mode() {
  function backtrace_is_not_printed_outside_debug_mode (line 46) | fn backtrace_is_not_printed_outside_debug_mode() {
  function checked_status_is_printed_with_single_quiet (line 65) | fn checked_status_is_printed_with_single_quiet() {
  function checked_status_is_not_printed_with_double_quiet (line 82) | fn checked_status_is_not_printed_with_double_quiet() {
  function warning_for_invalid_redirect (line 99) | fn warning_for_invalid_redirect() {
  function warning_for_non_utf8_redirect (line 115) | fn warning_for_non_utf8_redirect() {
  function rustls_emits_logs (line 133) | fn rustls_emits_logs() {

FILE: tests/cases/unix_socket.rs
  function error_on_unsupported_platform (line 8) | fn error_on_unsupported_platform() {
  function json_post (line 21) | fn json_post() {
  function redirects_stay_on_same_server (line 55) | fn redirects_stay_on_same_server() {

FILE: tests/cases/xml.rs
  function xml_pretty_printing (line 6) | fn xml_pretty_printing() {
  function xml_pretty_printing_text_xml_content_type (line 30) | fn xml_pretty_printing_text_xml_content_type() {
  function xml_format_disabled (line 50) | fn xml_format_disabled() {
  function xml_custom_indent (line 68) | fn xml_custom_indent() {
  function xml_invalid_falls_back_gracefully (line 92) | fn xml_invalid_falls_back_gracefully() {
  function xml_declaration_preserved (line 106) | fn xml_declaration_preserved() {
  function xml_pretty_none (line 127) | fn xml_pretty_none() {
  function xml_streaming_skips_formatting (line 141) | fn xml_streaming_skips_formatting() {
  function xml_mixed_content_preserved (line 155) | fn xml_mixed_content_preserved() {
  function xml_already_formatted (line 175) | fn xml_already_formatted() {
  function xml_xhtml_content_type (line 197) | fn xml_xhtml_content_type() {

FILE: tests/cli.rs
  type RequestExt (line 25) | pub trait RequestExt {
    method query_params (line 26) | fn query_params(&self) -> HashMap<String, String>;
    method body (line 27) | fn body(self) -> Pin<Box<dyn Future<Output = Vec<u8>> + Send>>;
    method body_as_string (line 28) | fn body_as_string(self) -> Pin<Box<dyn Future<Output = String> + Send>>;
    method query_params (line 37) | fn query_params(&self) -> HashMap<String, String> {
    method body (line 43) | fn body(self) -> Pin<Box<dyn Future<Output = Vec<u8>> + Send>> {
    method body_as_string (line 48) | fn body_as_string(self) -> Pin<Box<dyn Future<Output = String> + Send>> {
  function random_string (line 54) | fn random_string() -> String {
  function find_runner (line 68) | fn find_runner() -> Option<String> {
  function get_base_command (line 77) | fn get_base_command() -> Command {
  function get_command (line 101) | fn get_command() -> Command {
  function redirecting_command (line 109) | fn redirecting_command() -> Command {
  function color_command (line 116) | fn color_command() -> Command {
  constant BINARY_SUPPRESSOR (line 122) | const BINARY_SUPPRESSOR: &str = concat!(
  function basic_json_post (line 142) | fn basic_json_post() {
  function full_json_response_utf8_decode (line 170) | fn full_json_response_utf8_decode() {
  function basic_get (line 209) | fn basic_get() {
  function basic_head (line 221) | fn basic_head() {
  function basic_options (line 233) | fn basic_options() {
  function multiline_value (line 249) | fn multiline_value() {
  function post_empty_body (line 263) | fn post_empty_body() {
  function nested_json (line 278) | fn nested_json() {
  function json_path_with_escaped_characters (line 300) | fn json_path_with_escaped_characters() {
  function nested_json_type_error (line 320) | fn nested_json_type_error() {
  function json_path_special_chars_not_escaped_in_form (line 353) | fn json_path_special_chars_not_escaped_in_form() {
  function header (line 368) | fn header() {
  function multiple_headers_with_same_key (line 380) | fn multiple_headers_with_same_key() {
  function query_param (line 394) | fn query_param() {
  function json_param (line 406) | fn json_param() {
  function verbose (line 418) | fn verbose() {
  function decode (line 460) | fn decode() {
  function streaming_decode (line 475) | fn streaming_decode() {
  function only_decode_for_terminal (line 490) | fn only_decode_for_terminal() {
  function do_decode_if_formatted (line 508) | fn do_decode_if_formatted() {
  function never_decode_if_binary (line 522) | fn never_decode_if_binary() {
  function binary_detection (line 541) | fn binary_detection() {
  function streaming_binary_detection (line 555) | fn streaming_binary_detection() {
  function request_binary_detection (line 569) | fn request_binary_detection() {
  function timeout (line 584) | fn timeout() {
  function timeout_no_limit (line 599) | fn timeout_no_limit() {
  function timeout_invalid (line 612) | fn timeout_invalid() {
  function check_status (line 645) | fn check_status() {
  function check_status_warning (line 661) | fn check_status_warning() {
  function check_status_is_implied (line 677) | fn check_status_is_implied() {
  function check_status_is_not_implied_in_compat_mode (line 693) | fn check_status_is_not_implied_in_compat_mode() {
  function user_password_auth (line 709) | fn user_password_auth() {
  function user_auth (line 722) | fn user_auth() {
  function bearer_auth (line 735) | fn bearer_auth() {
  function digest_auth (line 748) | fn digest_auth() {
  function successful_digest_auth (line 775) | fn successful_digest_auth() {
  function compress_request_body_online (line 786) | fn compress_request_body_online() {
  function unsuccessful_digest_auth (line 823) | fn unsuccessful_digest_auth() {
  function digest_auth_with_redirection (line 833) | fn digest_auth_with_redirection() {
  function netrc_env_user_password_auth (line 926) | fn netrc_env_user_password_auth() {
  function netrc_env_no_bearer_auth_unless_specified (line 948) | fn netrc_env_no_bearer_auth_unless_specified() {
  function netrc_env_auth_type_bearer (line 967) | fn netrc_env_auth_type_bearer() {
  function netrc_file_user_password_auth (line 987) | fn netrc_file_user_password_auth() {
  function get_proxy_command (line 1019) | fn get_proxy_command(
  function proxy_http_proxy (line 1033) | fn proxy_http_proxy() {
  function proxy_https_proxy (line 1046) | fn proxy_https_proxy() {
  function proxy_http_all_proxy (line 1062) | fn proxy_http_all_proxy() {
  function proxy_https_all_proxy (line 1078) | fn proxy_https_all_proxy() {
  function last_supplied_proxy_wins (line 1094) | fn last_supplied_proxy_wins() {
  function proxy_multiple_valid_proxies (line 1127) | fn proxy_multiple_valid_proxies() {
  function verify_default_yes (line 1142) | fn verify_default_yes() {
  function verify_explicit_yes (line 1161) | fn verify_explicit_yes() {
  function verify_no (line 1179) | fn verify_no() {
  function verify_valid_file (line 1190) | fn verify_valid_file() {
  function verify_valid_file_native_tls (line 1205) | fn verify_valid_file_native_tls() {
  function cert_without_key (line 1216) | fn cert_without_key() {
  function formatted_certificate_expired_message (line 1233) | fn formatted_certificate_expired_message() {
  function override_dns_resolution (line 1242) | fn override_dns_resolution() {
  function use_ipv4 (line 1271) | fn use_ipv4() {
  function use_ipv6 (line 1284) | fn use_ipv6() {
  function cert_with_key (line 1297) | fn cert_with_key() {
  function cert_with_key_native_tls (line 1311) | fn cert_with_key_native_tls() {
  function native_tls_flag_disabled (line 1326) | fn native_tls_flag_disabled() {
  function native_tls_works (line 1336) | fn native_tls_works() {
  function good_tls_version (line 1345) | fn good_tls_version() {
  function good_tls_version_nativetls (line 1355) | fn good_tls_version_nativetls() {
  function bad_tls_version (line 1365) | fn bad_tls_version() {
  function bad_tls_version_nativetls (line 1375) | fn bad_tls_version_nativetls() {
  function unsupported_tls_version_nativetls (line 1386) | fn unsupported_tls_version_nativetls() {
  function unsupported_tls_version_rustls (line 1399) | fn unsupported_tls_version_rustls() {
  function forced_json (line 1415) | fn forced_json() {
  function forced_form (line 1429) | fn forced_form() {
  function forced_multipart (line 1444) | fn forced_multipart() {
  function formatted_json_output (line 1458) | fn formatted_json_output() {
  function inferred_json_output (line 1478) | fn inferred_json_output() {
  function inferred_json_javascript_output (line 1498) | fn inferred_json_javascript_output() {
  function inferred_nonjson_output (line 1518) | fn inferred_nonjson_output() {
  function noninferred_json_output (line 1535) | fn noninferred_json_output() {
  function empty_body_defaults_to_get (line 1552) | fn empty_body_defaults_to_get() {
  function non_empty_body_defaults_to_post (line 1563) | fn non_empty_body_defaults_to_post() {
  function empty_raw_body_defaults_to_post (line 1577) | fn empty_raw_body_defaults_to_post() {
  function body_from_stdin (line 1592) | fn body_from_stdin() {
  function body_from_raw (line 1606) | fn body_from_raw() {
  function support_utf8_header_value (line 1619) | fn support_utf8_header_value() {
  function support_latin1_header_value (line 1644) | fn support_latin1_header_value() {
  function redirect_support_utf8_location (line 1668) | fn redirect_support_utf8_location() {
  function mixed_stdin_request_items (line 1719) | fn mixed_stdin_request_items() {
  function mixed_stdin_raw (line 1731) | fn mixed_stdin_raw() {
  function mixed_raw_request_items (line 1743) | fn mixed_raw_request_items() {
  function multipart_stdin (line 1754) | fn multipart_stdin() {
  function multipart_raw (line 1764) | fn multipart_raw() {
  function default_json_for_raw_body (line 1773) | fn default_json_for_raw_body() {
  function multipart_file_upload (line 1786) | fn multipart_file_upload() {
  function warn_for_filename_tag_on_body (line 1832) | fn warn_for_filename_tag_on_body() {
  function body_from_file (line 1859) | fn body_from_file() {
  function body_from_file_with_explicit_mimetype (line 1885) | fn body_from_file_with_explicit_mimetype() {
  function body_from_file_with_fallback_mimetype (line 1911) | fn body_from_file_with_fallback_mimetype() {
  function no_double_file_body (line 1937) | fn no_double_file_body() {
  function print_body_from_file (line 1946) | fn print_body_from_file() {
  function colored_headers (line 1968) | fn colored_headers() {
  function colored_body (line 1980) | fn colored_body() {
  function force_color_pipe (line 1989) | fn force_color_pipe() {
  function request_json_keys_order_is_preserved (line 2002) | fn request_json_keys_order_is_preserved() {
  function data_field_from_file (line 2015) | fn data_field_from_file() {
  function data_field_from_file_in_form_mode (line 2032) | fn data_field_from_file_in_form_mode() {
  function json_field_from_file (line 2050) | fn json_field_from_file() {
  function header_from_file (line 2067) | fn header_from_file() {
  function query_param_from_file (line 2084) | fn query_param_from_file() {
  function can_unset_default_headers (line 2101) | fn can_unset_default_headers() {
  function can_unset_headers (line 2116) | fn can_unset_headers() {
  function can_set_unset_header (line 2133) | fn can_set_unset_header() {
  function named_sessions (line 2150) | fn named_sessions() {
  function anonymous_sessions (line 2202) | fn anonymous_sessions() {
  function anonymous_read_only_session (line 2245) | fn anonymous_read_only_session() {
  function session_files_are_created_in_read_only_mode (line 2287) | fn session_files_are_created_in_read_only_mode() {
  function named_read_only_session (line 2330) | fn named_read_only_session() {
  function expired_cookies_are_removed_from_session (line 2380) | fn expired_cookies_are_removed_from_session() {
  function cookies_are_equal (line 2456) | fn cookies_are_equal(c1: &str, c2: &str) -> bool {
  function cookies_override_each_other_in_the_correct_order (line 2462) | fn cookies_override_each_other_in_the_correct_order() {
  function cookies_are_segmented_by_domain (line 2524) | fn cookies_are_segmented_by_domain() {
  function cookies_are_stored_with_default_path (line 2597) | fn cookies_are_stored_with_default_path() {
  function basic_auth_from_session_is_used (line 2640) | fn basic_auth_from_session_is_used() {
  function bearer_auth_from_session_is_used (line 2672) | fn bearer_auth_from_session_is_used() {
  function auth_netrc_is_not_persisted_in_session (line 2704) | fn auth_netrc_is_not_persisted_in_session() {
  function multiple_headers_with_same_key_in_session (line 2751) | fn multiple_headers_with_same_key_in_session() {
  function headers_from_session_are_overwritten (line 2796) | fn headers_from_session_are_overwritten() {
  function old_session_format_is_automatically_migrated (line 2838) | fn old_session_format_is_automatically_migrated() {
  function print_intermediate_requests_and_responses (line 2899) | fn print_intermediate_requests_and_responses() {
  function history_print (line 2950) | fn history_print() {
  function max_redirects_is_enforced (line 3003) | fn max_redirects_is_enforced() {
  function method_is_changed_when_following_302_redirect (line 3021) | fn method_is_changed_when_following_302_redirect() {
  function method_is_not_changed_when_following_307_redirect (line 3062) | fn method_is_not_changed_when_following_307_redirect() {
  function sensitive_headers_are_removed_after_cross_domain_redirect (line 3102) | fn sensitive_headers_are_removed_after_cross_domain_redirect() {
  function request_body_is_buffered_for_307_redirect (line 3139) | fn request_body_is_buffered_for_307_redirect() {
  function read_args_from_config (line 3174) | fn read_args_from_config() {
  function warns_if_config_is_invalid (line 3196) | fn warns_if_config_is_invalid() {
  function http1_0 (line 3215) | fn http1_0() {
  function http1_1 (line 3232) | fn http1_1() {
  function http2 (line 3247) | fn http2() {
  function http2_prior_knowledge (line 3261) | fn http2_prior_knowledge() {
  function http3_prior_knowledge (line 3288) | fn http3_prior_knowledge() {
  function override_response_charset (line 3300) | fn override_response_charset() {
  function override_response_mime (line 3317) | fn override_response_mime() {
  function omit_response_body (line 3340) | fn omit_response_body() {
  function encoding_detection (line 3361) | fn encoding_detection() {
  function tilde_expanded_in_request_items (line 3430) | fn tilde_expanded_in_request_items() {
  function gzip (line 3471) | fn gzip() {
  function deflate (line 3496) | fn deflate() {
  function brotli (line 3521) | fn brotli() {
  function zstd (line 3546) | fn zstd() {
  function empty_response_with_content_encoding (line 3571) | fn empty_response_with_content_encoding() {
  function empty_response_with_content_encoding_and_content_length (line 3594) | fn empty_response_with_content_encoding_and_content_length() {
  function empty_zstd_response_with_content_encoding_and_content_length (line 3620) | fn empty_zstd_response_with_content_encoding_and_content_length() {
  function streaming_empty_zstd_response_with_content_encoding_and_content_length (line 3646) | fn streaming_empty_zstd_response_with_content_encoding_and_content_lengt...
  function response_meta (line 3672) | fn response_meta() {
  function redirect_with_response_meta (line 3689) | fn redirect_with_response_meta() {
  function digest_auth_with_response_meta (line 3725) | fn digest_auth_with_response_meta() {
  function non_get_redirect_translation_warning (line 3737) | fn non_get_redirect_translation_warning() {
  function custom_json_indent_level (line 3745) | fn custom_json_indent_level() {
  function unsorted_headers (line 3769) | fn unsorted_headers() {
  function multiple_format_options_are_merged (line 3797) | fn multiple_format_options_are_merged() {
  function reason_phrase_is_preserved (line 3827) | fn reason_phrase_is_preserved() {

FILE: tests/server/mod.rs
  type Body (line 18) | type Body = Full<Bytes>;
  type Builder (line 19) | type Builder = hyper_util::server::conn::auto::Builder<hyper_util::rt::T...
  type Listener (line 21) | enum Listener {
  type Server (line 27) | pub struct Server {
    method base_url (line 37) | pub fn base_url(&self) -> String {
    method url (line 51) | pub fn url(&self, path: &str) -> String {
    method host (line 69) | pub fn host(&self) -> String {
    method socket_path (line 81) | pub fn socket_path(&self) -> std::path::PathBuf {
    method port (line 94) | pub fn port(&self) -> u16 {
    method assert_hits (line 102) | pub fn assert_hits(&self, hits: u8) {
    method disable_hit_checks (line 106) | pub fn disable_hit_checks(&mut self) {
  method drop (line 112) | fn drop(&mut self) {
  function http (line 141) | pub fn http<F, Fut>(func: F) -> Server
  function http_unix (line 154) | pub fn http_unix<F, Fut>(func: F) -> Server
  function http_v6 (line 167) | pub fn http_v6<F, Fut>(func: F) -> Option<Server>
  type Serv (line 184) | type Serv = dyn Fn(Request<hyper::body::Incoming>) -> Box<ServFut> + Sen...
  type ServFut (line 185) | type ServFut = dyn Future<Output = Response<Body>> + Send + Unpin;
  function http_inner (line 187) | fn http_inner(
Condensed preview — 71 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (852K chars).
[
  {
    "path": ".github/workflows/ci.yaml",
    "chars": 2866,
    "preview": "name: CI\n\non:\n  pull_request:\n  push:\n    branches: [master]\n  schedule:\n    - cron: \"00 00 * * *\"\n\njobs:\n  test:\n    na"
  },
  {
    "path": ".github/workflows/release.yaml",
    "chars": 4880,
    "preview": "name: release\n\non:\n  push:\n    tags: [v*.*.*]\n\njobs:\n  test:\n    name: Test\n    runs-on: ${{ matrix.job.os }}\n    timeou"
  },
  {
    "path": ".gitignore",
    "chars": 44,
    "preview": "/.direnv\n/.envrc\n/target\n/.vscode\n.DS_Store\n"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 16556,
    "preview": "## Unreleased\n### Features\n- Pretty-print XML responses, see #450 (@o1x3)\n- Add experimental HTTP message signatures (RF"
  },
  {
    "path": "Cargo.toml",
    "chars": 4866,
    "preview": "[package]\nname = \"xh\"\nversion = \"0.25.3\"\nauthors = [\"ducaale <sharaf.13@hotmail.com>\"]\nedition = \"2024\"\nrust-version = \""
  },
  {
    "path": "FAQ.md",
    "chars": 1682,
    "preview": "<h3 name=\"header-value-encoding\">Why do some HTTP headers show up mangled?</h3>\n\nHTTP header values are officially only "
  },
  {
    "path": "LICENSE",
    "chars": 1071,
    "preview": "MIT License\n\nCopyright (c) 2021 Mohamed Daahir\n\nPermission is hereby granted, free of charge, to any person obtaining a "
  },
  {
    "path": "README.md",
    "chars": 12412,
    "preview": "# xh\n[![Version info](https://img.shields.io/crates/v/xh.svg)](https://crates.io/crates/xh)\n[![Packaging status](https:/"
  },
  {
    "path": "RELEASE-CHECKLIST.md",
    "chars": 1191,
    "preview": "## Release Checklist\n\n- Update `README.md`'s Usage section with the output of `xh --help`\n- Update `CHANGELOG.md` (renam"
  },
  {
    "path": "assets/README.md",
    "chars": 1171,
    "preview": "## Syntaxes and themes used\n- [Sublime-HTTP](https://github.com/samsalisbury/Sublime-HTTP)\n- [json-kv](https://github.co"
  },
  {
    "path": "assets/syntax/basic/json.sublime-syntax",
    "chars": 1127,
    "preview": "%YAML 1.2\n---\n# http://www.sublimetext.com/docs/3/syntax.html\nname: JSON Key-Value\nfile_extensions:\n  - json\nscope: sour"
  },
  {
    "path": "assets/syntax/large/css.sublime-syntax",
    "chars": 73723,
    "preview": "%YAML 1.2\n---\n# Derived from https://github.com/i-akhmadullin/Sublime-CSS3\nname: CSS\nfile_extensions:\n  - css\n  - css.er"
  },
  {
    "path": "assets/syntax/large/html.sublime-syntax",
    "chars": 15541,
    "preview": "%YAML 1.2\n---\nname: HTML\nfile_extensions:\n  - html\n  - htm\n  - shtml\n  - xhtml\n  - inc\n  - tmpl\n  - tpl\nfirst_line_match"
  },
  {
    "path": "assets/syntax/large/js.sublime-syntax",
    "chars": 45577,
    "preview": "%YAML 1.2\n---\n# Derived from JavaScript Next: https://github.com/Benvie/JavaScriptNext.tmLanguage\nname: JavaScript\nfile_"
  },
  {
    "path": "assets/syntax/large/xml.sublime-syntax",
    "chars": 8253,
    "preview": "%YAML 1.2\n---\nname: XML\nfile_extensions:\n  - xml\n  - xsd\n  - xslt\n  - tld\n  - dtml\n  - rss\n  - opml\n  - svg\nfirst_line_m"
  },
  {
    "path": "assets/themes/ansi.tmTheme",
    "chars": 6273,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "assets/themes/fruity.tmTheme",
    "chars": 6194,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "assets/themes/monokai.tmTheme",
    "chars": 6962,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "assets/themes/solarized.tmTheme",
    "chars": 6572,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "build.rs",
    "chars": 1742,
    "preview": "use std::env;\nuse std::fs::read_dir;\nuse std::path::Path;\n\nuse syntect::dumps::dump_to_file;\nuse syntect::highlighting::"
  },
  {
    "path": "completions/_xh",
    "chars": 7428,
    "preview": "#compdef xh\n\nautoload -U is-at-least\n\n_xh() {\n    typeset -A opt_args\n    typeset -a _arguments_options\n    local ret=1\n"
  },
  {
    "path": "completions/_xh.ps1",
    "chars": 18706,
    "preview": "\nusing namespace System.Management.Automation\nusing namespace System.Management.Automation.Language\n\nRegister-ArgumentCo"
  },
  {
    "path": "completions/xh.bash",
    "chars": 7240,
    "preview": "_xh() {\n    local i cur prev opts cmd\n    COMPREPLY=()\n    if [[ \"${BASH_VERSINFO[0]}\" -ge 4 ]]; then\n        cur=\"$2\"\n "
  },
  {
    "path": "completions/xh.elv",
    "chars": 8527,
    "preview": "\nuse builtin;\nuse str;\n\nset edit:completion:arg-completer[xh] = {|@words|\n    fn spaces {|n|\n        builtin:repeat $n '"
  },
  {
    "path": "completions/xh.fish",
    "chars": 6909,
    "preview": "# Complete paths after @ in options:\nfunction __xh_complete_data\n    string match -qr '^(?<prefix>.*@)(?<path>.*)' -- (c"
  },
  {
    "path": "completions/xh.nu",
    "chars": 6272,
    "preview": "module completions {\n\n  def \"nu-complete xh pretty\" [] {\n    [ \"all\" \"colors\" \"format\" \"none\" ]\n  }\n\n  def \"nu-complete "
  },
  {
    "path": "doc/man-template.roff",
    "chars": 4028,
    "preview": ".TH XH 1 {{date}} {{version}} \"User Commands\"\n\n.SH NAME\nxh \\- Friendly and fast tool for sending HTTP requests\n\n.SH SYNO"
  },
  {
    "path": "doc/xh.1",
    "chars": 13759,
    "preview": ".TH XH 1 2026-01-14 0.25.3 \"User Commands\"\n\n.SH NAME\nxh \\- Friendly and fast tool for sending HTTP requests\n\n.SH SYNOPSI"
  },
  {
    "path": "install.ps1",
    "chars": 2823,
    "preview": "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12\n\n$ProgressPreference = 'SilentlyContinue"
  },
  {
    "path": "install.sh",
    "chars": 2394,
    "preview": "#!/bin/sh\n\nset -e\n\nif [ \"$(uname -s)\" = \"Darwin\" ] && [ \"$(uname -m)\" = \"x86_64\" ]; then\n    target=\"x86_64-apple-darwin"
  },
  {
    "path": "src/auth.rs",
    "chars": 4038,
    "preview": "use std::io;\n\nuse anyhow::Result;\nuse regex_lite::Regex;\nuse reqwest::StatusCode;\nuse reqwest::blocking::{Request, Respo"
  },
  {
    "path": "src/buffer.rs",
    "chars": 9827,
    "preview": "//! The [`Buffer`] type is responsible for writing the program output, be it\n//! to a terminal or a pipe or a file. It s"
  },
  {
    "path": "src/cli.rs",
    "chars": 62310,
    "preview": "use std::convert::TryFrom;\nuse std::env;\nuse std::ffi::OsString;\nuse std::fmt;\nuse std::fs;\nuse std::io::Write;\nuse std:"
  },
  {
    "path": "src/content_disposition.rs",
    "chars": 6331,
    "preview": "use percent_encoding::percent_decode_str;\n\n/// Parse filename from Content-Disposition header\n/// Prioritizes filename* "
  },
  {
    "path": "src/decoder.rs",
    "chars": 14246,
    "preview": "use std::cell::Cell;\nuse std::io::{self, Read};\nuse std::rc::Rc;\nuse std::str::FromStr;\n\nuse brotli::Decompressor as Bro"
  },
  {
    "path": "src/download.rs",
    "chars": 10159,
    "preview": "use std::fs::{self, File, OpenOptions};\nuse std::io::{self, ErrorKind, IsTerminal};\nuse std::path::{Path, PathBuf};\nuse "
  },
  {
    "path": "src/error_reporting.rs",
    "chars": 2595,
    "preview": "use std::process::ExitCode;\n\npub(crate) fn additional_messages(err: &anyhow::Error, native_tls: bool) -> Vec<String> {\n "
  },
  {
    "path": "src/formatting/headers.rs",
    "chars": 9075,
    "preview": "use std::io::Result;\n\nuse reqwest::{\n    Method, StatusCode, Version,\n    header::{HeaderMap, HeaderName, HeaderValue},\n"
  },
  {
    "path": "src/formatting/mod.rs",
    "chars": 6828,
    "preview": "use std::{\n    io::{self, Write},\n    sync::{LazyLock, OnceLock},\n};\n\nuse quick_xml::events::Event;\nuse quick_xml::{Read"
  },
  {
    "path": "src/formatting/palette.rs",
    "chars": 2193,
    "preview": "//! We used to use syntect for all of our coloring and we still use syntect-compatible\n//! files to store themes.\n//!\n//"
  },
  {
    "path": "src/generation.rs",
    "chars": 7119,
    "preview": "use std::io;\n\nuse clap_complete::Shell;\nuse clap_complete_nushell::Nushell;\n\nuse crate::cli::Cli;\nuse crate::cli::Genera"
  },
  {
    "path": "src/main.rs",
    "chars": 30343,
    "preview": "#![allow(clippy::bool_assert_comparison)]\nmod auth;\nmod buffer;\nmod cli;\nmod content_disposition;\nmod decoder;\nmod downl"
  },
  {
    "path": "src/message_signature.rs",
    "chars": 23578,
    "preview": "use std::collections::HashSet;\n\nuse anyhow::{Context, Result, anyhow, bail};\nuse base64::{Engine as _, engine::general_p"
  },
  {
    "path": "src/middleware.rs",
    "chars": 3364,
    "preview": "use std::time::{Duration, Instant};\n\nuse anyhow::Result;\nuse reqwest::blocking::{Client, Request, Response};\n\n#[derive(C"
  },
  {
    "path": "src/nested_json.rs",
    "chars": 14977,
    "preview": "//! Insert value into JSON at an arbitrary location specified by a JSON path.\n//!\n//! Where JSON path is a string that s"
  },
  {
    "path": "src/netrc.rs",
    "chars": 15808,
    "preview": "//! See https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-file.html\n//!\n//! And https://github.com/"
  },
  {
    "path": "src/printer.rs",
    "chars": 31346,
    "preview": "use std::borrow::Cow;\nuse std::io::{self, BufRead, BufReader, Read, Write};\nuse std::time::Instant;\n\nuse encoding_rs::En"
  },
  {
    "path": "src/redacted.rs",
    "chars": 1130,
    "preview": "use std::ffi::OsString;\nuse std::fmt::{self, Debug};\nuse std::ops::Deref;\nuse std::str::FromStr;\n\n/// A String that does"
  },
  {
    "path": "src/redirect.rs",
    "chars": 7130,
    "preview": "use anyhow::Result;\nuse reqwest::blocking::{Request, Response};\nuse reqwest::header::{\n    AUTHORIZATION, CONTENT_ENCODI"
  },
  {
    "path": "src/request_items.rs",
    "chars": 26224,
    "preview": "use std::{\n    borrow::Cow,\n    collections::HashSet,\n    fs::{self, File},\n    io,\n    path::{Path, PathBuf},\n    str::"
  },
  {
    "path": "src/session.rs",
    "chars": 18645,
    "preview": "use std::collections::HashMap;\nuse std::convert::TryInto;\nuse std::ffi::OsString;\nuse std::fs;\nuse std::io::{self, Write"
  },
  {
    "path": "src/to_curl.rs",
    "chars": 20791,
    "preview": "use std::io::{Write, stderr, stdout};\n\nuse anyhow::{Context, Result, anyhow};\nuse os_display::Quotable;\nuse reqwest::{Me"
  },
  {
    "path": "src/utils.rs",
    "chars": 9226,
    "preview": "use std::borrow::Cow;\nuse std::env::var_os;\nuse std::io::{self, Write};\nuse std::path::{Path, PathBuf};\nuse std::str::Ut"
  },
  {
    "path": "tests/cases/auth_message_signature.rs",
    "chars": 23358,
    "preview": "use crate::{get_command, server};\nuse base64::engine::general_purpose::STANDARD;\nuse httpsig_hyper::HyperSigError;\nuse h"
  },
  {
    "path": "tests/cases/compress_request_body.rs",
    "chars": 6490,
    "preview": "use std::{fs::OpenOptions, io::Read as _};\n\nuse hyper::header::HeaderValue;\nuse predicates::str::contains;\n\nuse crate::p"
  },
  {
    "path": "tests/cases/download.rs",
    "chars": 12842,
    "preview": "use std::{\n    fs::{self, OpenOptions},\n    io::Write,\n};\n\nuse predicates::str::contains;\nuse tempfile::tempdir;\n\nuse cr"
  },
  {
    "path": "tests/cases/logging.rs",
    "chars": 3726,
    "preview": "use hyper::header::HeaderValue;\nuse predicates::str::contains;\n\nuse crate::prelude::*;\n\n#[test]\nfn logs_are_printed_in_d"
  },
  {
    "path": "tests/cases/mod.rs",
    "chars": 152,
    "preview": "#[cfg(feature = \"http-message-signatures\")]\nmod auth_message_signature;\nmod compress_request_body;\nmod download;\nmod log"
  },
  {
    "path": "tests/cases/unix_socket.rs",
    "chars": 3574,
    "preview": "#[cfg(unix)]\nuse indoc::indoc;\n\nuse crate::prelude::*;\n\n#[cfg(not(unix))]\n#[test]\nfn error_on_unsupported_platform() {\n "
  },
  {
    "path": "tests/cases/xml.rs",
    "chars": 5576,
    "preview": "use indoc::indoc;\n\nuse crate::prelude::*;\n\n#[test]\nfn xml_pretty_printing() {\n    let server = server::http(|_req| async"
  },
  {
    "path": "tests/cli.rs",
    "chars": 105706,
    "preview": "#![allow(clippy::bool_assert_comparison)]\n\nmod cases;\nmod server;\n\nuse std::collections::{HashMap, HashSet};\nuse std::fs"
  },
  {
    "path": "tests/fixtures/certs/README.md",
    "chars": 401,
    "preview": "# Test Fixtures: HTTPS Certificates\n\n## Client certificate\n\nSource: https://github.com/jihchi/ht/pull/1#issuecomment-777"
  },
  {
    "path": "tests/fixtures/certs/client.badssl.com.crt",
    "chars": 1972,
    "preview": "Bag Attributes\n    localKeyID: 41 C3 6C 33 C7 E3 36 DD EA 4A 1F C0 B7 23 B8 E6 9C DC D8 0F\nsubject=C = US, ST = Californ"
  },
  {
    "path": "tests/fixtures/certs/client.badssl.com.key",
    "chars": 1675,
    "preview": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAxzdfEeseTs/rukjly6MSLHM+Rh0enA3Ai4Mj2sdl31x3SbPo\nen08utVhjPmlxIUdkiMG4+f"
  },
  {
    "path": "tests/fixtures/certs/wildcard-self-signed.pem",
    "chars": 1265,
    "preview": "-----BEGIN CERTIFICATE-----\nMIIDeTCCAmGgAwIBAgIJAIb7Tcjl3Q8YMA0GCSqGSIb3DQEBCwUAMGIxCzAJBgNV\nBAYTAlVTMRMwEQYDVQQIDApDYWx"
  },
  {
    "path": "tests/fixtures/keys/rsa_private_key_pkcs8.pem",
    "chars": 1704,
    "preview": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDHaZKiFICB5Fbu\nkJ5Quzmj11SGXeEuwrbmmS/hC/o"
  },
  {
    "path": "tests/fixtures/responses/README.md",
    "chars": 342,
    "preview": "# Test Fixtures: Compressed Responses\n\n```sh\n$ echo \"Hello world\" > hello_world\n$ pigz hello_world # hello_world.gz\n\n$ e"
  },
  {
    "path": "tests/server/mod.rs",
    "chars": 10174,
    "preview": "// Copied from https://raw.githubusercontent.com/seanmonstar/reqwest/v0.12.0/tests/support/server.rs\n// with some slight"
  }
]

// ... and 3 more files (download for full content)

About this extraction

This page contains the full source code of the ducaale/xh GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 71 files (794.0 KB), approximately 201.4k tokens, and a symbol index with 735 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!