simrat39 / symbols-outline.nvim

A tree like view for symbols in Neovim using the Language Server Protocol. Supports all your favourite languages.
MIT License
1.85k stars 100 forks source link

feat: Merge jsx symbols into lsp tree #169

Closed mxsdev closed 1 year ago

mxsdev commented 2 years ago

Addresses #153.

The idea is to first deeply sort the jsx and lsp trees, then merge the two by iterating through the symbols in order of symbol start position, deeply reconstructing the tree as we iterate.

CallumHoward commented 2 years ago

=== RESOLVED ===

I tried out your fork (and confirmed packer has the correct commit at ddc379b) but I can't seem to get it working in JSX or TSX, it still just shows the symbols for the JSX markup and not local variables defined before the function component return.

Not sure what debug output you might need, but let me know and I can comment it here. I'm on nvim nightly.

mxsdev commented 2 years ago

Not sure what debug output you might need

Can you send an example jsx file where this happens?

CallumHoward commented 2 years ago

https://gist.github.com/CallumHoward/07fc4604443363d6e917d0b324998b97

Screen Shot 2022-09-23 at 4 55 11 pm

I've got nvim-navic going in the WinBar too, so the LSP server is returning symbols

mxsdev commented 2 years ago

@CallumHoward

Screen Shot 2022-09-23 at 10 31 47 AM

I am not able to reproduce. Are you absolutely sure you have the PR loaded? You can check by adding a print statement somewhere like in this function.

CallumHoward commented 2 years ago

Ah yes, it's my mistake, I was on master, not on merge-jsx-tree. Sorry for the trouble, it works great!

ericzwong commented 1 year ago

it works for me, thanks for your contribution. well done

TheodorRene commented 1 year ago

Anything missing to get this merged? A very needed feature.

mxsdev commented 1 year ago

@TheodorRene

It looks like @simrat39 is not be actively maintaining this project anymore (which is understandable - they are a student!) Not sure what that means for the future of this project though :(

geralfonso commented 1 year ago

I'm having the same issue.

TheodorRene commented 1 year ago

@TheodorRene

It looks like @simrat39 is not be actively maintaining this project anymore (which is understandable - they are a student!) Not sure what that means for the future of this project though :(

Very understandable. Anyone know a good alternative, or maintained fork?

simrat39 commented 1 year ago

I'm sorry, I was super busy with stuff, but I should be back now, so I'll look into it