Coder Social home page Coder Social logo

Comments (3)

mrbjarksen avatar mrbjarksen commented on June 11, 2024 1

I've created a wiki page for this. This has given me a few ideas for new component options though, so I might revisit it later.

from neo-tree-diagnostics.nvim.

cseickel avatar cseickel commented on June 11, 2024

I have a second variation, this one also changes the file node style. I think these changes make the information easier to parse:

image

  require("neo-tree").setup({
    sources = {
      "filesystem",
      "buffers",
      "git_status",
      "diagnostics",
    },
    diagnostics = {
      components = {
        linenr = function(config, node)
          local lnum = tostring(node.extra.diag_struct.lnum + 1)
          local pad = string.rep(" ", 4 - #lnum)
          return {
            {
              text = pad .. lnum,
              highlight = "LineNr",
            },
            {
              text = "",
              highlight = "NeoTreeDimText",
            }
          }
        end
      },
      renderers = {
        file = {
          { "indent" },
          { "icon" },
          { "grouped_path" },
          { "name", highlight = "NeoTreeFileNameOpened" },
          --{ "diagnostic_count", show_when_none = true },
          { "diagnostic_count", highlight = "NeoTreeDimText", severity = "Error", right_padding = 0 },
          { "diagnostic_count", highlight = "NeoTreeDimText", severity = "Warn", right_padding = 0 },
          { "diagnostic_count", highlight = "NeoTreeDimText", severity = "Info", right_padding = 0 },
          { "diagnostic_count", highlight = "NeoTreeDimText", severity = "Hint", right_padding = 0 },
          { "clipboard" },
        },
        diagnostic = {
          { "indent" },
          { "icon" },
          { "linenr" },
          { "name" },
          --{ "source" },
          --{ "code" },
        },
      },
    },
  })

from neo-tree-diagnostics.nvim.

mrbjarksen avatar mrbjarksen commented on June 11, 2024

Looks great, I might use this myself! A wiki page sounds good. I'll set one up for documenting the default components and to showcase custom renderers.

from neo-tree-diagnostics.nvim.

Related Issues (13)

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.