# Queries | Toshiki's Note
One of the key features of Twoslash is the ability to use the TypeScript compiler to pull out type information about your code.
Author: Anda Toshiki
Keywords: Toshiki, Anda Toshiki, andatoshiki, GitHub, GitHub action, Vitepress, Vite, Notebook, Knowledge base, Programming, Programming Notes, Academic, Personal, Notebook, Productivity, Journal, Note-taking, Markdown, Notepad, Organization, Tutorial

Skip to content

####

# Queries ​

Author:Anda Toshiki
Updated:a minute ago
Words:167
Reading:1 min

One of the key features of Twoslash is the ability to use the TypeScript compiler to pull out type information about your code. Twoslash comes with two different ways to query your code: `?^` and `?|`.

## Extract Type `^?` ​

Using `^?` you can pull out type information about a particular identifier in the line of code above it.

outputmarkdown
ts

    tsconst hi = 'Hello'const msg = hi + ', world'      const msg: string

    tsconst hi = 'Hello'const msg = hi + ', world'      const msg: string

1
md

    ```ts twoslash
    const hi = 'Hello'
    const msg = hi + ', world'
    //    ^?
    ```

    ```ts twoslash
    const hi = 'Hello'
    const msg = hi + ', world'
    //    ^?
    ```

1
2
3
4
5

## Completions `^|` ​

Using `^|` you can pull out information about a what the auto-complete looks like at a particular location.

outputmarkdown
ts

    tsconsole.e         error

    tsconsole.e         error

1
md

    ```ts twoslash
    // @noErrors
    console.e
    //       ^|
    ```

    ```ts twoslash
    // @noErrors
    console.e
    //       ^|
    ```

1
2
3
4
5

INFO

Note that the compiler flag for `// @noErrors` is set, because `console.e` is a failing TypeScript code sample but we don't really care about that.