Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/src/browser/browser_model.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// The persistence snapshot + tab-strip scaffolding compile on wasm
// (they're plain serde types) but no caller exercises them there.
#![cfg_attr(target_family = "wasm", allow(dead_code))]

pub const DEFAULT_BROWSER_URL: &str = "about:home";

use serde::{Deserialize, Serialize};
Expand Down
5 changes: 5 additions & 0 deletions app/src/browser/browser_view.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// BrowserView is a non-wasm-only render surface; many of its helpers
// (persistence import, internal model accessor) compile on wasm but
// the WKWebView-driven code paths that consume them don't.
#![cfg_attr(target_family = "wasm", allow(dead_code, unused_imports))]

use std::collections::HashMap;
use std::{cell::RefCell, rc::Rc};

Expand Down
5 changes: 5 additions & 0 deletions app/src/browser/find.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Find scripts only run from the native (non-wasm) wry webview host;
// on wasm the JS strings + helper functions exist in tree but are
// unreachable. Allow dead_code on wasm builds only.
#![cfg_attr(target_family = "wasm", allow(dead_code))]

//! Find-in-page overlay model + injected JS glue.
//!
//! The overlay is a thin row that renders below the toolbar when active.
Expand Down
4 changes: 4 additions & 0 deletions app/src/browser/persistence.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Persistence is only invoked from the native (non-wasm) browser pane
// path. On wasm the helpers exist but are never called.
#![cfg_attr(target_family = "wasm", allow(dead_code))]

//! Persistence of `BrowserState` to a JSON file under the CastCodes
//! support directory. Atomic write via temp-file + rename. Load is
//! lenient: any failure (missing file, malformed JSON, unknown version)
Expand Down
4 changes: 4 additions & 0 deletions app/src/browser/webview_host.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// wry's WKWebView wrapper has no wasm backend; the struct + methods
// compile on wasm but never get invoked.
#![cfg_attr(target_family = "wasm", allow(dead_code))]

#[cfg(target_os = "macos")]
use std::{ffi::c_void, ptr::NonNull};

Expand Down
10 changes: 6 additions & 4 deletions app/src/settings_view/import_theme_modal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ use std::time::Duration;
use crate::appearance::Appearance;
use crate::editor::{EditorView, Event as EditorEvent, SingleLineEditorOptions};
use crate::modal::Modal;
use crate::themes::theme::{CustomTheme, ThemeKind};
use crate::themes::tweakcn_import::{
extract_theme_id, fetch_share_url, write_imported, GamutPolicy, ImportError, ParsedBlocks,
};
#[cfg(feature = "local_fs")]
use crate::themes::theme::CustomTheme;
use crate::themes::theme::ThemeKind;
use crate::themes::tweakcn_import::{extract_theme_id, fetch_share_url, ImportError, ParsedBlocks};
#[cfg(feature = "local_fs")]
use crate::themes::tweakcn_import::{write_imported, GamutPolicy};
#[cfg(feature = "local_fs")]
use crate::user_config;
use warpui::elements::{
Expand Down
1 change: 1 addition & 0 deletions app/src/terminal/view/tab_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ impl GitLabel {
/// `git_dir` is the per-worktree gitdir (e.g. `/repo/.git/worktrees/feature-a`).
/// `common_dir` is the shared gitdir (e.g. `/repo/.git`).
/// When they're equal, the CWD is in the main worktree.
#[cfg(any(feature = "local_fs", test))]
fn compute_git_label_from_paths(
cwd: &std::path::Path,
branch: Option<String>,
Expand Down
4 changes: 3 additions & 1 deletion crates/lsp/src/model.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#[cfg(not(target_arch = "wasm32"))]
use crate::supported_servers::LspStartupError;
use crate::{
config::{lsp_uri_to_path, LanguageId},
server_repo_watcher::LspRepoWatcher,
supported_servers::{LSPServerType, LspStartupError, LspStartupFailureReason},
supported_servers::{LSPServerType, LspStartupFailureReason},
types::{
DefinitionLocation, DocumentVersion, HoverResult, Location, ReferenceLocation,
TextDocumentContentChangeEvent, TextEdit, WatchedFileChangeEvent,
Expand Down
3 changes: 3 additions & 0 deletions crates/lsp/src/supported_servers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ pub struct LspStartupError {
}

impl LspStartupError {
// Only constructed by the non-wasm `LspServerModel::start` path; gate
// to match so wasm clippy doesn't flag the constructor as dead code.
#[cfg(not(target_arch = "wasm32"))]
pub(crate) fn missing_binary(server_type: LSPServerType) -> Self {
Self {
reason: LspStartupFailureReason::MissingBinary { server_type },
Expand Down
4 changes: 3 additions & 1 deletion crates/warp_cli/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#![cfg_attr(target_family = "wasm", allow(dead_code))]

use std::{env, ffi::OsString, fmt, path::Path};
#[cfg(not(target_family = "wasm"))]
use std::ffi::OsString;
use std::{env, fmt, path::Path};

use clap::{CommandFactory, Parser, Subcommand, ValueEnum};
use url::Url;
Expand Down
Loading