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.
go to reference
#36Generated by Copilot
This pull request to the
lua/js-i18n
module includes significant changes to improve the handling of source inputs and enhance the functionality of the language server protocol (LSP). The most important changes are grouped into improvements to query handling, LSP enhancements, and utility adjustments.Improvements to query handling:
lua/js-i18n/analyzer.lua
: Replacedbufnr
with a more flexiblesource
parameter, which can be either a buffer number or a string source. This change affects multiple functions, includingget_node_for_key
,parse_get_t
,parse_call_t
, andfind_call_t_expressions
. [1] [2] [3] [4] [5]LSP enhancements:
lua/js-i18n/lsp/config.lua
: Introduced a reference table for each workspace to manage translation references more effectively.lua/js-i18n/lsp/protocol/notify/text_document_did_change.lua
andlua/js-i18n/lsp/protocol/notify/text_document_did_open.lua
: Added logic to initialize and update the reference table when documents change or open. [1] [2]lua/js-i18n/lsp/protocol/request/text_document_references.lua
: Implemented a new handler for thetextDocument/references
request to find references of translation keys.lua/js-i18n/lsp/protocol/request/text_document_definition.lua
: Updated the definition handler to use content directly instead of creating temporary buffers. [1] [2] [3] [4]Utility adjustments:
lua/js-i18n/lsp/checker.lua
: Modified thecheck
function to useworkspace_dir
instead ofbufnr
for detecting the library. [1] [2]lua/js-i18n/lsp/init.lua
: Scheduled protocol module handlers to run asynchronously usingvim.schedule
. [1] [2]These changes collectively enhance the flexibility and performance of the
js-i18n
module, particularly in handling various source inputs and improving LSP functionalities.