Skip to content

Commit 4993bf5

Browse files
committed
[IMP] server: update ruff python parser to 0.11.4
1 parent a32423d commit 4993bf5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

server/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ clap = { version = "4.5.4", features = ["derive"] }
1111
glob = "0.3.1"
1212
regex = "1.10.3"
1313
ropey = "1.6.1"
14-
ruff_python_ast = { git = "https://github.com/astral-sh/ruff", tag = "0.6.9", version = "0.0.0" }
15-
ruff_python_parser = { git = "https://github.com/astral-sh/ruff", tag = "0.6.9", version = "0.0.0" }
16-
ruff_text_size = { git = "https://github.com/astral-sh/ruff", tag = "0.6.9", version = "0.0.0" }
14+
ruff_python_ast = { git = "https://github.com/astral-sh/ruff", tag = "0.11.4", version = "0.0.0" }
15+
ruff_python_parser = { git = "https://github.com/astral-sh/ruff", tag = "0.11.4", version = "0.0.0" }
16+
ruff_text_size = { git = "https://github.com/astral-sh/ruff", tag = "0.11.4", version = "0.0.0" }
1717
lsp-server = { git = "https://github.com/rust-lang/rust-analyzer", tag = "2024-06-17", version = "0.7.6" }
1818
serde = "1.0.195"
1919
serde_json = "1.0.111"

server/src/core/file_mgr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use lsp_types::notification::{Notification, PublishDiagnostics};
22
use ropey::Rope;
33
use ruff_python_ast::Mod;
4-
use ruff_python_parser::{Mode, Parsed, Token, TokenKind};
4+
use ruff_python_parser::{Mode, ParseOptions, Parsed, Token, TokenKind};
55
use lsp_types::{Diagnostic, DiagnosticSeverity, MessageType, NumberOrString, Position, PublishDiagnosticsParams, Range, TextDocumentContentChangeEvent};
66
use tracing::{error, warn};
77
use std::collections::hash_map::DefaultHasher;
@@ -126,7 +126,7 @@ impl FileInfo {
126126
let mut diagnostics = vec![];
127127
let content = &self.text_rope.as_ref().unwrap().slice(..);
128128
let source = content.to_string(); //cast to string to get a version with all changes
129-
let ast = ruff_python_parser::parse_unchecked(source.as_str(), Mode::Module);
129+
let ast = ruff_python_parser::parse_unchecked(source.as_str(), ParseOptions::from(Mode::Module));
130130
if in_workspace {
131131
self.noqas_blocs.clear();
132132
self.noqas_lines.clear();

server/src/core/odoo.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use byteyarn::{yarn, Yarn};
1515
use lsp_server::ResponseError;
1616
use lsp_types::*;
1717
use request::{RegisterCapability, Request, WorkspaceConfiguration};
18-
use ruff_python_parser::Mode;
18+
use ruff_python_parser::{Mode, ParseOptions};
1919
use tracing::{debug, error, warn, info, trace};
2020

2121
use std::collections::HashSet;
@@ -1405,7 +1405,7 @@ impl Odoo {
14051405
};
14061406
let content = text_rope.slice(..);
14071407
let source = content.to_string(); //cast to string to get a version with all changes
1408-
let ast = ruff_python_parser::parse_unchecked(source.as_str(), Mode::Module);
1408+
let ast = ruff_python_parser::parse_unchecked(source.as_str(), ParseOptions::from(Mode::Module));
14091409
if ast.errors().is_empty() {
14101410
Odoo::update_file_index(session, path,true, false, false);
14111411
}

0 commit comments

Comments
 (0)