microsoft / microsoft/multilspy

Unable to make GoLang work

Open
#104 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
610
Forks
111
PR merge metrics
No merged PRs in 30d

Description

Am I missing something?
I installed gopls but when I run it I still see the issue.

(.venv) $ go install golang.org/x/tools/gopls@latest

(.venv) $ python -i
Python 3.11.9 (v3.11.9:de54cf5be3, Apr  2 2024, 07:12:50) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from multilspy import SyncLanguageServer
>>> from multilspy.multilspy_config import MultilspyConfig
>>> from multilspy.multilspy_logger import MultilspyLogger
>>> config = MultilspyConfig.from_dict({"code_language": "go"})
>>> logger = MultilspyLogger()
>>> lsp = SyncLanguageServer.create(config, logger, "aws-todo-list-app")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".venv/lib/python3.11/site-packages/multilspy/language_server.py", line 713, in create
    return SyncLanguageServer(LanguageServer.create(config, logger, repository_root_path), timeout=timeout)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.11/site-packages/multilspy/language_server.py", line 112, in create
    return Gopls(config, logger, repository_root_path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.11/site-packages/multilspy/language_servers/gopls/gopls.py", line 72, in __init__
    self.setup_runtime_dependency()
  File ".venv/lib/python3.11/site-packages/multilspy/language_servers/gopls/gopls.py", line 66, in setup_runtime_dependency
    raise RuntimeError(error_msg)
RuntimeError: Missing required dependencies:
- gopls: Please install from https://pkg.go.dev/golang.org/x/tools/gopls#section-readme

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the example with Python 3.11 and the shown gopls installation command. Trace multilspy/language_server.py into multilspy/language_servers/gopls/gopls.py, focusing on setup_runtime_dependency and how the executable is discovered. Done means the Go language server can be created without the reported missing-dependency error, or the failure has a clear diagnosis.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, python
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.