diff --git a/server/Cargo.toml b/server/Cargo.toml index 6a54a03a..59e5764d 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -2,6 +2,10 @@ name = "odoo_ls_server" version = "0.4.1" edition = "2021" +authors = ["Odoo"] +readme = "../README.md" +repository = "https://github.com/odoo/odoo-ls" +license = "../LICENSE" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -11,9 +15,9 @@ clap = { version = "4.5.4", features = ["derive"] } glob = "0.3.1" regex = "1.10.3" ropey = "1.6.1" -ruff_python_ast = { git = "https://github.com/astral-sh/ruff", tag = "0.6.9", version = "0.0.0" } -ruff_python_parser = { git = "https://github.com/astral-sh/ruff", tag = "0.6.9", version = "0.0.0" } -ruff_text_size = { git = "https://github.com/astral-sh/ruff", tag = "0.6.9", version = "0.0.0" } +ruff_python_ast = { git = "https://github.com/astral-sh/ruff", tag = "0.11.4", version = "0.0.0" } +ruff_python_parser = { git = "https://github.com/astral-sh/ruff", tag = "0.11.4", version = "0.0.0" } +ruff_text_size = { git = "https://github.com/astral-sh/ruff", tag = "0.11.4", version = "0.0.0" } lsp-server = { git = "https://github.com/rust-lang/rust-analyzer", tag = "2024-06-17", version = "0.7.6" } serde = "1.0.195" serde_json = "1.0.111" diff --git a/server/src/core/file_mgr.rs b/server/src/core/file_mgr.rs index 766731fe..f3615019 100644 --- a/server/src/core/file_mgr.rs +++ b/server/src/core/file_mgr.rs @@ -1,7 +1,7 @@ use lsp_types::notification::{Notification, PublishDiagnostics}; use ropey::Rope; use ruff_python_ast::Mod; -use ruff_python_parser::{Mode, Parsed, Token, TokenKind}; +use ruff_python_parser::{Mode, ParseOptions, Parsed, Token, TokenKind}; use lsp_types::{Diagnostic, DiagnosticSeverity, MessageType, NumberOrString, Position, PublishDiagnosticsParams, Range, TextDocumentContentChangeEvent}; use tracing::{error, warn}; use std::collections::hash_map::DefaultHasher; @@ -126,7 +126,7 @@ impl FileInfo { let mut diagnostics = vec![]; let content = &self.text_rope.as_ref().unwrap().slice(..); let source = content.to_string(); //cast to string to get a version with all changes - let ast = ruff_python_parser::parse_unchecked(source.as_str(), Mode::Module); + let ast = ruff_python_parser::parse_unchecked(source.as_str(), ParseOptions::from(Mode::Module)); if in_workspace { self.noqas_blocs.clear(); self.noqas_lines.clear(); diff --git a/server/src/core/odoo.rs b/server/src/core/odoo.rs index 14de60d0..8b60bd21 100644 --- a/server/src/core/odoo.rs +++ b/server/src/core/odoo.rs @@ -15,7 +15,7 @@ use byteyarn::{yarn, Yarn}; use lsp_server::ResponseError; use lsp_types::*; use request::{RegisterCapability, Request, WorkspaceConfiguration}; -use ruff_python_parser::Mode; +use ruff_python_parser::{Mode, ParseOptions}; use tracing::{debug, error, warn, info, trace}; use std::collections::HashSet; @@ -1405,7 +1405,7 @@ impl Odoo { }; let content = text_rope.slice(..); let source = content.to_string(); //cast to string to get a version with all changes - let ast = ruff_python_parser::parse_unchecked(source.as_str(), Mode::Module); + let ast = ruff_python_parser::parse_unchecked(source.as_str(), ParseOptions::from(Mode::Module)); if ast.errors().is_empty() { Odoo::update_file_index(session, path,true, false, false); }