Coder Social home page Coder Social logo

litee-calltree.nvim's Introduction

██╗     ██╗████████╗███████╗███████╗   ███╗   ██╗██╗   ██╗██╗███╗   ███╗
██║     ██║╚══██╔══╝██╔════╝██╔════╝   ████╗  ██║██║   ██║██║████╗ ████║ Lightweight
██║     ██║   ██║   █████╗  █████╗     ██╔██╗ ██║██║   ██║██║██╔████╔██║ Integrated
██║     ██║   ██║   ██╔══╝  ██╔══╝     ██║╚██╗██║╚██╗ ██╔╝██║██║╚██╔╝██║ Text
███████╗██║   ██║   ███████╗███████╗██╗██║ ╚████║ ╚████╔╝ ██║██║ ╚═╝ ██║ Editing
╚══════╝╚═╝   ╚═╝   ╚══════╝╚══════╝╚═╝╚═╝  ╚═══╝  ╚═══╝  ╚═╝╚═╝     ╚═╝ Environment
====================================================================================

litee screenshot

litee-calltree

litee-calltree utilizes the litee.nvim library to implement a tool analogous to VSCode's "Call Hierarchy" tool.

This tool exposes an explorable tree of incoming or outgoing calls for a given symbol.

Unlike other Neovim plugins, the tree can be expanded and collapsed to discover "callers-of-callers" and "callees-of-callees" until you hit a leaf.

Like all litee.nvim backed plugins the UI will work with other litee.nvim plugins, keeping its appropriate place in a collapsible panel.

Usage

Get it

Plug:

 Plug 'ldelossa/litee.nvim'
 Plug 'ldelossa/litee-calltree.nvim'

Set it

Call the setup function from anywhere you configure your plugins from.

Configuration dictionary is explained in ./doc/litee-calltree.txt (:h litee-calltree-config)

-- configure the litee.nvim library 
require('litee.lib').setup({})
-- configure litee-calltree.nvim
require('litee.calltree').setup({})

Use it

First ensure you also have the litee.nvim (https://github.com/ldelossa/litee.nvim) library installed.

litee-calltree.nvim hooks directly into the LSP infrastructure by hijacking the necessary handlers like so:

vim.lsp.handlers['callHierarchy/incomingCalls'] = vim.lsp.with(
            require('litee.lsp.handlers').ch_lsp_handler("from"), {}
)
vim.lsp.handlers['callHierarchy/outgoingCalls'] = vim.lsp.with(
            require('litee.lsp.handlers').ch_lsp_handler("to"), {}
)

This occurs when require('litee.calltree').setup() is called.

Once require('litee.calltree').setup() is ran, the normal "vim.lsp.buf.incoming_calls" and "vim.lsp.buf.outgoing_calls" functions will open the Calltree UI, respectively.

By default the Calltree will open in a PopOut Panel, however this default is controlled by the "on_open" configuration flag and can be changed to open in a side panel instead. (see h: litee-calltree-config).

Once the Calltree is open checkout (h: litee-calltree-commands) to see all the available actions you can take on a Calltree.

Check out the help file for full details.

litee-calltree.nvim's People

Contributors

ldelossa avatar rhcher avatar

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.