Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-24452

Invalid workspaceFolders breaks gopls

    XMLWordPrintable

Details

    • 2ca4010f2dd5e18aa2a68cbf5d56b9eea8458420 (qt-creator/qt-creator/4.13)

    Description

      Hi, Qt Creator doesn't work with the Go language server (gopls), started in per-project mode. gopls dies with the following message and a stacktrace:

      panic: only file URIs are supported, got "" from "/home/user/foo"

      Just looking at the debugging output, two things appear to be off:

      {{{{"workSpaceFolders":[

      {"name":"haven","uri":"/home/user/foo"}

      ]}}}}

      First, "workSpaceFolders" should probably be "workspaceFolders", see https://microsoft.github.io/language-server-protocol/specification.html although it doesn't seem to be the cause of this failure.

      Second, the URI is not a URI and should be prefixed by file://, giving:

      {{{{"workspaceFolders":[

      {"name":"haven","uri":"file:///home/user/foo"}

      ]}}}}

      The latter should be an easy and straight-forward fix. Thanks.

      Note that there are more problems with gopls, this is just the first one I bothered to investigate.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            davschul David Schulz
            iptriz iptriz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes