refactor some small session fields
Some checks are pending
lint / cargo-check (push) Waiting to run
lint / clippy (push) Waiting to run
lint / pre-commit (push) Waiting to run
lint / rustfmt (push) Waiting to run
release / build (push) Waiting to run
release / test (push) Waiting to run
release / release (push) Blocked by required conditions
test / generate-matrix (push) Waiting to run
test / Python , Django () (push) Blocked by required conditions
test / tests (push) Blocked by required conditions
zizmor 🌈 / zizmor latest via PyPI (push) Waiting to run

This commit is contained in:
Josh Thomas 2025-05-17 23:24:14 -05:00
parent 9e13422245
commit de5e65c10d
2 changed files with 13 additions and 8 deletions

View file

@ -45,8 +45,8 @@ pub struct Session {
}
impl Session {
pub fn client_capabilities_mut(&mut self) -> &mut Option<ClientCapabilities> {
&mut self.client_capabilities
pub fn set_client_capabilities(&mut self, client_capabilities: ClientCapabilities) {
self.client_capabilities = Some(client_capabilities);
}
pub fn project(&self) -> Option<&DjangoProject> {
@ -56,6 +56,9 @@ impl Session {
pub fn project_mut(&mut self) -> &mut Option<DjangoProject> {
&mut self.project
}
pub fn set_project(&mut self, project: DjangoProject) {
self.project = Some(project);
}
pub fn documents(&self) -> &Store {
&self.documents
@ -69,8 +72,8 @@ impl Session {
&self.settings
}
pub fn settings_mut(&mut self) -> &mut Settings {
&mut self.settings
pub fn set_settings(&mut self, settings: Settings) {
self.settings = settings;
}
/// Get a database instance directly from the session