Add clangd prime file support#1374
Open
pikaro wants to merge 1 commit intooraios:mainfrom
Open
Conversation
MischaPanch
requested changes
Apr 19, 2026
Contributor
MischaPanch
left a comment
There was a problem hiding this comment.
Thanks! A test is failing due to the new changes
FAILED test/solidlsp/test_rename_didopen.py::test_request_rename_symbol_edit_opens_file_before_rename - AttributeError: 'DummyLanguageServer' object has no attribute '_persistently_open_file_uris'
Pls check whether this is also needed/useful for ccls
| if not prime_files: | ||
| return | ||
| if not isinstance(prime_files, list): | ||
| raise TypeError("ls_specific_settings['cpp']['prime_files'] must be a list of relative file paths") |
Contributor
There was a problem hiding this comment.
use prime_files insteaf of accessing dict again
| self._persistently_open_file_uris.add(uri) | ||
| return file_buffer | ||
|
|
||
| def close_file_persistently(self, relative_file_path: str | None = None, uri: str | None = None) -> None: |
Contributor
There was a problem hiding this comment.
I think persistently is a misnomer here. Rather, just close_file?
Also, both new methods should be private
| ``compile_commands.json`` if needed. | ||
| - clangd_version: Override the pinned Clangd version downloaded by Serena | ||
| (default: the bundled Serena version). | ||
| - prime_files: Translation units to keep open after startup in order to |
Contributor
There was a problem hiding this comment.
pls add an explanation to the docs in the corresponding section. Should this also be supported by ccls?
| self.server_ready.wait() | ||
| self._prime_translation_units() | ||
|
|
||
| def _prime_translation_units(self) -> None: |
Contributor
There was a problem hiding this comment.
pls add a docstring on the what and why
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.
prime_fileparameter to clangd configurationResolves #1373