lints: A bunch of extra style lint fixes (#36568)
- **lints: Fix 'doc_lazy_continuation'** - **lints: Fix 'doc_overindented_list_items'** - **inherent_to_string and io_other_error** - **Some more lint fixes** - **lints: enable bool_assert_comparison, match_like_matches_macro and wrong_self_convention** Release Notes: - N/A
This commit is contained in:
parent
a32a264508
commit
cf7c64d77f
92 changed files with 277 additions and 345 deletions
|
@ -6,9 +6,9 @@
|
|||
//!
|
||||
//! There are few reasons for this divide:
|
||||
//! - Breakpoints persist across debug sessions and they're not really specific to any particular session. Sure, we have to send protocol messages for them
|
||||
//! (so they're a "thing" in the protocol), but we also want to set them before any session starts up.
|
||||
//! (so they're a "thing" in the protocol), but we also want to set them before any session starts up.
|
||||
//! - Debug clients are doing the heavy lifting, and this is where UI grabs all of it's data from. They also rely on breakpoint store during initialization to obtain
|
||||
//! current set of breakpoints.
|
||||
//! current set of breakpoints.
|
||||
//! - Since DAP store knows about all of the available debug sessions, it is responsible for routing RPC requests to sessions. It also knows how to find adapters for particular kind of session.
|
||||
|
||||
pub mod breakpoint_store;
|
||||
|
|
|
@ -904,7 +904,7 @@ impl BreakpointState {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn to_int(&self) -> i32 {
|
||||
pub fn to_int(self) -> i32 {
|
||||
match self {
|
||||
BreakpointState::Enabled => 0,
|
||||
BreakpointState::Disabled => 1,
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
//! Each byte in memory can either be mapped or unmapped. We try to mimic that twofold:
|
||||
//! - We assume that the memory is divided into pages of a fixed size.
|
||||
//! - We assume that each page can be either mapped or unmapped.
|
||||
//!
|
||||
//! These two assumptions drive the shape of the memory representation.
|
||||
//! In particular, we want the unmapped pages to be represented without allocating any memory, as *most*
|
||||
//! of the memory in a program space is usually unmapped.
|
||||
|
@ -165,8 +166,8 @@ impl Memory {
|
|||
/// - If it succeeds/fails wholesale, cool; we have no unknown memory regions in this page.
|
||||
/// - If it succeeds partially, we know # of mapped bytes.
|
||||
/// We might also know the # of unmapped bytes.
|
||||
/// However, we're still unsure about what's *after* the unreadable region.
|
||||
///
|
||||
/// However, we're still unsure about what's *after* the unreadable region.
|
||||
/// This is where this builder comes in. It lets us track the state of figuring out contents of a single page.
|
||||
pub(super) struct MemoryPageBuilder {
|
||||
chunks: MappedPageContents,
|
||||
|
|
|
@ -653,7 +653,7 @@ mod tests {
|
|||
|
||||
cx.run_until_parked();
|
||||
conflict_set.update(cx, |conflict_set, _| {
|
||||
assert_eq!(conflict_set.has_conflict, false);
|
||||
assert!(!conflict_set.has_conflict);
|
||||
assert_eq!(conflict_set.snapshot.conflicts.len(), 0);
|
||||
});
|
||||
|
||||
|
|
|
@ -199,7 +199,7 @@ pub struct GitEntryRef<'a> {
|
|||
}
|
||||
|
||||
impl GitEntryRef<'_> {
|
||||
pub fn to_owned(&self) -> GitEntry {
|
||||
pub fn to_owned(self) -> GitEntry {
|
||||
GitEntry {
|
||||
entry: self.entry.clone(),
|
||||
git_summary: self.git_summary,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
//! This module is split up into three distinct parts:
|
||||
//! - [`LocalLspStore`], which is ran on the host machine (either project host or SSH host), that manages the lifecycle of language servers.
|
||||
//! - [`RemoteLspStore`], which is ran on the remote machine (project guests) which is mostly about passing through the requests via RPC.
|
||||
//! The remote stores don't really care about which language server they're running against - they don't usually get to decide which language server is going to responsible for handling their request.
|
||||
//! The remote stores don't really care about which language server they're running against - they don't usually get to decide which language server is going to responsible for handling their request.
|
||||
//! - [`LspStore`], which unifies the two under one consistent interface for interacting with language servers.
|
||||
//!
|
||||
//! Most of the interesting work happens at the local layer, as bulk of the complexity is with managing the lifecycle of language servers. The actual implementation of the LSP protocol is handled by [`lsp`] crate.
|
||||
|
@ -12691,7 +12691,7 @@ impl DiagnosticSummary {
|
|||
}
|
||||
|
||||
pub fn to_proto(
|
||||
&self,
|
||||
self,
|
||||
language_server_id: LanguageServerId,
|
||||
path: &Path,
|
||||
) -> proto::DiagnosticSummary {
|
||||
|
|
|
@ -22,9 +22,9 @@ pub(super) struct RootPathTrie<Label> {
|
|||
/// Label presence is a marker that allows to optimize searches within [RootPathTrie]; node label can be:
|
||||
/// - Present; we know there's definitely a project root at this node.
|
||||
/// - Known Absent - we know there's definitely no project root at this node and none of it's ancestors are Present (descendants can be present though!).
|
||||
/// The distinction is there to optimize searching; when we encounter a node with unknown status, we don't need to look at it's full path
|
||||
/// to the root of the worktree; it's sufficient to explore only the path between last node with a KnownAbsent state and the directory of a path, since we run searches
|
||||
/// from the leaf up to the root of the worktree.
|
||||
/// The distinction is there to optimize searching; when we encounter a node with unknown status, we don't need to look at it's full path
|
||||
/// to the root of the worktree; it's sufficient to explore only the path between last node with a KnownAbsent state and the directory of a path, since we run searches
|
||||
/// from the leaf up to the root of the worktree.
|
||||
///
|
||||
/// In practical terms, it means that by storing label presence we don't need to do a project discovery on a given folder more than once
|
||||
/// (unless the node is invalidated, which can happen when FS entries are renamed/removed).
|
||||
|
|
|
@ -4329,7 +4329,7 @@ impl Project {
|
|||
/// # Arguments
|
||||
///
|
||||
/// * `path` - A full path that starts with a worktree root name, or alternatively a
|
||||
/// relative path within a visible worktree.
|
||||
/// relative path within a visible worktree.
|
||||
/// * `cx` - A reference to the `AppContext`.
|
||||
///
|
||||
/// # Returns
|
||||
|
@ -5508,7 +5508,7 @@ mod disable_ai_settings_tests {
|
|||
project: &[],
|
||||
};
|
||||
let settings = DisableAiSettings::load(sources, cx).unwrap();
|
||||
assert_eq!(settings.disable_ai, false, "Default should allow AI");
|
||||
assert!(!settings.disable_ai, "Default should allow AI");
|
||||
|
||||
// Test 2: Global true, local false -> still disabled (local cannot re-enable)
|
||||
let global_true = Some(true);
|
||||
|
@ -5525,8 +5525,8 @@ mod disable_ai_settings_tests {
|
|||
project: &[&local_false],
|
||||
};
|
||||
let settings = DisableAiSettings::load(sources, cx).unwrap();
|
||||
assert_eq!(
|
||||
settings.disable_ai, true,
|
||||
assert!(
|
||||
settings.disable_ai,
|
||||
"Local false cannot override global true"
|
||||
);
|
||||
|
||||
|
@ -5545,10 +5545,7 @@ mod disable_ai_settings_tests {
|
|||
project: &[&local_true],
|
||||
};
|
||||
let settings = DisableAiSettings::load(sources, cx).unwrap();
|
||||
assert_eq!(
|
||||
settings.disable_ai, true,
|
||||
"Local true can override global false"
|
||||
);
|
||||
assert!(settings.disable_ai, "Local true can override global false");
|
||||
|
||||
// Test 4: Server can only make more restrictive (set to true)
|
||||
let user_false = Some(false);
|
||||
|
@ -5565,8 +5562,8 @@ mod disable_ai_settings_tests {
|
|||
project: &[],
|
||||
};
|
||||
let settings = DisableAiSettings::load(sources, cx).unwrap();
|
||||
assert_eq!(
|
||||
settings.disable_ai, true,
|
||||
assert!(
|
||||
settings.disable_ai,
|
||||
"Server can set to true even if user is false"
|
||||
);
|
||||
|
||||
|
@ -5585,8 +5582,8 @@ mod disable_ai_settings_tests {
|
|||
project: &[],
|
||||
};
|
||||
let settings = DisableAiSettings::load(sources, cx).unwrap();
|
||||
assert_eq!(
|
||||
settings.disable_ai, true,
|
||||
assert!(
|
||||
settings.disable_ai,
|
||||
"Server false cannot override user true"
|
||||
);
|
||||
|
||||
|
@ -5607,10 +5604,7 @@ mod disable_ai_settings_tests {
|
|||
project: &[&local_false3, &local_true2, &local_false4],
|
||||
};
|
||||
let settings = DisableAiSettings::load(sources, cx).unwrap();
|
||||
assert_eq!(
|
||||
settings.disable_ai, true,
|
||||
"Any local true should disable AI"
|
||||
);
|
||||
assert!(settings.disable_ai, "Any local true should disable AI");
|
||||
|
||||
// Test 7: All three sources can independently disable AI
|
||||
let user_false2 = Some(false);
|
||||
|
@ -5628,8 +5622,8 @@ mod disable_ai_settings_tests {
|
|||
project: &[&local_true3],
|
||||
};
|
||||
let settings = DisableAiSettings::load(sources, cx).unwrap();
|
||||
assert_eq!(
|
||||
settings.disable_ai, true,
|
||||
assert!(
|
||||
settings.disable_ai,
|
||||
"Local can disable even if user and server are false"
|
||||
);
|
||||
});
|
||||
|
|
|
@ -4123,7 +4123,7 @@ async fn test_buffer_identity_across_renames(cx: &mut gpui::TestAppContext) {
|
|||
})
|
||||
.unwrap()
|
||||
.await
|
||||
.to_included()
|
||||
.into_included()
|
||||
.unwrap();
|
||||
cx.executor().run_until_parked();
|
||||
|
||||
|
@ -5918,7 +5918,7 @@ async fn test_create_entry(cx: &mut gpui::TestAppContext) {
|
|||
})
|
||||
.await
|
||||
.unwrap()
|
||||
.to_included()
|
||||
.into_included()
|
||||
.unwrap();
|
||||
|
||||
// Can't create paths outside the project
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue