Skip to content
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

a few remarks on the debugging outputs #4053

Open
teto opened this issue Dec 28, 2022 · 4 comments
Open

a few remarks on the debugging outputs #4053

teto opened this issue Dec 28, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@teto
Copy link
Collaborator

teto commented Dec 28, 2022

Is your feature request related to a problem? Please describe.

I would like the equivalent of :LspInfo that dumps only what is relevant to debug my current buffer, maybe something like :TSInfo ?
TSModuleInfo dumps too much information, here it dumps 137 lines for all the languages I have nothing installed.

Other remarks on checkhealth:

- WARNING `tree-sitter` executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)
- WARNING `node` executable not found (only needed for :TSInstallFromGrammar, not required for :TSInstall)
- ERROR `cc` executable not found.
  - ADVICE:
    - Check that any of { vim.NIL, "cc", "gcc", "clang", "cl", "zig" } is in your $PATH or set the environment variable CC or `require"nvim-treesitter.install".compilers` explicitly!
- OK Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

OS Info:
{
  machine = "x86_64",
  release = "6.1.1",
  sysname = "Linux",
  version = "#1-NixOS SMP PREEMPT_DYNAMIC Wed Dec 21 16:48:12 UTC 2022"
} ~

I install all my grammars via nix, I find it weird to see the absence of a compiler. It should be a warning or popup when running TSInstall.

- WARNING `tree-sitter` executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)
- WARNING `node` executable not found (only needed for :TSInstallFromGrammar, not required for :TSInstall)

I've tried :h :TSInstall to no avail, so I wonder what's the difference between TSInstallFromGrammar and TSInstall ? Might be worth adding to documentation.
As for the "OS info" part, if every plugin starts to add a similar output to its healthcheck, we are doomed. It is relevant though so maybe it should be upstreamed to bneovim instead.

@teto teto added the enhancement New feature or request label Dec 28, 2022
@theHamsta
Copy link
Member

theHamsta commented Dec 28, 2022

I would like the equivalent of :LspInfo that dumps only what is relevant to debug my current buffer, maybe something like :TSInfo ?

So you would like to have something like :TSModuleInfo? But filtered for the languages for the current buffer?

I've tried :h :TSInstall to no avail, so I wonder what's the difference between TSInstallFromGrammar and TSInstall ? Might be worth adding to documentation.

:TSInstall installs the parsers with minimal steps needed. Typically, just compiling the C sources. :TSInstallFromGrammar generates the parser from grammar.js so you need node and for some parsers even npm when they have dependencies on other grammars.

As for the "OS info" part, if every plugin starts to add a similar output to its healthcheck, we are doomed. It is relevant though so maybe it should be upstreamed to bneovim instead.

Yes, we really need the OS info since we often debug compiler errors. In particular, we would like to know whether they are on MacOS, Windows or Linux, and the arch on Windows and MacOS.Many users compile for the wrong architecture (e.g. 32bit parsers on 64bit Neovim or arm64 parsers for a Rosetta emulated x64 Neovim or vice-versa. Many users don't seem to be able to provide this information reliably as they didn't notice that their OS runs a different architecture for them. This would be something that could be somehow deducible from nvim --version

It is relevant though so maybe it should be upstreamed to bneovim instead.

What do you mean? Where upstream Neovim should put it? It's just the output of vim.loop.os_uname()

@teto
Copy link
Collaborator Author

teto commented Dec 28, 2022

So you would like to have something like :TSModuleInfo? But filtered for the languages for the current buffer?

Yes, I would be happy with :TSModuleInfo <filetype> but since there are already TSBuf commands maybe TSBufInfo could be an alias to :TSModuleInfo <filetype>

It's just the output of vim.loop.os_uname()

I understand it's valuable information but we can't have every plugin dump that in checkhealth. Rather than displaying this in treesitter, I say let's dump it in require("nvim.health").check() so that all plugins can get the info (ask for a full dump of checkhealth in the bug report).

Thnaks for the explanation about TSInstall. Worth adding to docs imo

@theHamsta
Copy link
Member

I've tried :h :TSInstall to no avail, so I wonder what's the difference between TSInstallFromGrammar and TSInstall ? Might be worth adding to documentation.

I just tried to fix that. But I discovered that we already have a :TSInstall tag. Did you miss generating the help tags for nvim-treesitter.

@teto
Copy link
Collaborator Author

teto commented Jan 6, 2023

yeah I can see the tag now, not sure why it didn't work before. I've been playing with the playground it's great, but I think I hit nvim-treesitter/playground#88 . I've ran a nvim-treesitter checkhealth
image
could the message say in which query the errors were found ?

NB: found the issue, I had not the "query" grammar installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants