Skip to content
This repository has been archived by the owner on Aug 12, 2023. It is now read-only.

Proselint causes null-ls failed to run generator, after editing. #1529

Open
4 of 5 tasks
basava70 opened this issue Apr 21, 2023 · 2 comments
Open
4 of 5 tasks

Proselint causes null-ls failed to run generator, after editing. #1529

basava70 opened this issue Apr 21, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@basava70
Copy link

FAQ

  • I have checked the FAQ and it didn't resolve my problem.

Issues

  • I have checked existing issues and there are no issues with the same problem.

Neovim Version

v0.9.0-dev

Dev Version?

  • I am using a stable Neovim release version, or if I am using a dev version of Neovim I have confirmed that my issue is reproducible on a stable version.

Operating System

Ubuntu 22.04

Minimal Config

-- this template is borrowed from nvim-lspconfig
local on_windows = vim.loop.os_uname().version:match("Windows")

local function join_paths(...)
	local path_sep = on_windows and "\\" or "/"
	local result = table.concat({ ... }, path_sep)
	return result
end

vim.g.loaded_remote_plugins = ""
vim.cmd([[set runtimepath=$VIMRUNTIME]])

local temp_dir = vim.loop.os_getenv("TEMP") or "/tmp"

vim.cmd("set packpath=" .. join_paths(temp_dir, "nvim", "site"))

local package_root = join_paths(temp_dir, "nvim", "site", "pack")
local install_path = join_paths(package_root, "packer", "start", "packer.nvim")
local compile_path = join_paths(install_path, "plugin", "packer_compiled.lua")

local null_ls_config = function()
	local null_ls = require("null-ls")
	-- add only what you need to reproduce your issue
	null_ls.setup({
		sources = {
			null_ls.builtins.diagnostics.proselint,
			null_ls.builtins.code_actions.proselint,
		},
		debug = true,
	})
end

local function load_plugins()
	-- only add other plugins if they are necessary to reproduce the issue
	require("packer").startup({
		{
			"wbthomason/packer.nvim",
			{
				"jose-elias-alvarez/null-ls.nvim",
				requires = { "nvim-lua/plenary.nvim" },
				config = null_ls_config,
			},
		},
		config = {
			package_root = package_root,
			compile_path = compile_path,
		},
	})
end

if vim.fn.isdirectory(install_path) == 0 then
	vim.fn.system({ "git", "clone", "https://github.com/wbthomason/packer.nvim", install_path })
	load_plugins()
	require("packer").sync()
else
	load_plugins()
	require("packer").sync()
end

Steps to Reproduce

%Any latex file
jsdfjd jtesting
j:w
jj: $ x + 2$jj
jj

Reproducibility Check

  • I confirm that my minimal config is based on the minimal_init.lua template and that my issue is reproducible by running nvim --clean -u minimal_init.lua and following the steps above.

Expected Behavior

Proselint should attach to buffer and :NullLsInfo shud show that information.

Actual Behavior

:NullLsInfo is showing me that proselint is not attached
Screenshot from 2023-04-21 02-22-37
first I would like to know how to get proselint attach to the buffer after using nvim --clean -u minimal_init.lua ?

Debug Log

I have log output for my original problem, but since proselint is not even attaching to the buffer, I have no log output specific to this problem.

Help

No

Implementation Help

No response

Requirements

  • I have read and followed the instructions above and understand that my issue will be closed if I did not provide the required information.
@basava70 basava70 added the bug Something isn't working label Apr 21, 2023
@jose-elias-alvarez
Copy link
Owner

This seems to be working for me using your minimal config and sample file:

Screenshot 2023-04-21 at 7 57 44 PM

Screenshot 2023-04-21 at 7 58 26 PM

Are you sure there's nothing relevant in the log or :messages?

@basava70
Copy link
Author

This seems to be working for me using your minimal config and sample file:

Screenshot 2023-04-21 at 7 57 44 PM Screenshot 2023-04-21 at 7 58 26 PM

Are you sure there's nothing relevant in the log or :messages?

I dont know what to say but for the sample file, I have the same response : current buffers has no sources attached.
However, I tried a different file,


%%%%plot.tex %%%%


\documentclass[a4paper, 12pt]{article}
\usepackage{geometry}
\geometry{a4paper}
\usepackage{graphicx}
\usepackage{amsmath, amssymb, bm}
\usepackage{subcaption}
\captionsetup{justification=centering, singlelinecheck=false}
\usepackage{tikz}
\usepackage{float}

\title{Thermal Example Mode $1$}
\begin{document}
\maketitle
sdfjsdjfjj:
$sjdf $jj:w

\section{Problem Data}
\begin{center}
\begin{tabular}{|c|c|}
\hline
Parameters & Value \
$ E $ & $5 \times 10^7 [Pa]$ \
$ \nu$ & $ 0.4999$ \
$ \mu$ & $ 1.6668 \times 10^7$ [Pa] \
$ \lambda$ & $ 8.332 \times 10^{10}$ [Pa] \
$ \alpha $ & $ 8 \times 10^{-5}$ [1/K] \
$ \gamma $ & $ 0.2[W/(mK)]$ \
$ f $ & $ 4\left(e^{-40(x-2)^2 + (y-2)^2}\right)$ \
domain $\Omega$ & $[-2,2]$ \
\hline
\end{tabular}
\end{center}

jjj sdfsdf
jj
sdfdsfjj
\end{document}


it seems, proselint is attaching
Screenshot from 2023-04-23 11-19-13
I changed the minimal.lua to work on save but it is not happening and dont even get any warnings from proselint either.


minimal.lua


-- this template is borrowed from nvim-lspconfig
local on_windows = vim.loop.os_uname().version:match("Windows")

local function join_paths(...)
local path_sep = on_windows and "\" or "/"
local result = table.concat({ ... }, path_sep)
return result
end

vim.g.loaded_remote_plugins = ""
vim.cmd([[set runtimepath=$VIMRUNTIME]])

local temp_dir = vim.loop.os_getenv("TEMP") or "/tmp"

vim.cmd("set packpath=" .. join_paths(temp_dir, "nvim", "site"))

local package_root = join_paths(temp_dir, "nvim", "site", "pack")
local install_path = join_paths(package_root, "packer", "start", "packer.nvim")
local compile_path = join_paths(install_path, "plugin", "packer_compiled.lua")

local null_ls_config = function()
local null_ls = require("null-ls")
-- add only what you need to reproduce your issue
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
null_ls.setup({
sources = {
null_ls.builtins.formatting.prettier,
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.clang_format,
null_ls.builtins.formatting.latexindent,
null_ls.builtins.formatting.prettier,
null_ls.builtins.code_actions.proselint,
null_ls.builtins.diagnostics.proselint,
null_ls.builtins.diagnostics.cmake_lint,
null_ls.builtins.diagnostics.cpplint,
},
debug = true,
-- configure format on save
on_attach = function(current_client, bufnr)
if current_client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format({
filter = function(client)
-- only use null-ls for formatting instead of lsp server
return client.name == "null-ls"
end,
bufnr = bufnr,
})
end,
})
end
end,
})
end

local function load_plugins()
-- only add other plugins if they are necessary to reproduce the issue
require("packer").startup({
{
"wbthomason/packer.nvim",
{
"jose-elias-alvarez/null-ls.nvim",
requires = { "nvim-lua/plenary.nvim" },
config = null_ls_config,
},
},
config = {
package_root = package_root,
compile_path = compile_path,
},
})
end
if vim.fn.isdirectory(install_path) == 0 then
vim.fn.system({ "git", "clone", "https://github.com/wbthomason/packer.nvim", install_path })
load_plugins()
require("packer").sync()
else
load_plugins()
require("packer").sync()
end


Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants