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

Highlight breaks after certain amount of lines #154

Open
frankitox opened this issue Nov 11, 2024 · 1 comment
Open

Highlight breaks after certain amount of lines #154

frankitox opened this issue Nov 11, 2024 · 1 comment
Labels
A-lsp Area: LSP conformance issues and missing features C-support Catagory: support questions

Comments

@frankitox
Copy link

frankitox commented Nov 11, 2024

Hi! I'm using nil via vim + neovim/nvim-lspconfig. It's working pretty well, but once in a while I try to use :lua vim.lsp.buf.document_highlight() which highlights the variable that's on the cursor. This works in simple code, but the more complex it gets, the less likely I'll see all the references. Here's two examples that differ in only one line:

image
image

{ config, lib, rycee-lib, ... }:

let
  pepe = x: lib.mkMerge [
    {
      extensions = [
        config.nur.repos.rycee.firefox-addons.ublock-origin
        config.nur.repos.rycee.firefox-addons.darkreader
        config.nur.repos.bandithedoge.firefoxAddons.imagus
        # https://addons.mozilla.org/en-US/firefox/addon/art-project/
        # https://addons.mozilla.org/en-US/firefox/addon/shortkeys/
        # istilldontcareaboutcookies-1.1.1
        (rycee-lib.buildFirefoxXpiAddon {
          meta = with lib;
            {
              homepage = "https://github.com/reblws/tab-search/";
              description = "Easy tab search & management. Get a keyboard-accessible search interface for managing your tabs.";
              mozPermissions = [
                "tabs"
                "activeTab"
                "storage"
                "sessions"
                "bookmarks"
                "history"
              ];
              platforms = platforms.all;
            };
        })
      ];
    }
  ];
in
{
  programs = (pepe { });
}
@frankitox frankitox changed the title Highlight break after certain amount of lines Highlight breaks after certain amount of lines Nov 11, 2024
@oxalica
Copy link
Owner

oxalica commented Nov 19, 2024

I think this is expected since Document Highlight is more like a quick fuzzy glance for all related code. If the variable is defined hundreds lines above the usage, you cannot highlight it anyway because it's out of the screen.

You can always use precise "Goto Definition" and/or "References" to get a complete list.

@oxalica oxalica added C-support Catagory: support questions A-lsp Area: LSP conformance issues and missing features labels Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lsp Area: LSP conformance issues and missing features C-support Catagory: support questions
Projects
None yet
Development

No branches or pull requests

2 participants