# lsp: Fix wrong WorkspaceFolder when opening only file \(\#12129\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/aa539fc347b746d4d8c365b0b27c97fddf638ecf)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: aa539fc347b746d4d8c365b0b27c97fddf638ecf

Requested commit: aa539fc347b746d4d8c365b0b27c97fddf638ecf

Commit: aa539fc347b746d4d8c365b0b27c97fddf638ecf

Tree: bed0ab4d7b49283883f69bb6a3e6f40000b1c9bc

Author: Thorsten Ball

Committer: GitHub

## Message

```
lsp: Fix wrong WorkspaceFolder when opening only file (#12129)

This fixes #11361 and #8764 by making sure we pass a directory as
`WorkspaceFolder` to the language server.

We already compute the `working_dir` correctly when
`self.root_path.is_file()`, but we didn't use it.

Release Notes:

- Fixed language servers (such as `gopls`) not starting up correctly
when opening a single file in Zed.
([#11361](https://github.com/zed-industries/zed/issues/11361) and
[#8764](https://github.com/zed-industries/zed/issues/8764)).
```

## Parents

- [49dffabab9a71a2faf439fd3aa59e0eda6079c76](https://git.cafe/gitcafe/zed/commit/49dffabab9a71a2faf439fd3aa59e0eda6079c76?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/aa539fc347b746d4d8c365b0b27c97fddf638ecf?format=markdown)
