prisma / language-tools

🌐 Prisma Language Tools = Language Server and Prisma's VS Code extension.
https://marketplace.visualstudio.com/items?itemName=Prisma.prisma
Apache License 2.0
257 stars 40 forks source link

VSCode Extension - Connection to server got closed. Server will not be restarted. #890

Closed JClackett closed 3 years ago

JClackett commented 3 years ago

Bug description

Extension seems to fail when opening the schema file

How to reproduce

Just opening the prisma schema file in vscode

Expected behavior

Autocomplete & formatting to work

Prisma information

[Info  - 4:00:02 PM] Default version of Prisma binary 'prisma-fmt': c22652b7e418506fab23052d569b85d3aec4883f
[Info  - 4:00:02 PM] Extension name @prisma/language-server with version 3.1.103
[Info  - 4:00:02 PM] Prisma Engines version: 3.1.0-24.c22652b7e418506fab23052d569b85d3aec4883f
[Info  - 4:00:02 PM] Prisma CLI version: 3.1.1
[Info  - 4:00:02 PM] Local prisma-fmt path: /Users/jclackett/.vscode/extensions/prisma.prisma-3.0.3/node_modules/@prisma/language-server/dist/src/prisma-fmt/prisma-fmt.c22652b7e418506fab23052d569b85d3aec4883f
[Error - 4:00:02 PM] Connection to server got closed. Server will not be restarted.

using:

"@prisma/client": "~3.0.2",
"prisma": "~3.0.2",
Screenshot 2021-09-28 at 16 02 39

Stack trace


[Trace - 7:17:11 PM] Received response 'textDocument/codeAction - (1)' in 28ms.
Result: []

