-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiline Comments Break Semantic Highlighting with rocks-lazy.nvim #374
Comments
Hey, thanks! I can't reproduce this, what I see visually is the same in both cases which is: Judging from the end of your comment when you say semantic highlighting I assume you just mean highlighting in general right? Semantic tokens are sent by the LSP, so if there were some broken behavior in which tokens were sent that'd be something we file upstream in the lean core repo. If lean.nvim's own (non-semantic token) extra highlighting were broken though obviously that's a bug here. Looking at the output of Can you confirm perhaps some specific steps and what you see from (Including the source code would be slightly helpful as well besides the screenshot) |
I replicated it with a minimal setup. You can find it over at EmDash00/LeanMinimal. I'm not sure if it's because I use rocks.nvim as my package manager. The minimal setup is bootstrapping though so it should install |
Oh I nearly forgot to give the code. Here you go: import Mathlib.Data.Nat.Prime.Defs
/- I mess things up. -/
example : (False) → (False) := λ h => h
example : (False) → (True) := λ h => True.intro
example : (True) → (True) := λ h => True.intro |
Okay I seem to have found the issue. I was lazily loading the plugin using nvim-neorocks/rocks-lazy.nvim. I figured since you can load the plugin lazily with folke/lazy.nvim you could use Rocks' version of that. Sadly no. Here's the lazy loading code I used to try this. I think in my hurry to replicate it, I must have forgotten to call Simply loading the plugin in init.luarequire("lz.n").load("plugins") lua/plugins/lean.luareturn {
"lean.nvim",
ft = { "lean" },
after = function()
local lsp_defaults = require("lsp_defaults")
require("lz.n").trigger_load {
"nvim-lspconfig",
"plenary.nvim",
"switch.vim",
"satellite.nvim",
"telescope.nvim",
}
require('lean').setup {
lsp = {
on_attach = lsp_defaults.on_attach,
capabilities = lsp_defaults.capabilities,
flags = lsp_defaults.flags
},
mappings = true
}
end
} |
|
Ah that makes sense then. It might be good to merge in that filetypes upstream. Let me check the code in nvim-neorocks/rocks-lazy.nvim to see how they're loading the filetype. |
Without a multiline comment:
With a multiline comment before:
Doing some prints to show the semantic tokens detected seems to show that adding the multiline comments doesn't change them.
The text was updated successfully, but these errors were encountered: