Code Monkey home page Code Monkey logo

diagflow.nvim's Introduction

Ovior

diagflow.nvim's People

Contributors

abulwafa avatar chrisgrieser avatar dgagn avatar mystilleef avatar olimorris avatar stevanmilic avatar z775729168 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

diagflow.nvim's Issues

[Enhancement] Disable for certain filetypes?

It would be great to have the ability to disable this for certain filetypes. I'd be happy to push through a PR too.

My use case is for when I'm scrolling in Lazy's popup I see the LSP notifications in the top right:

Screen Shot 2023-09-11 at 19 59 47@2x

Being able to do something like:

enable = function() return vim.bo.filetype ~= "lazy" end

Use a box and border

When using split windows, the diagnostics are shown over the code, which is a bit hard to read. This could be improved with a box and a border. I like to use the Unicode half blocks as a poor man shadow:

image

usage with lspconfig

Thanks for your plugin, i had to add this to my lua config to hide the "original" inline messages

vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
    vim.lsp.diagnostic.on_publish_diagnostics, {
        virtual_text = false
    }
)

otherwise, it would display both

Toggle on insert misses with `toggle_event`

The FAQ provides a snippet for hiding diagflow messages while in insert mode. If the LSP loads after or during your first insert, diagflow messages will appear while in insert mode and hide while outside of insert mode -- the opposite of what's desired. I've hacked together a very simple workaround that fits my use-case here. I split toggle_event into enable_event and disable_event. I'm curious about a more permanent solution. :)

Bug: Not properly ignored in Insert Mode

If I understand the docs correctly, setting toggle_event = { "InsertEnter" }, is supposed to disable the output while in Insert Mode?

While that does work some of the time, new diagnostics still pop up in Insert mode. As far as I can tell, that is due to update_event = { 'DiagnosticChanged' } which gets triggered a lot during typing in insert mode.

Tbf, I am not even sure I understand correctly what the three *_event settings exactly do. toggle_event hides the diagnostics, update_event updates & shows them? In any case, my goal is to simply hide diagnostics completely while in insert mode, and show them while outside insert mode, and I am not sure how to achieve that behavior. Considering that is a configuration many people would like, I'd say it could make sense to offer that directly as a setting?

hey bro, good plugin, but can i get borders?

i liked this plugin v.much, thanks, but i want borders in the diag if and only if the diagnostics is not inline?

2023-10-14-214958_hyprshot

like adding a border = "rounded" for a diag grp like if u have used lsp_lines it groups the diagnostics and shows it...?
and btw can i get separation between 2 or more diagnostics?

Support for plugins like scrollbar

Would you consider support scrollbar plugins like petertriho/nvim-scrollbar?

See how the = from she scroll bar is pushed to the left, ie. both plugins share the same right hand side space.

image

Error from the latest update

Error detected while processing DiagnosticChanged Autocommands for "*":
Error executing lua callback: ...ocal/share/nvim/lazy/diagflow.nvim/lua/diagflow/lazy.lua:95: attempt to call field 'is_disabled' (a nil value)
stack traceback:
...ocal/share/nvim/lazy/diagflow.nvim/lua/diagflow/lazy.lua:95: in function <...ocal/share/nvim/lazy/diagflow.nvim/lua/diagflow/lazy.lua:90>
[C]: in function 'nvim_exec_autocmds'
/usr/share/nvim/runtime/lua/vim/diagnostic.lua:727: in function 'set'
/usr/share/nvim/runtime/lua/vim/lsp/diagnostic.lua:206: in function 'handler'
/usr/share/nvim/runtime/lua/vim/lsp.lua:1049: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>

better highlight groups

There are standart highlight groups for lsp.
Not 100% sure but I think it's LspDiagnostic* (this also changed sometime in the past so I'm never completely sure)
I'm not at my computer with neovim rn so I can't check

I think it would make sense to just use this highlight groups instead of your own ones

API to enable or disable diagflow

Can you provide an API to enable and disable Dialogflow? I like to disable diagnostics in InsertMode and reenable them in NormalMode.

Check on BufWritePost

Diagnostics don't seem to be correctly refreshed even after they've been addressed. After saving the document, can you trigger a check to clear the diagnostics properly? Relying on CursorMoved and DiagnosticChanged doesn't seem to be enough.

The diagnostic doesn't come back when using the vim.lsp.buf.hover

The diagnostic disappear when I use the vim.lsp.buf.hover.

Video sample:
output

I still need to execute :DiagflowToggle two times to show the diagnostic again.

Here is my diagflow config:

require("diagflow").setup({
	enable = true,
	max_width = 30,  -- The maximum width of the diagnostic messages
	severity_colors = {  -- The highlight groups to use for each diagnostic severity level
		error = "DiagnosticFloatingError",
		warning = "DiagnosticFloatingWarning",
		info = "DiagnosticFloatingInfo",
		hint = "DiagnosticFloatingHint",
	},

	gap_size = 1,
	scope = "line", -- 'cursor', 'line'
	padding_top = 5,
	placement = "top",
	update_event = { "DiagnosticChanged", "BufEnter" },
	toggle_event = { "InsertEnter" }
})

Here is my lspconfig config related to vim.lsp.buf.hover:

local lspconfig = require('lspconfig')

vim.api.nvim_create_autocmd('LspAttach', {
	group = vim.api.nvim_create_augroup('UserLspConfig', {}),
	callback = function(ev)
		local opts = { buffer = ev.buf }
		vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
	end,
})

Break on whitespace

I think the messages would be more readable when the text is broken on whitespace.

FR: option to format Diagnostic Text

Thanks for this nice plugin!

So the default diagnostic messages can be configured. Among other things, there is the option vim.diagnostic.config.format (nvim docs), which accepts a function for formatting the diagnostic text. Most importantly, one such option is to add the diagnostic source to the text, which is relevant when you have more than one diagnostics provider in a given buffer (e.g. lsp + linter via null-ls)

FR: Add `max_height` option

Some LSP servers give out really lengthy diagnostics, e.g. type errors where the types are objects with many properties. For this case, a max_height option would be very useful
Pasted image 2023-07-26 at 23 51 05@2x

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.