craftzdog / dotfiles-public

My personal dotfiles
6.32k stars 1.16k forks source link

react autocomplate doesn't work #169

Open zhoommer opened 5 months ago

zhoommer commented 5 months ago

Auto-suggest no longer works when writing a React project. When I first started using it using these settings, it worked normally, but it doesn't work anymore. For example, when I type useState, it does not import automatically.

PowerzinBR commented 5 months ago

Try installing a LSP server for your code language (js, html, css), maybe that helps

tony-sn commented 3 months ago

@zhoommer can you try to see whether your repo has .git folder? because this LSP settings will look for .git folder, if you don't have git init, LSP suggestions will not work.

root_dir = function(...) return require("lspconfig.util").root_pattern(".git")(...) end,

harshv5094 commented 3 months ago

Just remove the root_dir line and lsp server will use the default setting