дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-08 19:02:17 +02:00
fix: Satisfy clippy 1.99 lints
Box the unknown-host-key error variant (result_large_err), decode semantic tokens with as_chunks, and use `?` for the warning-prefix fallbacks. Claude-Session: https://claude.ai/code/session_01B65qLEKnkeYTGdbwhLpjCu
Цей коміт міститься в:
1 джерело
b16096acf5
коміт
3110de8803
4 files changed
+12
-17
No files matched your search
@@ -209,10 +209,9 @@ fn kotlin_location(s: &str, severity: Severity) -> Option<RawMessage> {
|
||||
fn kotlin_line(line: &str) -> Option<RawMessage> {
|
||||
let (severity, rest) = if let Some(r) = line.strip_prefix("e: ") {
|
||||
(Severity::Error, r)
|
||||
} else if let Some(r) = line.strip_prefix("w: ") {
|
||||
(Severity::Warning, r)
|
||||
} else {
|
||||
return None;
|
||||
let r = line.strip_prefix("w: ")?;
|
||||
(Severity::Warning, r)
|
||||
};
|
||||
kotlin_location(rest, severity)
|
||||
}
|
||||
@@ -226,10 +225,9 @@ fn javac_header(line: &str) -> Option<RawMessage> {
|
||||
let rest = rest.trim_start_matches(':').trim_start();
|
||||
let (severity, msg) = if let Some(m) = rest.strip_prefix("error:") {
|
||||
(Severity::Error, m)
|
||||
} else if let Some(m) = rest.strip_prefix("warning:") {
|
||||
(Severity::Warning, m)
|
||||
} else {
|
||||
return None;
|
||||
let m = rest.strip_prefix("warning:")?;
|
||||
(Severity::Warning, m)
|
||||
};
|
||||
Some(RawMessage::new(severity, msg.trim(), ColUnit::Char).at(path, ln, col))
|
||||
}
|
||||
@@ -238,10 +236,9 @@ fn javac_header(line: &str) -> Option<RawMessage> {
|
||||
fn maven_line(line: &str) -> Option<RawMessage> {
|
||||
let (severity, rest) = if let Some(r) = line.strip_prefix("[ERROR] ") {
|
||||
(Severity::Error, r)
|
||||
} else if let Some(r) = line.strip_prefix("[WARNING] ") {
|
||||
(Severity::Warning, r)
|
||||
} else {
|
||||
return None;
|
||||
let r = line.strip_prefix("[WARNING] ")?;
|
||||
(Severity::Warning, r)
|
||||
};
|
||||
let rest = rest.trim_start();
|
||||
if let Some((path, pos)) = rest.split_once(":[")
|
||||
@@ -276,10 +273,9 @@ fn tsc_line(line: &str) -> Option<RawMessage> {
|
||||
let rest = rest.trim_start();
|
||||
let (severity, rest) = if let Some(r) = rest.strip_prefix("error") {
|
||||
(Severity::Error, r)
|
||||
} else if let Some(r) = rest.strip_prefix("warning") {
|
||||
(Severity::Warning, r)
|
||||
} else {
|
||||
return None;
|
||||
let r = rest.strip_prefix("warning")?;
|
||||
(Severity::Warning, r)
|
||||
};
|
||||
let (code, msg) = match rest.trim_start().split_once(':') {
|
||||
Some((code, msg)) if code.starts_with("TS") => (Some(code.to_owned()), msg.trim()),
|
||||
|
||||
@@ -398,7 +398,7 @@ impl DbManager {
|
||||
Err(OpenError::Other(e)) => Err(e),
|
||||
Err(OpenError::UnknownHostKey(k)) => {
|
||||
let message = format!("Unknown SSH host key for {}:{} ({})", k.host, k.port, k.fingerprint());
|
||||
self.unknown_host_keys.lock().insert(source.id.clone(), k);
|
||||
self.unknown_host_keys.lock().insert(source.id.clone(), *k);
|
||||
Err(IdeError::new(ErrorKind::Protocol, message))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ impl UnknownHostKey {
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum OpenError {
|
||||
UnknownHostKey(UnknownHostKey),
|
||||
UnknownHostKey(Box<UnknownHostKey>),
|
||||
Other(IdeError),
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ where
|
||||
};
|
||||
result.map_err(|e| match issue.lock().take() {
|
||||
Some(HostKeyIssue::Unknown(key)) => {
|
||||
OpenError::UnknownHostKey(UnknownHostKey { host: hop.host.clone(), port: hop.port, key })
|
||||
OpenError::UnknownHostKey(Box::new(UnknownHostKey { host: hop.host.clone(), port: hop.port, key }))
|
||||
}
|
||||
Some(HostKeyIssue::Changed(line)) => OpenError::Other(IdeError::new(
|
||||
ErrorKind::PermissionDenied,
|
||||
|
||||
@@ -760,8 +760,7 @@ pub fn inlay_hint(conv: &Conv, path: &Path, h: lsp::InlayHint) -> InlayHint {
|
||||
pub fn decode_semantic_tokens(data: &[u32], enc: Encoding, text: Option<&DocText>) -> Vec<u32> {
|
||||
let mut out = Vec::with_capacity(data.len());
|
||||
let (mut line, mut start) = (0u32, 0u32);
|
||||
for chunk in data.chunks_exact(5) {
|
||||
let (dl, ds, len, ty, mods) = (chunk[0], chunk[1], chunk[2], chunk[3], chunk[4]);
|
||||
for &[dl, ds, len, ty, mods] in data.as_chunks::<5>().0 {
|
||||
if dl == 0 {
|
||||
start = start.saturating_add(ds);
|
||||
} else {
|
||||
|
||||
Reference in new issue
Заблокувати користувача