{"id":46527314,"url":"https://github.com/nemanjamalesija/ts-expand-hover.nvim","last_synced_at":"2026-03-08T04:00:31.959Z","repository":{"id":340318144,"uuid":"1165162093","full_name":"nemanjamalesija/ts-expand-hover.nvim","owner":"nemanjamalesija","description":"Progressively expand TypeScript types inside hover floats.","archived":false,"fork":false,"pushed_at":"2026-02-24T12:58:31.000Z","size":1199,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-24T14:39:59.404Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nemanjamalesija.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-23T22:17:57.000Z","updated_at":"2026-02-24T13:26:38.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nemanjamalesija/ts-expand-hover.nvim","commit_stats":null,"previous_names":["nemanjamalesija/ts-expand-hover.nvim"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/nemanjamalesija/ts-expand-hover.nvim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemanjamalesija%2Fts-expand-hover.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemanjamalesija%2Fts-expand-hover.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemanjamalesija%2Fts-expand-hover.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemanjamalesija%2Fts-expand-hover.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nemanjamalesija","download_url":"https://codeload.github.com/nemanjamalesija/ts-expand-hover.nvim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemanjamalesija%2Fts-expand-hover.nvim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30244537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T00:58:18.660Z","status":"online","status_checked_at":"2026-03-08T02:00:06.215Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-06T21:00:28.266Z","updated_at":"2026-03-08T04:00:31.946Z","avatar_url":"https://github.com/nemanjamalesija.png","language":"Lua","funding_links":[],"categories":["LSP"],"sub_categories":[],"readme":"# ts-expand-hover.nvim\n\n![ts-expand-hover demo](https://github.com/nemanjamalesija/ts-expand-hover.nvim/raw/main/assets/demo.gif)\n\nExpandable TypeScript type inspection for NeoVim. Uses TypeScript 5.9's `verbosityLevel` API to let you progressively expand and collapse type aliases directly inside a hover float.\n\n## Features\n\n- **Progressive type expansion** — press `+` to expand type aliases one level at a time, `-` to collapse\n- **In-place float updates** — content updates without closing or repositioning the float\n- **Treesitter highlighting** — TypeScript code fences are syntax-highlighted via treesitter markdown injection\n- **Documentation and JSDoc** — documentation text and `@param`/`@returns`/`@example` tags rendered below the type block\n- **Configurable keymaps and float** — override or disable any keymap; customize border, max width, max height\n- **Graceful fallback** — falls back to `vim.lsp.buf.hover()` when vtsls is not attached or TypeScript \u003c 5.9\n- **Concurrent request guard** — rapid key presses are silently dropped; stale responses are discarded\n\n## Requirements\n\n- **NeoVim 0.10+**\n- **[vtsls](https://github.com/yioneko/vtsls)** v0.2.9+ (v0.3.0+ recommended — bundles TypeScript 5.9)\n- **TypeScript 5.9+** (for `verbosityLevel` support in tsserver's quickinfo)\n\n## Installation\n\n```lua\n-- lazy.nvim\n{\n  \"nemanjamalesija/ts-expand-hover.nvim\",\n  ft = { \"typescript\", \"typescriptreact\" },\n  opts = {\n    keymaps = { hover = \"\u003cleader\u003eth\" },\n  },\n}\n```\n\nFor other plugin managers, call `require(\"ts_expand_hover\").setup()` after loading.\n\n## Configuration\n\nCalling `setup()` with no arguments uses all defaults:\n\n```lua\nrequire(\"ts_expand_hover\").setup({\n  keymaps = {\n    hover    = \"K\",               -- normal mode key to open hover float\n    expand   = \"+\",               -- expand type one level (inside float)\n    collapse = \"-\",               -- collapse type one level (inside float)\n    close    = { \"q\", \"\u003cEsc\u003e\" },  -- close float and return to source\n  },\n  float = {\n    border     = \"rounded\",   -- \"rounded\", \"single\", \"double\", \"none\"\n    max_width  = 80,\n    max_height = 30,\n  },\n})\n```\n\nSet any keymap to `false` to prevent the plugin from registering it, so you can bind it yourself:\n\n```lua\nrequire(\"ts_expand_hover\").setup({\n  keymaps = { hover = false },\n})\n\n-- TypeScript-only mapping to avoid conflicts with other plugins that map K\nvim.api.nvim_create_autocmd(\"FileType\", {\n  pattern = { \"typescript\", \"typescriptreact\" },\n  callback = function(ev)\n    vim.keymap.set(\"n\", \"K\", require(\"ts_expand_hover\").hover, {\n      buffer = ev.buf,\n      desc = \"TypeScript expandable hover\",\n    })\n  end,\n})\n```\n\n## Keymaps\n\n| Key | Scope | Action |\n|-----|-------|--------|\n| `K` | Normal mode (global) | Open hover float at cursor |\n| `+` | Inside float | Expand type one level |\n| `-` | Inside float | Collapse type one level |\n| `q` / `Esc` | Inside float | Close float, return focus to source |\n\nThe float closes automatically when you move the cursor in the source buffer. The footer shows the current verbosity depth and available actions. When maximum expansion is reached, the footer shows `[max]`.\n\n## Health check\n\nRun `:checkhealth ts_expand_hover` to verify your setup (NeoVim version, vtsls attachment, TypeScript version). Open a TypeScript file first so vtsls has a chance to attach.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eHow it works\u003c/strong\u003e\u003c/summary\u003e\n\nThe plugin sends `typescript.tsserverRequest` commands to vtsls via `workspace/executeCommand`. It passes the `verbosityLevel` parameter (TypeScript 5.9) to tsserver's `quickinfo` command, controlling how deeply type aliases are expanded.\n\n1. `K` — sends a quickinfo request with `verbosityLevel: 0`\n2. `+` — increments verbosity and re-requests; the float updates in-place\n3. `-` — decrements verbosity and re-requests\n4. A generation counter discards stale responses from prior hover sessions\n\nWhen vtsls is not attached or TypeScript \u003c 5.9 is detected, the plugin falls back to `vim.lsp.buf.hover()`.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eTroubleshooting\u003c/strong\u003e\u003c/summary\u003e\n\n**Hover shows the standard LSP float** — vtsls is not attached. Run `:checkhealth ts_expand_hover` and make sure your LSP config starts vtsls for TypeScript files.\n\n**Pressing + does nothing** — either the footer shows `[max]` (fully expanded), or TypeScript \u003c 5.9 is in use.\n\n**Float doesn't open** — NeoVim \u003c 0.10 is required for the `footer` option in `nvim_open_win`. Also verify `setup()` was called.\n\n**K is already bound** — use a custom hover key (e.g. `hover = \"\u003cleader\u003eth\"`) or disable the global mapping and remap per-filetype (see Configuration above).\n\n\u003c/details\u003e\n\n## Running tests\n\n```sh\nmake test\n```\n\nRequires NeoVim and [plenary.nvim](https://github.com/nvim-lua/plenary.nvim). Tests run headlessly with no live LSP dependency.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemanjamalesija%2Fts-expand-hover.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnemanjamalesija%2Fts-expand-hover.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemanjamalesija%2Fts-expand-hover.nvim/lists"}