Giter Club home page Giter Club logo

Comments (13)

ray-x avatar ray-x commented on May 18, 2024 1

Just pulled the latest version. I can confirm the issue had been solved. Happy to close it.
Thanks for the fix!

from aerial.nvim.

stevearc avatar stevearc commented on May 18, 2024

You don't! In the updated Setup section of the README it calls out that you only need to configure one of the sources. If you don't want to use LSP, you don't have to call on_attach anywhere and the treesitter backend will automatically pick up the slack. Let me know if it doesn't work as expected.

Thanks for lsp_signature, btw! I use it all the time 🙂

from aerial.nvim.

ray-x avatar ray-x commented on May 18, 2024

I am happy you like lsp_signature :)

Maybe, you do not need to hook into on_attach to support LSP. You could fire a vim.lsp.buf_request() and hook your node data handler in the request and refresh the tree in your handler.

If you really need to attach to each client, you can use vim.lsp.start_client You provide a star_client function that wrap the neovim default start_client and aerial on_attach together.

Regarding treesitter setup. I still got no luck. I am lazy loading your plugin with

:lua require'packer'.loader('aerial.nvim')
:AerialToggle

Error:

E5108: Error executing lua ...m/site/pack/packer/opt/aerial.nvim/lua/aerial/render.lua:67: Column value outside range                                                                                                                                           
stack traceback:                                                                                                                                                                                                                                                
        [C]: in function 'nvim_buf_add_highlight'                                                                                                                                                                                                               
        ...m/site/pack/packer/opt/aerial.nvim/lua/aerial/render.lua:67: in function 'update_aerial_buffer'                                                                                                                                                      
        ...pack/packer/opt/aerial.nvim/lua/aerial/backends/init.lua:40: in function 'set_symbols'                                                                                                                                                               
        .../packer/opt/aerial.nvim/lua/aerial/backends/markdown.lua:46: in function 'fetch_symbols'                                                                                                                                                             
        ...m/site/pack/packer/opt/aerial.nvim/lua/aerial/window.lua:174: in function 'open'                                                                                                                                                                     
        ...m/site/pack/packer/opt/aerial.nvim/lua/aerial/window.lua:204: in function 'toggle'                                                                                                                                                                   
        [string "luaeval()"]:1: in main chunk                         

Maybe the bufdata.positions is empty?

from aerial.nvim.

stevearc avatar stevearc commented on May 18, 2024

You're right, I should be able to make the LSP backend work without calling on_attach. It'll break some backwards compatibility, but mostly with rarely-used or undocumented features and would definitely be worth it from a new user standpoint. I'll take a stab at it soon, but I'm more concerned about the crash you encountered.

It looks like some issues with bad string width calculations getting passed to the highlighter. I've attempted a blind fix, without having a repro. If it doesn't work, could you let me know what font you're using and your icon config, if any? If you're not passing anything in vim.g.aerial directly, we look for your lspkind-nvim config, if you're using that plugin.

from aerial.nvim.

ray-x avatar ray-x commented on May 18, 2024

Unfortunately, the latest version still has the same issue.
I did not setup vim.g.aerial. neither do I use lspkind-nvim plugin.
In fact, if I ignore the error messages and run AerialToggle again, it works fine.
Also I dumped items in fetch_symbols_sync in treesitter/init.lua. Seems the nodes list are all good.

from aerial.nvim.

ray-x avatar ray-x commented on May 18, 2024

One thing I noticed is win_findbuf(bufnr) this will return an empty list instead of nil/0 if bufnr is 0.

from aerial.nvim.

stevearc avatar stevearc commented on May 18, 2024

You're mentioning win_findbuf and earlier you mentioned bufdata.positions, which makes me think that your error is coming from somewhere in the render.lua update_highlights method. But the stack trace you pasted in had a crash in update_aerial_buffer. Are you getting multiple different errors?

from aerial.nvim.

stevearc avatar stevearc commented on May 18, 2024

I did some refactoring to remove the calls to win_findbuf(). If the error was surrounding that it should hopefully be easier to track down since there won't be the weirdness of the vimscript logic to deal with. I don't see how this could affect the error in your trace, but maybe this will help with the other issue?

from aerial.nvim.

ray-x avatar ray-x commented on May 18, 2024

Good news is error is gone now.
Bad news is most of the time when I run AerialToggle for the first time, I got . Loading message instead of the outline. If I run it 2nd time, outline shows up.
I check #4 but does not help much.

from aerial.nvim.

stevearc avatar stevearc commented on May 18, 2024

Wow, sorry you've been running into so many issues! Hopefully it's something unique in your setup; I'd hate to think that people have been quietly dealing with these.

For this latest problem, I suspect it may have something to do with the lazy loading. I have pushed up some more changes that will maybe resolve it, but again hard to say without having a repro. If it persists can you let me know how you're doing the lazy loading and what the config for it is?

from aerial.nvim.

JoseConseco avatar JoseConseco commented on May 18, 2024

I have no problems with aerial and TSitter, so yep I would guess the problems that ray-x is facing are due his nvim setup.

from aerial.nvim.

fgheng avatar fgheng commented on May 18, 2024

Hello, does aerial support lsp without using on_attach

from aerial.nvim.

stevearc avatar stevearc commented on May 18, 2024

Yes, you still have to call on_attach for aerial to work properly with LSP symbols. I did some deeper investigation into alternatives, but they didn't pan out.

from aerial.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.