mirror of
https://github.com/joshuadavidthomas/django-language-server.git
synced 2025-12-23 08:47:53 +00:00
bump rust toolchain to 1.90 (#242)
Some checks are pending
lint / pre-commit (push) Waiting to run
lint / rustfmt (push) Waiting to run
lint / clippy (push) Waiting to run
lint / cargo-check (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
zizmor 🌈 / zizmor latest via PyPI (push) Waiting to run
test / tests (push) Blocked by required conditions
Some checks are pending
lint / pre-commit (push) Waiting to run
lint / rustfmt (push) Waiting to run
lint / clippy (push) Waiting to run
lint / cargo-check (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
zizmor 🌈 / zizmor latest via PyPI (push) Waiting to run
test / tests (push) Blocked by required conditions
This commit is contained in:
parent
a080e18279
commit
eff5b7bace
10 changed files with 53 additions and 40 deletions
|
|
@ -13,11 +13,15 @@ and this project attempts to adhere to [Semantic Versioning](https://semver.org/
|
|||
### Removed - for now removed features
|
||||
### Fixed - for any bug fixes
|
||||
### Security - in case of vulnerabilities
|
||||
[${version}]: https://github.com/joshuadavidthomas/django-bird/releases/tag/v${version}
|
||||
[${version}]: https://github.com/joshuadavidthomas/django-language-server/releases/tag/v${version}
|
||||
-->
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
|
||||
- Bumped Rust toolchain from 1.88 to 1.90
|
||||
|
||||
## [5.2.0]
|
||||
|
||||
### Added
|
||||
|
|
|
|||
|
|
@ -386,40 +386,40 @@ fn generate_tag_name_completions(
|
|||
|
||||
// First, check if we should suggest end tags
|
||||
// If partial starts with "end", prioritize end tags
|
||||
if partial.starts_with("end") && tag_specs.is_some() {
|
||||
let specs = tag_specs.unwrap();
|
||||
|
||||
// Add all end tags that match the partial
|
||||
for (opener_name, spec) in specs {
|
||||
if let Some(end_tag) = &spec.end_tag {
|
||||
if end_tag.name.starts_with(partial) {
|
||||
// Create a completion for the end tag
|
||||
let mut insert_text = String::new();
|
||||
if needs_space {
|
||||
insert_text.push(' ');
|
||||
}
|
||||
insert_text.push_str(&end_tag.name);
|
||||
|
||||
// Add closing based on what's already present
|
||||
match closing {
|
||||
ClosingBrace::PartialClose | ClosingBrace::None => {
|
||||
insert_text.push_str(" %}");
|
||||
if partial.starts_with("end") {
|
||||
if let Some(specs) = tag_specs {
|
||||
// Add all end tags that match the partial
|
||||
for (opener_name, spec) in specs {
|
||||
if let Some(end_tag) = &spec.end_tag {
|
||||
if end_tag.name.starts_with(partial) {
|
||||
// Create a completion for the end tag
|
||||
let mut insert_text = String::new();
|
||||
if needs_space {
|
||||
insert_text.push(' ');
|
||||
}
|
||||
ClosingBrace::FullClose => {} // No closing needed
|
||||
}
|
||||
insert_text.push_str(&end_tag.name);
|
||||
|
||||
completions.push(lsp_types::CompletionItem {
|
||||
label: end_tag.name.to_string(),
|
||||
kind: Some(lsp_types::CompletionItemKind::KEYWORD),
|
||||
detail: Some(format!("End tag for {opener_name}")),
|
||||
text_edit: Some(tower_lsp_server::lsp_types::CompletionTextEdit::Edit(
|
||||
lsp_types::TextEdit::new(replacement_range, insert_text.clone()),
|
||||
)),
|
||||
insert_text_format: Some(lsp_types::InsertTextFormat::PLAIN_TEXT),
|
||||
filter_text: Some(end_tag.name.to_string()),
|
||||
sort_text: Some(format!("0_{}", end_tag.name.as_ref())), // Priority sort
|
||||
..Default::default()
|
||||
});
|
||||
// Add closing based on what's already present
|
||||
match closing {
|
||||
ClosingBrace::PartialClose | ClosingBrace::None => {
|
||||
insert_text.push_str(" %}");
|
||||
}
|
||||
ClosingBrace::FullClose => {} // No closing needed
|
||||
}
|
||||
|
||||
completions.push(lsp_types::CompletionItem {
|
||||
label: end_tag.name.to_string(),
|
||||
kind: Some(lsp_types::CompletionItemKind::KEYWORD),
|
||||
detail: Some(format!("End tag for {opener_name}")),
|
||||
text_edit: Some(tower_lsp_server::lsp_types::CompletionTextEdit::Edit(
|
||||
lsp_types::TextEdit::new(replacement_range, insert_text.clone()),
|
||||
)),
|
||||
insert_text_format: Some(lsp_types::InsertTextFormat::PLAIN_TEXT),
|
||||
filter_text: Some(end_tag.name.to_string()),
|
||||
sort_text: Some(format!("0_{}", end_tag.name.as_ref())), // Priority sort
|
||||
..Default::default()
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ pub fn django_available(db: &dyn ProjectDb, project: Project) -> bool {
|
|||
|
||||
/// Get the Django settings module name for the current project.
|
||||
///
|
||||
/// Returns the settings_module_override from project, or inspector result,
|
||||
/// or DJANGO_SETTINGS_MODULE env var, or attempts to detect it.
|
||||
/// Returns the `settings_module_override` from project, or inspector result,
|
||||
/// or `DJANGO_SETTINGS_MODULE` env var, or attempts to detect it.
|
||||
#[salsa::tracked]
|
||||
pub fn django_settings_module(db: &dyn ProjectDb, project: Project) -> Option<String> {
|
||||
// Check project override first
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ use crate::Project;
|
|||
/// Get template tags for the current project by querying the inspector.
|
||||
///
|
||||
/// This tracked function calls the inspector to retrieve Django template tags
|
||||
/// and parses the JSON response into a TemplateTags struct.
|
||||
/// and parses the JSON response into a `TemplateTags` struct.
|
||||
#[salsa::tracked]
|
||||
pub fn get_templatetags(db: &dyn ProjectDb, _project: Project) -> Option<TemplateTags> {
|
||||
let json_str = inspector_run(db, Query::Templatetags)?;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ pub enum Query {
|
|||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[allow(clippy::struct_field_names)]
|
||||
#[allow(dead_code)]
|
||||
pub struct PythonEnvironmentQueryData {
|
||||
pub sys_base_prefix: Utf8PathBuf,
|
||||
pub sys_executable: Utf8PathBuf,
|
||||
|
|
@ -24,6 +25,7 @@ pub struct PythonEnvironmentQueryData {
|
|||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
#[allow(dead_code)]
|
||||
pub enum VersionReleaseLevel {
|
||||
Alpha,
|
||||
Beta,
|
||||
|
|
@ -32,11 +34,13 @@ pub enum VersionReleaseLevel {
|
|||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[allow(dead_code)]
|
||||
pub struct TemplateTagQueryData {
|
||||
pub templatetags: Vec<TemplateTag>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[allow(dead_code)]
|
||||
pub struct TemplateTag {
|
||||
pub name: String,
|
||||
pub module: String,
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ impl fmt::Display for PythonEnvironment {
|
|||
///
|
||||
/// This Salsa tracked function discovers the Python environment based on:
|
||||
/// 1. Explicit venv path from project config
|
||||
/// 2. VIRTUAL_ENV environment variable
|
||||
/// 2. `VIRTUAL_ENV` environment variable
|
||||
/// 3. Common venv directories in project root (.venv, venv, env, .env)
|
||||
/// 4. System Python as fallback
|
||||
#[salsa::tracked]
|
||||
|
|
@ -607,7 +607,7 @@ mod tests {
|
|||
use super::*;
|
||||
use crate::inspector::pool::InspectorPool;
|
||||
|
||||
/// Test implementation of ProjectDb for unit tests
|
||||
/// Test implementation of `ProjectDb` for unit tests
|
||||
#[salsa::db]
|
||||
#[derive(Clone)]
|
||||
struct TestDatabase {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ use super::tree::BlockTree;
|
|||
// TODO: centralize salsa struct snapshots so this mess can be shared
|
||||
|
||||
#[derive(Serialize)]
|
||||
#[allow(dead_code)]
|
||||
pub struct BlockTreeSnapshot {
|
||||
roots: Vec<u32>,
|
||||
root_ids: Vec<u32>,
|
||||
|
|
@ -143,6 +144,7 @@ impl From<&BlockTree> for BlockTreeSnapshot {
|
|||
|
||||
#[derive(Serialize)]
|
||||
#[serde(tag = "kind")]
|
||||
#[allow(dead_code)]
|
||||
pub enum BlockSnapshot {
|
||||
Container {
|
||||
container_span: Span,
|
||||
|
|
@ -156,6 +158,7 @@ pub enum BlockSnapshot {
|
|||
|
||||
#[derive(Serialize)]
|
||||
#[serde(tag = "node")]
|
||||
#[allow(dead_code)]
|
||||
pub enum BlockNodeSnapshot {
|
||||
Branch {
|
||||
block_id: u32,
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ impl BlockTree {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn roots(&self) -> &Vec<BlockId> {
|
||||
&self.roots
|
||||
}
|
||||
|
|
@ -25,6 +26,7 @@ impl BlockTree {
|
|||
&mut self.roots
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn blocks(&self) -> &Blocks {
|
||||
&self.blocks
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ pub use templatetags::TagSpecs;
|
|||
|
||||
/// Validate a Django template node list and return validation errors.
|
||||
///
|
||||
/// This function runs the TagValidator on the parsed node list to check for:
|
||||
/// This function runs the `TagValidator` on the parsed node list to check for:
|
||||
/// - Unclosed block tags
|
||||
/// - Mismatched tag pairs
|
||||
/// - Orphaned intermediate tags
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
[toolchain]
|
||||
channel = "1.88"
|
||||
channel = "1.90"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue