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

Q: How to speed up start? #2640

Open
loeffel-io opened this issue Sep 21, 2024 · 2 comments
Open

Q: How to speed up start? #2640

loeffel-io opened this issue Sep 21, 2024 · 2 comments

Comments

@loeffel-io
Copy link

loeffel-io commented Sep 21, 2024

This is my neovim setup for my unity project:

            ["omnisharp"] = function()
                lspconfig["omnisharp"].setup({
                    on_attach = on_attach,
                    capabilities = capabilities,
                    cmd = { "omnisharp", "--languageserver", "--hostPID", tostring(pid) },
                    root_dir = lspconfig.util.root_pattern("*.csproj", "*.sln"),
                    handlers = {
                        ["textDocument/definition"] = omnisharp_extended.handler,
                        ["textDocument/references"] = omnisharp_extended.handler,
                        ["textDocument/implementation"] = omnisharp_extended.handler,
                        ["textDocument/typeDefinition"] = omnisharp_extended.handler,
                    },
                    settings = {
                        FormattingOptions = {
                            EnableEditorConfigSupport = true,
                        },
                        RoslynExtensionsOptions = {
                            EnableAnalyzersSupport = false,    -- Disable analyzers for better performance
                            EnableImportCompletion = false,    -- Disable import completion to improve completion time
                            EnableDecompilationSupport = true, -- Enable decompilation support (optional)
                        },
                    },
                })
            end,

it takes around 5 minutes until everything is loaded - this is unacceptable - gopls loads my insane big project instantly.

do i need to exclude some directories or something or is this startup speed normal? If yes, how?

file tree depth 1

├── Assets
├── Library
├── LocalPackages
├── Logs
├── Packages
├── ProjectSettings
├── Temp
├── UserSettings
└── obj
@JoeRobich
Copy link
Member

Hi @loeffel-io, Loading projects requires performing design-time builds of all the projects in order to determine necessary references. I would expect this to take around the same time as performing a cold build. OmniSharp does have a LoadProjectsOnDemand option which might improve your scenario by only loading projects that have open files. You can see the list of configuration options at https://github.com/OmniSharp/omnisharp-roslyn/wiki/Configuration-Options#msbuild

@loeffel-io
Copy link
Author

Hey @JoeRobich, thank you for your reply.

Does this make sense for a unity project?

Setting MsBuild -> LoadProjectsOnDemand stops the Lsp from starting on my side

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

No branches or pull requests

2 participants