Jezda1337 / nvim-html-css

CSS Intellisense for HTML
115 stars 13 forks source link

It may parse some directories end up with ".html" as files #5

Closed dddddjent closed 9 months ago

dddddjent commented 10 months ago

When I try to open my nvim at ~/Documents, it parses every files (or may be even directories?) end up with .html So it generates this error: image I add a print() in hrefs.lua, and it prints the file name for me. Here's the result before the error: image However, this doesn't happen when I get into the directory above or inside. I don't know why it only happens at that specific dir.

Jezda1337 commented 10 months ago

Does your Documents dir contain .git folder or package.json file? and do you run nvim . inside Documents or you run in elsewhere and navigate to Documents dir?

dddddjent commented 9 months ago

I think there are no .git folder and package.json file. And I run nvim in Documents directly.

Jezda1337 commented 9 months ago

Plugin only works in dirs where .git/ or package.json file exist, can you share more details, whats is in your Documents folder, do you have nested projects maybe, or in ~/ home folder you have some projects that contains this files and folders that I mention above. Does nested folder rn folder from ~/ have .git or package.json file? I need these details so I can try to reproduce same problem.

dddddjent commented 9 months ago

My Documents folder is the /home/ljl(my user name)/Documents. It contains a lot of projects and files, and many of them contain .git folder. I created a ThirdParty folder under Documents, and put a gcc-linaro compiler (which can be seen in the screenshot above) inside. When the function comes to the directories end with .html/, it generates the error. And there's no .git/ or package.json in that compiler's folder

dddddjent commented 9 months ago

Error detected while processing /home/ljl/.config/nvim/init.lua: E5113: Error while calling lua chunk: ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:404: Failed to spawn process: { _additional_on_exit_callbacks = {}, _shutdown_check = <userdata 1>, _stderr_results = {}, _stdout_results = {}, _user_on_exit = <function 1>, args = { "-sSL", "-D", "/run/user/1000/plenary_curl_fc354d0c.headers", "--compressed", "-X", "GET", "http://www.doxygen.org/index.html" }, command = "curl", enable_handlers = true, enable_recording = true, interactive = true, pid = "EMFILE: too many open files", stderr = <userdata 2>, stdin = <userdata 3>, stdout = <userdata 4>, user_data = {},

= <1>{ __index = , _create_uv_options = , _execute = , _pipes_are_closed = , _prepare_pipes = , _reset = , _shutdown = , _stop = , add_on_exit_callback = , after = , after_failure = , after_success = , and_then = , and_then_on_failure = , and_then_on_failure_wrap = , and_then_on_success = , and_then_on_success_wrap = , and_then_wrap = , chain = , chain_status = , co_wait = , is_job = , join = , new = , pid = , result = , send = , shutdown = , start = , stderr_result = , sync = , wait = } } stack traceback: .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:404: in function '_execute' .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:447: in function 'start' ....local/share/nvim/lazy/plenary.nvim/lua/plenary/curl.lua:288: in function 'get' ...al/share/nvim/lazy/nvim-html-css/lua/html-css/remote.lua:24: in function 'get_remote_styles' ...al/share/nvim/lazy/nvim-html-css/lua/html-css/remote.lua:41: in function 'init' ...ocal/share/nvim/lazy/nvim-html-css/lua/html-css/init.lua:64: in function <...ocal/share/nvim/lazy/nvim-html-css/lua/html-css/init.lua:63> stack traceback: [C]: in function 'error' ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next' ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'step' ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:48: in function 'execute' ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:108: in function 'run' ...ocal/share/nvim/lazy/nvim-html-css/lua/html-css/init.lua:63: in function <...ocal/share/nvim/lazy/nvim-html-css/lua/html-css/init.lua:34> [C]: in function 'require' /home/ljl/.config/nvim/lua/user/cmp.lua:171: in main chunk [C]: in function 'require' /home/ljl/.config/nvim/init.lua:5: in main chunk [html-css] Unable to connect to the URL: http://mxr.mozilla.org/comm-central/source/mozilla/netwerk/base/src/nsURLParsers.cpp [html-css] Unable to connect to the URL: https://pagure.io/lohit, http://www.nongnu.org/freebangfont/downloads.html#mukti, https://dejavu-fonts.github.io/Download.html [html-css] Unable to connect to the URL: http://www.suitable.com/tools/smslib.html [html-css] Unable to connect to the URL: http://lxr.mozilla.org/mozilla/source/toolkit/mozapps/update/src/updater/ Now I removed the folders with .html at the back, and then it gave me a new error. It seems like it's because I was not able to connect to some of the URLs. But I don't have any .git or package.json here, should this plugin still run?
Jezda1337 commented 9 months ago

No, if the root folder doesn't contain .git folder or package.json the plugin should not start. Can you try this in your config?

{ "Jezda1337/nvim-html-css",
        dependencies = {
            "nvim-treesitter/nvim-treesitter",
            "nvim-lua/plenary.nvim"
        },
        config = function()
            require("html-css"):setup()
        end,
        event = 'VeryLazy'
    },
dddddjent commented 9 months ago

It generated the same kind of error. image I think it was lazy loaded.

Jezda1337 commented 9 months ago

Strange, I will try to reproduce the error.

Jezda1337 commented 9 months ago

I only reproduce the error by adding .git folder or package.json file inside my folder who contain nested projects. I believe you have .git/ folder inside your Documents, did you try ls -a to see hidden directories? By adding .git/ or package.json file to root folder who contains a lot of projects make this error for me. My folder structure is this: workspaces/ -- Project-1 -- Projcet-2 -- Project 3 -- package.json -- .git/ etc..

adding .git/ folder or package.json in workspaces directorium makes that error. can you pls do ls -a and share screenshoot with me

dddddjent commented 9 months ago

image

Jezda1337 commented 9 months ago

Thanks for sharing image, git_proxy_set is the problem, somehow picking "git" and trigger the plugin. Basically, whenever you run neovim and in that root folder is something start with name "git" its gonna trigger the plugin. I will look at this later today.