[Info  - 7:17:11 PM] Connection to server got closed. Server will restart.
[Trace - 7:17:11 PM] Sending request 'initialize - (0)'.
Params: {
    "processId": 66823,
    "clientInfo": {
        "name": "Visual Studio Code",
        "version": "1.60.2"
    },
    "locale": "en-gb",
    "rootPath": "/Users/jclackett/Documents/Apps/Boilerplate/@boilerplate",
    "rootUri": "file:///Users/jclackett/Documents/Apps/Boilerplate/%40boilerplate",
    "capabilities": {
        "workspace": {
            "applyEdit": true,
            "workspaceEdit": {
                "documentChanges": true,
                "resourceOperations": [
                    "create",
                    "rename",
                    "delete"
                ],
                "failureHandling": "textOnlyTransactional",
                "normalizesLineEndings": true,
                "changeAnnotationSupport": {
                    "groupsOnLabel": true
                }
            },
            "didChangeConfiguration": {
                "dynamicRegistration": true
            },
            "didChangeWatchedFiles": {
                "dynamicRegistration": true
            },
            "symbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                },
                "tagSupport": {
                    "valueSet": [
                        1
                    ]
                }
            },
            "codeLens": {
                "refreshSupport": true
            },
            "executeCommand": {
                "dynamicRegistration": true
            },
            "configuration": true,
            "workspaceFolders": true,
            "semanticTokens": {
                "refreshSupport": true
            },
            "fileOperations": {
                "dynamicRegistration": true,
                "didCreate": true,
                "didRename": true,
                "didDelete": true,
                "willCreate": true,
                "willRename": true,
                "willDelete": true
            }
        },
        "textDocument": {
            "publishDiagnostics": {
                "relatedInformation": true,
                "versionSupport": false,
                "tagSupport": {
                    "valueSet": [
                        1,
                        2
                    ]
                },
                "codeDescriptionSupport": true,
                "dataSupport": true
            },
            "synchronization": {
                "dynamicRegistration": true,
                "willSave": true,
                "willSaveWaitUntil": true,
                "didSave": true
            },
            "completion": {
                "dynamicRegistration": true,
                "contextSupport": true,
                "completionItem": {
                    "snippetSupport": true,
                    "commitCharactersSupport": true,
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "deprecatedSupport": true,
                    "preselectSupport": true,
                    "tagSupport": {
                        "valueSet": [
                            1
                        ]
                    },
                    "insertReplaceSupport": true,
                    "resolveSupport": {
                        "properties": [
                            "documentation",
                            "detail",
                            "additionalTextEdits"
                        ]
                    },
                    "insertTextModeSupport": {
                        "valueSet": [
                            1,
                            2
                        ]
                    }
                },
                "completionItemKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25
                    ]
                }
            },
            "hover": {
                "dynamicRegistration": true,
                "contentFormat": [
                    "markdown",
                    "plaintext"
                ]
            },
            "signatureHelp": {
                "dynamicRegistration": true,
                "signatureInformation": {
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "parameterInformation": {
                        "labelOffsetSupport": true
                    },
                    "activeParameterSupport": true
                },
                "contextSupport": true
            },
            "definition": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "references": {
                "dynamicRegistration": true
            },
            "documentHighlight": {
                "dynamicRegistration": true
            },
            "documentSymbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                },
                "hierarchicalDocumentSymbolSupport": true,
                "tagSupport": {
                    "valueSet": [
                        1
                    ]
                },
                "labelSupport": true
            },
            "codeAction": {
                "dynamicRegistration": true,
                "isPreferredSupport": true,
                "disabledSupport": true,
                "dataSupport": true,
                "resolveSupport": {
                    "properties": [
                        "edit"
                    ]
                },
                "codeActionLiteralSupport": {
                    "codeActionKind": {
                        "valueSet": [
                            "",
                            "quickfix",
                            "refactor",
                            "refactor.extract",
                            "refactor.inline",
                            "refactor.rewrite",
                            "source",
                            "source.organizeImports"
                        ]
                    }
                },
                "honorsChangeAnnotations": false
            },
            "codeLens": {
                "dynamicRegistration": true
            },
            "formatting": {
                "dynamicRegistration": true
            },
            "rangeFormatting": {
                "dynamicRegistration": true
            },
            "onTypeFormatting": {
                "dynamicRegistration": true
            },
            "rename": {
                "dynamicRegistration": true,
                "prepareSupport": true,
                "prepareSupportDefaultBehavior": 1,
                "honorsChangeAnnotations": true
            },
            "documentLink": {
                "dynamicRegistration": true,
                "tooltipSupport": true
            },
            "typeDefinition": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "implementation": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "colorProvider": {
                "dynamicRegistration": true
            },
            "foldingRange": {
                "dynamicRegistration": true,
                "rangeLimit": 5000,
                "lineFoldingOnly": true
            },
            "declaration": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "selectionRange": {
                "dynamicRegistration": true
            },
            "callHierarchy": {
                "dynamicRegistration": true
            },
            "semanticTokens": {
                "dynamicRegistration": true,
                "tokenTypes": [
                    "namespace",
                    "type",
                    "class",
                    "enum",
                    "interface",
                    "struct",
                    "typeParameter",
                    "parameter",
                    "variable",
                    "property",
                    "enumMember",
                    "event",
                    "function",
                    "method",
                    "macro",
                    "keyword",
                    "modifier",
                    "comment",
                    "string",
                    "number",
                    "regexp",
                    "operator"
                ],
                "tokenModifiers": [
                    "declaration",
                    "definition",
                    "readonly",
                    "static",
                    "deprecated",
                    "abstract",
                    "async",
                    "modification",
                    "documentation",
                    "defaultLibrary"
                ],
                "formats": [
                    "relative"
                ],
                "requests": {
                    "range": true,
                    "full": {
                        "delta": true
                    }
                },
                "multilineTokenSupport": false,
                "overlappingTokenSupport": false
            },
            "linkedEditingRange": {
                "dynamicRegistration": true
            }
        },
        "window": {
            "showMessage": {
                "messageActionItem": {
                    "additionalPropertiesSupport": true
                }
            },
            "showDocument": {
                "support": true
            },
            "workDoneProgress": true
        },
        "general": {
            "regularExpressions": {
                "engine": "ECMAScript",
                "version": "ES2020"
            },
            "markdown": {
                "parser": "marked",
                "version": "1.1.0"
            }
        }
    },
    "trace": "verbose",
    "workspaceFolders": [
        {
            "uri": "file:///Users/jclackett/Documents/Apps/Boilerplate/%40boilerplate",
            "name": "@boilerplate"
        }
    ]
}

[Trace - 7:17:12 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Default version of Prisma binary 'prisma-fmt': c22652b7e418506fab23052d569b85d3aec4883f"
}

[Info  - 7:17:12 PM] Default version of Prisma binary 'prisma-fmt': c22652b7e418506fab23052d569b85d3aec4883f
[Trace - 7:17:12 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Extension name @prisma/language-server with version 3.1.103"
}

[Info  - 7:17:12 PM] Extension name @prisma/language-server with version 3.1.103
[Trace - 7:17:12 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Prisma Engines version: 3.1.0-24.c22652b7e418506fab23052d569b85d3aec4883f"
}

[Info  - 7:17:12 PM] Prisma Engines version: 3.1.0-24.c22652b7e418506fab23052d569b85d3aec4883f
[Trace - 7:17:12 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Prisma CLI version: 3.1.1"
}

