Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error or Empty LSP Response on hover. #632

Closed
RussBaz opened this issue Oct 26, 2023 · 2 comments
Closed

Error or Empty LSP Response on hover. #632

RussBaz opened this issue Oct 26, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@RussBaz
Copy link

RussBaz commented Oct 26, 2023

Describe the bug
I recently started getting empty or error responses when I hover or do other thing with my code. But not with every function or variable. Just most.

Here is what I get when I hover over a variable declaration:

let protected: <<error type>>

But I am having no issues when opening the same project from Xcode.

Please advise on how to properly debug this issue.

To Reproduce
I am struggling to reproduce with other projects, as it works fine when I create a new empty project.

Expected behavior
Type information correctly displayed.

Environment

  • OS: [e.g. Ubuntu 20.04]: MacOS 14.0 (Original issue was found in an Intel mac. Since then I tested it on M1 mac with 14.1 and got the same issue)
  • Swift version (output of swift --version)
swift-driver version: 1.87.1 Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
Target: x86_64-apple-macosx14.0
  • Visual Studio Code version: 1.83.1
  • vscode-swift version: v1.7.0

Additional context
Here is the Swift Forums thread where I originally reported the issue, with extra details such as a detailed log trace: https://forums.swift.org/t/vs-code-extension-is-failing-how-to-debug-a-cause/68059/

@RussBaz RussBaz added the bug Something isn't working label Oct 26, 2023
@adam-fowler
Copy link
Member

Ah I hadn't noticed you added this to the vscode-swift extension repo. It should really go in the apple/sourcekit-lsp repo as it is an issue with the lsp server.

@RussBaz
Copy link
Author

RussBaz commented Nov 2, 2023

As it turns out, running swift package reset, and then resolving and building again solved the issue. Therefore, I can no longer replicate the issue. I will be closing it now.

I suspect this issue might have been caused by leftovers of previous incremental builds due to me upgrading not long ago from 5.8 to 5.9. Further details can be found in the previously attached forum thread.

@RussBaz RussBaz closed this as completed Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants