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

Invalid workspaceFolders breaks gopls

    XMLWordPrintable

    Details

      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

            Assignee:
            davschul David Schulz
            Reporter:
            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