Conversation
- Introduce HoverSupportProvider handling textDocument/hover requests - Dynamically query MATLAB documentation via MVM and getHover handler when connected - Support workspace and directory user-defined function (.m) docstring inspection - Support local variable definition lookup in open documents - Add unit tests in tests/providers/hover/HoverSupportProvider.test.ts
…ulti-core indexer - Add persistent SQLite documentation lookup to HoverSupportProvider via node:sqlite - Query local ~/.cache/matlabls/matlab_docs.db in 0.05ms when MATLAB engine is offline - Provide multi-core parallel indexer CLI in tools/indexer/index_docs.js with dynamic CPU core scaling - Add MATLAB worker script tools/indexer/worker.m with real-time stdout progress streaming - Add unit tests for SQLite database lookup in tests/providers/hover/HoverSupportProvider.test.ts
- Implement HoverMarkdownUtils to parse and convert raw MATLAB help text into structured Markdown - Wrap only executable code (Syntax, Examples) into matlab code blocks for precise Tree-sitter highlighting - Format arguments into clean bullet lists and highlight See Also links - Integrate formatter into HoverSupportProvider for both MVM and SQLite responses - Add unit tests in tests/providers/hover/HoverMarkdownUtils.test.ts
…round auto-indexing and LSP command
Author
Member
|
Hi @rgunindi, thanks for working on this and opening the PR! It will take me a few days before I have an opportunity to take a more in-depth look at this, but wanted to let you know it's on my radar. |
Author
|
Thanks for letting me know! I'll be around whenever you have the time to dive into it. Have a great week, @dklilley |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Add comprehensive, high-performance LSP Hover (
textDocument/hover) support tomatlab-language-serveracross all LSP clients (VS Code, Helix, Neovim, Emacs, etc.).Key Features
Multi-Tier Dynamic Hover Resolution (
HoverSupportProvider):help(topic)viamatlabls.handlers.hover.getHover.~/.cache/matlabls/matlab_docs.dbusing Node 22 nativenode:sqlite(zero third-party npm dependencies).Structured Markdown Formatter (
HoverMarkdownUtils):helptext into clean, high-fidelity Markdown.matlabsyntax blocks.Hybrid Background Indexing Architecture (
DocumentationIndexer):matlab.indexDocumentationsetting and--indexDocumentationCLI option ('onMissing'[default],'never','always').matlabls.indexDocumentationworkspace command for manual / on-demand triggers.tools/indexer/index_docs.js&tools/indexer/worker.m) automatically scaling worker pool to host CPU cores with quiet/headless mode.Testing & Verification:
HoverSupportProvider,HoverMarkdownUtils,DocumentationIndexer, andExecuteCommandProvider.npm test).npm run package) and strict linting.Motivation: Why is this needed?
Currently,
matlab-language-serverdoes not implement LSP Hover (textDocument/hover). Developers editing MATLAB code in modern editors (Helix, Neovim, VS Code, Emacs, Sublime) are left without inline function signatures, argument definitions, or documentation.Furthermore, connecting to MATLAB via the Language Server (
matlabConnectionTiming = "onStart"or"onDemand") spawns a full MATLAB runtime process (consuming 1.5 GB – 3 GB of RAM, locking license seats, taking 15–30 seconds to boot, and draining battery). Because of this overhead, many developers explicitly configure:Under this lightweight configuration—or in headless/remote environments (SSH, containers, CI)—developers previously had no documentation access whatsoever.
There was a critical need for an offline-first, zero-overhead, sub-millisecond Hover documentation engine that delivers rich, authentic MATLAB documentation without requiring a running MATLAB GUI/daemon.
Solution: How did we solve it?
Currently,
matlab-language-serverdoes not implement LSP Hover (textDocument/hover). Developers editing MATLAB code outside the official MATLAB desktop are left without inline signatures, argument descriptions, or function docs.To query documentation dynamically via MATLAB:
Under this lightweight configuration, developers previously had no documentation access whatsoever.
There was a critical need to decouple documentation from the live MATLAB runtime lifecycle, providing an offline-first, zero-overhead, sub-millisecond Hover documentation engine that eliminates the need to keep MATLAB running in the background.
We implemented a comprehensive, multi-tier Hover architecture with an offline SQLite cache and parallel multi-core indexer:
Sub-Millisecond Offline SQLite Lookup (~0.05ms):
node:sqlite(DatabaseSync), requiring zero third-party npm dependencies.~/.cache/matlabls/matlab_docs.dbinstantly with virtually 0 MB RAM footprint and 0% idle CPU usage.Zero Hardcoding — 100% Data-Driven Extraction:
helpfuncbycat.xml) via an automated parallel indexer.High-Performance Multi-Core Parallel Indexer (
tools/indexer/index_docs.js):Multi-Tier Fallback Hierarchy:
help(topic)viamatlabls.handlers.hover.getHover.never), retrieves authentic documentation in <0.1ms.High-Fidelity Markdown Formatter (
HoverMarkdownUtils):helptext into structured Markdown.matlabblocks.Non-Blocking Hybrid Lifecycle (
DocumentationIndexer):matlab.indexDocumentationsetting and--indexDocumentationCLI option ('onMissing'[default],'never','always').matlabls.indexDocumentationfor on-demand re-indexing.Verification (Proof of Work)
First-indexing:


After indexing:
Key Changes Summary
src/providers/hover/HoverSupportProvider.ts: Multi-tier hover provider (MVM feval, SQLite, workspace files, local variables).src/providers/hover/HoverMarkdownUtils.ts: Authentic MATLAB help-to-Markdown parser.src/indexing/DocumentationIndexer.ts: Background non-blocking indexer service with setting callbacks.src/lifecycle/ConfigurationManager.ts&src/utils/CliUtils.ts: AddedindexDocumentationconfiguration and CLI option.src/providers/lspCommands/ExecuteCommandProvider.ts: Addedmatlabls.indexDocumentationcommand.tools/indexer/index_docs.js&tools/indexer/worker.m: Dynamic multi-core parallel indexer.matlab/+matlabls/+handlers/+hover/getHover.m: MVM engine help evaluator.tests/: 281 passing tests (100% test suite pass rate).