feat: forward user-provided initializationOptions to pasls#1544
Open
zen010101 wants to merge 1 commit into
Open
feat: forward user-provided initializationOptions to pasls#1544zen010101 wants to merge 1 commit into
zen010101 wants to merge 1 commit into
Conversation
Mirror how editor LSP clients (Sublime LSP, VSCode) let users forward arbitrary options to pasls. Read initializationOptions from ls_specific_settings["pascal"]["initializationOptions"] and merge them into the initialize params, with user-provided values taking precedence. This enables forwarding options such as fpcOptions for third-party unit and include search paths (e.g. mORMot) instead of being limited to a hard-coded subset. _get_initialize_params becomes an instance method so it can read the configured override.
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.
What
Forward user-provided
initializationOptionstopasls, so users can passarbitrary pasls options (e.g.
fpcOptions) via Serena'sls_specific_settings["pascal"]["initializationOptions"].Why
Serena currently sends only a hard-coded subset of
initializationOptionsto pasls. Editor LSP clients (Sublime LSP, VSCode) let users forward
arbitrary options. Without this, there is no way to tell pasls about
third-party unit/include search paths (e.g. mORMot), which breaks symbol
resolution for projects that depend on external FPC libraries.
Change
initializationOptionsfromls_specific_settings["pascal"]._get_initialize_paramsbecomes an instance method to access the override.Compatibility
Backward compatible: with no
initializationOptionsconfigured, behavioris unchanged.