language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

`Go To Definition` broken in v6.6+

Open erbiker opened this issue 1 year ago • 3 comments

Bug description

Go To Definition (cmd-click or sub menu) is broken, does not respond.

How to reproduce

In a schema.prisma file, right click on a reference to a model within another model's definition (i.e. a many-many relation). Trigger Go To Definition. Nothing will happen.

Expected behavior

When running Go To Definition, the editor should navigate to the model definition within the schema.prisma file.

Prisma information

Prisma output in v6.7.1 (bug, does not work)

[Trace - 12:59:13 PM] Sending request 'textDocument/hover - (16)'.
Params: {
    "textDocument": {
        "uri": "file://~/lib/src/prisma/schema.prisma"
    },
    "position": {
        "line": 3303,
        "character": 15
    }
}


[Trace - 12:59:14 PM] Received response 'textDocument/hover - (16)' in 51ms.
Result: {
    "contents": {
        "kind": "markdown",
        "value": "```prisma\nmodel org {}\n```\n___\n"
    }
}


[Trace - 12:59:17 PM] Sending request 'textDocument/definition - (17)'.
Params: {
    "textDocument": {
        "uri": "file://~/lib/src/prisma/schema.prisma"
    },
    "position": {
        "line": 3303,
        "character": 16
    }
}


[Trace - 12:59:17 PM] Received response 'textDocument/definition - (17)' in 13ms.
No result returned.


[Trace - 12:59:19 PM] Sending request 'textDocument/definition - (18)'.
Params: {
    "textDocument": {
        "uri": "file://~/lib/src/prisma/schema.prisma"
    },
    "position": {
        "line": 3303,
        "character": 16
    }
}


[Trace - 12:59:19 PM] Received response 'textDocument/definition - (18)' in 22ms.
No result returned.

Prisma output in v6.5.0 (works as expected)

[Trace - 1:01:55 PM] Received response 'textDocument/hover - (11)' in 55ms.
Result: {
    "contents": {
        "kind": "markdown",
        "value": "```prisma\nmodel org {\n\t...\n\tcustomer_data_zendesk_ticket_forms_data customer_data_zendesk_ticket_forms_data[] @relation(name: \"customer_data_zendesk_ticket_forms_dataToorg\")\n}\n```\n___\none-to-many\n___\n"
    }
}


[Trace - 1:01:58 PM] Sending request 'textDocument/definition - (12)'.
Params: {
    "textDocument": {
        "uri": "file://~/lib/src/prisma/schema.prisma"
    },
    "position": {
        "line": 3303,
        "character": 15
    }
}


[Trace - 1:01:58 PM] Received response 'textDocument/definition - (12)' in 35ms.
Result: [
    {
        "targetUri": "file://~/lib/src/prisma/schema.prisma",
        "targetRange": {
            "start": {
                "line": 1604,
                "character": 0
            },
            "end": {
                "line": 1815,
                "character": 1
            }
        },
        "targetSelectionRange": {
            "start": {
                "line": 1604,
                "character": 6
            },
            "end": {
                "line": 1604,
                "character": 9
            }
        }
    }
]


[Trace - 1:02:02 PM] Sending request 'textDocument/definition - (13)'.
Params: {
    "textDocument": {
        "uri": "file://~/lib/src/prisma/schema.prisma"
    },
    "position": {
        "line": 3303,
        "character": 15
    }
}


[Trace - 1:02:02 PM] Received response 'textDocument/definition - (13)' in 35ms.
Result: [
    {
        "targetUri": "file://~/lib/src/prisma/schema.prisma",
        "targetRange": {
            "start": {
                "line": 1604,
                "character": 0
            },
            "end": {
                "line": 1815,
                "character": 1
            }
        },
        "targetSelectionRange": {
            "start": {
                "line": 1604,
                "character": 6
            },
            "end": {
                "line": 1604,
                "character": 9
            }
        }
    }
]

Environment & setup

  • OS: macOS 15.4.1
  • Editor: Cursor v0.49.6 (also broken in VSCode 1.96.4)
  • Extension version: Bug present in versions 6.6.0, 6.7.0, 6.7.1 (works in v6.5.0)

erbiker avatar May 12 '25 20:05 erbiker

Also broken for me

OS: macOS 14.3.1 Editor: Cursor v0.48.8 Extension version: 6.7.1

DavidLangva avatar May 13 '25 23:05 DavidLangva

For those who have encountered this problem, try deleting this schema.prisma in the client folder Image

HiepPP avatar Jul 01 '25 04:07 HiepPP

For those who have encountered this problem, try deleting this schema.prisma in the client folder Image

This works! But I should remove it after every "generate" I run... Not so convenient But thanks anyway

marcelino-borges avatar Jan 17 '26 16:01 marcelino-borges