GithubHelp home page GithubHelp logo

Comments (4)

mfussenegger avatar mfussenegger commented on May 19, 2024 1

Would you be open to having the user be able to pass in win options to change the blend or to add a border or something?

Short answer is yes.

The longer answer is that I would like to have a pluggable widget system where users can combine windows, buffers and contents as they please.

There's an early prototype up at #165 but I'm still refining the API, filling up some gaps and iron out some bugs.

But the main idea should already be visible. There are going to be a couple of primitives and users can combine them together.

Some examples:

local widgets = require('dap.ui.widgets')

widgets.hover(widgets.scopes) -- opens scopes in a floating window
widgets.hover(widgets.frames) -- opens stack frames in a floating window

widgets.sidebar(widgets.scopes) -- opens scopes in a sidebar

This would be the high-level entry points.
There will be a different filetype per scope so that users can use ftplugin, but you can also use a lower level API to customize the window creation.

local widgets = require('dap.ui.widgets')

widgets.builder(widgets.scopes)
  .new_win(your_function_that_creates_a_window)
  .build()
  .open()

There might be some default new_win / new_buf functions and maybe even some combinators that could be re-usable. Not sure yet how far that will go.

Part of the credit goes to @rcarriga, the element system in nvim-dap-ui inspired some parts of the widget design.

Would be cool if some of the building blocks could even be re-used in nvim-dap-ui. (E.g the lower level layer that can be used to render lua objects to a buffer and have extmarks places that allows to access the lua object later on per line)

from nvim-dap.

theHamsta avatar theHamsta commented on May 19, 2024

The file type to customize the highlight is dap-variables but the background should be the standard float background.

An option to choose the function that creates the window could be a solution just as for #161

make_floating_popup_options has a border option

from nvim-dap.

mfussenegger avatar mfussenegger commented on May 19, 2024

Made another iteration on the widget api stuff. #171 should now be ready for some testing and I'd appreciate some feedback on the API and customization options.

If you've use-cases that aren't covered yet, please let me know.

from nvim-dap.

mfussenegger avatar mfussenegger commented on May 19, 2024

Merged #171 and also added #172

from nvim-dap.

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.