[Info  - 7:17:12 PM] Prisma CLI version: 3.1.1
[Trace - 7:17:12 PM] Received response 'initialize - (0)' in 1171ms.
Result: {
    "capabilities": {
        "definitionProvider": true,
        "documentFormattingProvider": true,
        "completionProvider": {
            "resolveProvider": true,
            "triggerCharacters": [
                "@",
                "\"",
                "."
            ]
        },
        "hoverProvider": true,
        "renameProvider": true,
        "codeActionProvider": {
            "codeActionKinds": [
                "quickfix"
            ]
        },
        "textDocumentSync": 1
    }
}

[Trace - 7:17:12 PM] Sending notification 'initialized'.
Params: {}

[Trace - 7:17:12 PM] Sending notification 'textDocument/didOpen'.
Params: {
    "textDocument": {
        "uri": "file:///Users/jclackett/Documents/Apps/Boilerplate/%40boilerplate/packages/api/src/db/schema.prisma",
        "languageId": "prisma",
        "version": 1,
        "text": "generator client {\n  provider = \"prisma-client-js\"\n}\n\n// generator typegraphql {\n//   provider = \"typegraphql-prisma\"\n//   output   = \"../../../../node_modules/@generated\"\n// }\n\ndatasource db {\n  provider = \"postgresql\"\n  url      = env(\"DATABASE_URL\")\n}\n\nenum Role {\n  USER\n  ADMIN\n}\n\nmodel User {\n  id        String   @id @default(dbgenerated(\"gen_random_uuid()\")) @db.Uuid\n  email     String   @unique\n  password  String\n  firstName String?\n  lastName  String?\n  avatar    String?\n  role      Role     @default(USER)\n  bio       String?\n  createdAt DateTime @default(now()) @db.Timestamptz(6)\n  updatedAt DateTime @default(now()) @updatedAt @db.Timestamptz(6)\n}\n"
    }
}

[Trace - 7:17:12 PM] Received request 'client/registerCapability - (0)'.
Params: {
    "registrations": [
        {
            "id": "ca8c61fb-277d-4ee2-a42c-162360f6da17",
            "method": "workspace/didChangeConfiguration",
            "registerOptions": {}
        }
    ]
}

[Trace - 7:17:12 PM] Sending response 'client/registerCapability - (0)'. Processing request took 0ms
No result returned.

[Trace - 7:17:12 PM] Sending request 'textDocument/codeAction - (1)'.
Params: {
    "textDocument": {
        "uri": "file:///Users/jclackett/Documents/Apps/Boilerplate/%40boilerplate/packages/api/src/db/schema.prisma"
    },
    "range": {
        "start": {
            "line": 10,
            "character": 25
        },
        "end": {
            "line": 10,
            "character": 25
        }
    },
    "context": {
        "diagnostics": []
    }
}

[Trace - 7:17:12 PM] Received request 'workspace/configuration - (1)'.
Params: {
    "items": [
        {
            "scopeUri": "file:///Users/jclackett/Documents/Apps/Boilerplate/%40boilerplate/packages/api/src/db/schema.prisma",
            "section": "prisma"
        }
    ]
}

[Trace - 7:17:12 PM] Sending response 'workspace/configuration - (1)'. Processing request took 0ms
Result: [
    {
        "prismaFmtBinPath": "",
        "trace": {
            "server": "verbose"
        }
    }
]

[Trace - 7:17:12 PM] Received response 'textDocument/codeAction - (1)' in 9ms.
Result: []

[Trace - 7:17:12 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Local prisma-fmt path: /Users/jclackett/.vscode/extensions/prisma.prisma-3.0.3/node_modules/@prisma/language-server/dist/src/prisma-fmt/prisma-fmt.c22652b7e418506fab23052d569b85d3aec4883f"
}

[Info  - 7:17:12 PM] Local prisma-fmt path: /Users/jclackett/.vscode/extensions/prisma.prisma-3.0.3/node_modules/@prisma/language-server/dist/src/prisma-fmt/prisma-fmt.c22652b7e418506fab23052d569b85d3aec4883f
[Error - 7:17:12 PM] Connection to server got closed. Server will not be restarted.
JClackett commented 3 years ago

Restarting laptop + reinstalling the extension + making sure the vscode settings are correct seemed to fix it!

  "[prisma]": {
    "editor.defaultFormatter": "Prisma.prisma"
  },
janpio commented 3 years ago

Good you could fix it, frustrating that we do not understand what was causing it.