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

LSP not working for newly created files #7

Open
walcht opened this issue Jan 28, 2024 · 3 comments
Open

LSP not working for newly created files #7

walcht opened this issue Jan 28, 2024 · 3 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@walcht
Copy link
Owner

walcht commented Jan 28, 2024

LSP does not properly work for newly added files.
Potential fix in this issue discussion:
OmniSharp/omnisharp-roslyn#2250

@walcht walcht self-assigned this Jan 28, 2024
@walcht walcht added bug Something isn't working enhancement New feature or request labels Jan 28, 2024
@walcht
Copy link
Owner Author

walcht commented Jan 28, 2024

Newly created C# files have to be added to the Assembly-CSharp.csproj file. This is done automatically by Unity if a supported external editor is chosen. This issue can be solved through the other major issue: #8

For the moment this will be closed.

@walcht walcht closed this as completed Jan 28, 2024
@walcht walcht reopened this Jan 28, 2024
@reaz1995
Copy link

reaz1995 commented Feb 11, 2025

You can hook in to one of unity package to auto regenerate .csproj files each compilation, like i did in this repo: https://github.com/reaz1995/UnityNvimSupport.
If you want lsp support for newly created files just add <Compile Include="Assets\**\*.cs" /> line to Assembly-CSharp.csproj. (it can be done auto to check and include this line in Assembly-CSharp.csproj).
Also you dont need more .csproj than Assembly-CSharp.csproj and Assembly-CSharp-Editor.csproj those have links to .dlls and resolve lsp autocmp, bloating main project with all sub projects will slow your lsp by alot. If you dont get autocmp it means your paths in .csproj wasn't resolved correctly so you it mean you probably run nvim in wsl on Windows which require path translation in .csproj.

@walcht
Copy link
Owner Author

walcht commented Feb 12, 2025

@reaz1995 Thanks for the information. I already knew that this current approach is a complete messed up and I am currently working on something similar to this https://github.com/Unity-Technologies/com.unity.ide.vscode (for NeoVim of course). A deal breaker for me is attaching Neovim debugging to Unity (similar to the way VSCode - VS does it) - so that's what I am currently focusing on.

I will do a major cleanup for this project this + next week and get back to addressing this issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants