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

C# codelens not showing #4627

Closed
centuryhopper opened this issue Jun 24, 2021 · 5 comments
Closed

C# codelens not showing #4627

centuryhopper opened this issue Jun 24, 2021 · 5 comments

Comments

@centuryhopper
Copy link

Hello there!

Usually I would see the word "references" above my class member variables, functions, etc, but I can't see them. How do I make them appear? Please let me know what you need from me to help (i.e. screenshots and/or steps to reproduce)

Thank you.

@JoeRobich
Copy link
Member

Hi, Can you reopen the folder where you are not seeing the reference codelens and please share the OmniSharp log from the Output pane?

@centuryhopper
Copy link
Author

centuryhopper commented Jun 25, 2021

Hello @JoeRobich,
[dbug]: OmniSharp.Stdio.Host
************ Response (0.1355ms) ************
{
"Request_seq": 69,
"Command": "/v2/codestructure",
"Running": true,
"Success": true,
"Message": null,
"Body": {
"Elements": []
},
"Seq": 64,
"Type": "response"
}

Here's a screenshot of some of my variables. Actually there are two problems. One being that the word "references" should be showing but isn't. Two being that there are no annotations for unity library functions and classes (e.g. when you hover over, lets say, monobehaviour, it should tell you something, and if you hold down "command" key and click on it, it should take you to the metadata file, but none of these are happening
https://imgur.com/a/qIFrGgi

@JoeRobich
Copy link
Member

@leozhang1 Sorry, could you please provide the complete log? Need to see if there were any issues during project loading.

@centuryhopper
Copy link
Author

centuryhopper commented Jun 25, 2021

@leozhang1 Sorry, could you please provide the complete log? Need to see if there were any issues during project loading.

My bad. Here it is. https://easyupload.io/kiyl75 Please let me know what else you need. @JoeRobich

@centuryhopper
Copy link
Author

Update:
I just fixed it. I had to set VS code as my external script editor for unity by going to Unity clicked on Edit -> Preferences -> External Tool. Now theres a checkbox for "Embedded packages", I ticked it -> clicked on "regenerate project files", then unticked it again and again clicked on "regenerate project files". https://imgur.com/a/qpHwETw
Then I made sure that "omnisharp.useGlobalMono": "always" is in my settings.json and it worked! Having that in my settings.json didn't always work for me in the past though. I don't why but if you or someone else knows, please do share with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants