---
source: crates/tinymist-query/src/code_context.rs
expression: "JsonRepr::new_redacted(result, &REDACT_LOC)"
input_file: crates/tinymist-query/src/fixtures/code_context_path_at/in_dir.typ
---
[
 {
  "code": "$root/$dir/$name",
  "inputs": {
   "x-path-context": "vscode-paste",
   "x-path-input-name": "img.png",
   "x-path-input-uri": "https://huh.io/img.png"
  },
  "response": [
   {
    "kind": "pathAt",
    "value": "the_dir/x_in_dir"
   }
  ]
 },
 {
  "code": "$root/$name",
  "inputs": {
   "x-path-context": "vscode-paste",
   "x-path-input-name": "img.png",
   "x-path-input-uri": "https://huh.io/img.png"
  },
  "response": [
   {
    "kind": "pathAt",
    "value": "x_in_dir"
   }
  ]
 },
 {
  "code": "$root/assets",
  "inputs": {
   "x-path-context": "vscode-paste",
   "x-path-input-name": "img.png",
   "x-path-input-uri": "https://huh.io/img.png"
  },
  "response": [
   {
    "kind": "pathAt",
    "value": "assets"
   }
  ]
 },
 {
  "code": "$root/assets/$name",
  "inputs": {
   "x-path-context": "vscode-paste",
   "x-path-input-name": "img.png",
   "x-path-input-uri": "https://huh.io/img.png"
  },
  "response": [
   {
    "kind": "pathAt",
    "value": "assets/x_in_dir"
   }
  ]
 },
 {
  "code": "{ join(root, \"x\", dir, \"y\", name) }",
  "inputs": {
   "x-path-context": "vscode-paste",
   "x-path-input-name": "img.png",
   "x-path-input-uri": "https://huh.io/img.png"
  },
  "response": [
   {
    "kind": "pathAt",
    "value": "x/the_dir/y/x_in_dir"
   }
  ]
 },
 {
  "code": "{ join(root, 1) }",
  "inputs": {
   "x-path-context": "vscode-paste",
   "x-path-input-name": "img.png",
   "x-path-input-uri": "https://huh.io/img.png"
  },
  "response": [
   {
    "error": "crates/tinymist-query/src/code_context.rs:277:21: failed to evaluate path expression: error: join argument is not a string: 1\n  ┌─ /__redacted_path__.typ:1:2\n  │\n1 │ { join(root, 1) }\n  │   ^^^^^^^^^^^^^\n\n",
    "kind": "pathAt"
   }
  ]
 },
 {
  "code": "{ join(roo, 1) }",
  "inputs": {
   "x-path-context": "vscode-paste",
   "x-path-input-name": "img.png",
   "x-path-input-uri": "https://huh.io/img.png"
  },
  "response": [
   {
    "error": "crates/tinymist-query/src/code_context.rs:277:21: failed to evaluate path expression: error: unknown variable: roo\n  ┌─ /__redacted_path__.typ:1:7\n  │\n1 │ { join(roo, 1) }\n  │        ^^^\n\n",
    "kind": "pathAt"
   }
  ]
 },
 {
  "code": "{ import \"/resolve.typ\": resolve; resolve(join, root, dir, name) }",
  "inputs": {
   "x-path-context": "vscode-paste",
   "x-path-input-name": "img.png",
   "x-path-input-uri": "https://huh.io/img.png"
  },
  "response": [
   {
    "error": "crates/tinymist-query/src/code_context.rs:277:21: failed to evaluate path expression: error: file not found (searched at /__redacted_path__.typ)\n  ┌─ /__redacted_path__.typ:1:9\n  │\n1 │ { import \"/resolve.typ\": resolve; resolve(join, root, dir, name) }\n  │          ^^^^^^^^^^^^^^\n\n",
    "kind": "pathAt"
   }
  ]
 },
 {
  "code": "{ import \"/resolve.typ\": resolve; resolve(join, root, dir, name) }",
  "inputs": {
   "x-path-context": "vscode-paste",
   "x-path-input-name": "text.md",
   "x-path-input-uri": "https://huh.io/text.md"
  },
  "response": [
   {
    "error": "crates/tinymist-query/src/code_context.rs:277:21: failed to evaluate path expression: error: file not found (searched at /__redacted_path__.typ)\n  ┌─ /__redacted_path__.typ:1:9\n  │\n1 │ { import \"/resolve.typ\": resolve; resolve(join, root, dir, name) }\n  │          ^^^^^^^^^^^^^^\n\n",
    "kind": "pathAt"
   }
  ]
 }
]
