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

Re-evaluate ccls-library-folders-fn #123

Merged
merged 1 commit into from
Jan 24, 2024
Merged

Conversation

spaceotter
Copy link
Contributor

Customizing the variable ccls-library-folders-fn did not do anything, because the variable is evaluated once when the package loads. That occurs even before custom.el runs. This replaces the bare reference with a wrapper lambda that will pick up a new value of the variable.

ccls.el Outdated
@@ -164,7 +164,7 @@ DIRECTION can be \"D\", \"L\", \"R\" or \"U\"."
(lsp-ht ("$ccls/publishSkippedRanges" #'ccls--publish-skipped-ranges)
("$ccls/publishSemanticHighlight" #'ccls--publish-semantic-highlight))
:initialization-options (lambda () ccls-initialization-options)
:library-folders-fn ccls-library-folders-fn))
:library-folders-fn (lambda (&rest args) (apply ccls-library-folders-fn args))))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems correct, but I haven't updated my emacs config for a long time and have mostly forgotten elisp :(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that this could crash if ccls-library-folders-fn is nil, posted a fix.

Customizing the variable `ccls-library-folders-fn` did not do anything,
because the variable is evaluated once when the package loads. That
occurs even before `custom.el` runs. This replaces the bare reference
with a wrapper lambda that will pick up a new value of the variable.
@yyoncho yyoncho merged commit 9b4a47e into emacs-lsp:master Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants