mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-24 08:03:19 +00:00
chore: remove unreferenced Rust items (#5493)
Removes ten `pub` Rust items that nothing references: not in production code, tests, benches, macros, strings, docs or `cfg`-gated code. They only widen public APIs and have to be kept up to date. No user-visible change. Removed: `ExtensionRegistry::point_ids`, `Project::with_backend`, `diagnostics_store::RecordSinkFactory`, `ide_android::platform_tools_dir`, `ide_db::sql::ORACLE_SYSTEM_SCHEMAS`, `ide_run::go::package_sources`, `ide_build::maven::ALL_PHASES`, and `has_providers` / `has_views` / `has_hover_actions` on the plugin runtime. Two knock-on cleanups: the `PathBuf` import in `go.rs` became unused (removed), and the doc comment of `package_sources` (about Go's own build-file selection and `-find`) moved onto `package_info`, which it also describes. Co-authored-by: Mr0Bread <55754540+Mr0Bread@users.noreply.github.com>
This commit is contained in:
@@ -91,12 +91,6 @@ fn executable() -> IdeResult<PathBuf> {
|
||||
})
|
||||
}
|
||||
|
||||
/// The directory holding adb, for command lines that expect `adb` on `PATH`.
|
||||
pub fn platform_tools_dir() -> Option<&'static Path> {
|
||||
static DIR: OnceLock<Option<PathBuf>> = OnceLock::new();
|
||||
DIR.get_or_init(|| adb_executable().as_deref().and_then(Path::parent).map(Path::to_path_buf)).as_deref()
|
||||
}
|
||||
|
||||
/// Connected devices, online ones first; starting the adb daemon when needed.
|
||||
pub fn devices() -> IdeResult<Vec<AndroidDevice>> {
|
||||
let adb = executable()?;
|
||||
|
||||
@@ -31,40 +31,6 @@ pub const LOCAL_REPO_TRACKING_ARG: &str = "-Daether.enhancedLocalRepository.trac
|
||||
pub const LIFECYCLE: &[&str] =
|
||||
&["clean", "validate", "compile", "test", "package", "verify", "install", "site", "deploy"];
|
||||
|
||||
/// Every phase of the clean, default and site lifecycles (Execute Maven Goal completion).
|
||||
pub const ALL_PHASES: &[&str] = &[
|
||||
"pre-clean",
|
||||
"clean",
|
||||
"post-clean",
|
||||
"validate",
|
||||
"initialize",
|
||||
"generate-sources",
|
||||
"process-sources",
|
||||
"generate-resources",
|
||||
"process-resources",
|
||||
"compile",
|
||||
"process-classes",
|
||||
"generate-test-sources",
|
||||
"process-test-sources",
|
||||
"generate-test-resources",
|
||||
"process-test-resources",
|
||||
"test-compile",
|
||||
"process-test-classes",
|
||||
"test",
|
||||
"prepare-package",
|
||||
"package",
|
||||
"pre-integration-test",
|
||||
"integration-test",
|
||||
"post-integration-test",
|
||||
"verify",
|
||||
"install",
|
||||
"deploy",
|
||||
"pre-site",
|
||||
"site",
|
||||
"post-site",
|
||||
"site-deploy",
|
||||
];
|
||||
|
||||
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Type)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct MavenModel {
|
||||
|
||||
@@ -46,23 +46,6 @@ pub fn databases(templates: bool) -> &'static str {
|
||||
/// Databases of managed services that their users cannot use (hidden unless connected to).
|
||||
pub const INTERNAL_DATABASES: &[&str] = &["rdsadmin", "azure_maintenance", "azure_sys", "cloudsqladmin"];
|
||||
|
||||
/// Oracle system accounts hidden unless `show_system` (see the Schemas tab).
|
||||
pub const ORACLE_SYSTEM_SCHEMAS: &[&str] = &[
|
||||
"CTXSYS",
|
||||
"DBSFWUSER",
|
||||
"DVSYS",
|
||||
"GSMADMIN_INTERNAL",
|
||||
"LBACSYS",
|
||||
"MDDATA",
|
||||
"MDSYS",
|
||||
"OLAPSYS",
|
||||
"OUTLN",
|
||||
"SYS",
|
||||
"SYSTEM",
|
||||
"XDB",
|
||||
"XS$NULL",
|
||||
];
|
||||
|
||||
/// Databases available to this login; offline/restoring databases cannot be selected.
|
||||
pub fn sqlserver_databases() -> &'static str {
|
||||
"SELECT name FROM sys.databases WHERE state = 0 AND HAS_DBACCESS(name) = 1 ORDER BY name"
|
||||
|
||||
@@ -116,10 +116,6 @@ impl ExtensionRegistry {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn point_ids(&self) -> Vec<&'static str> {
|
||||
self.points.read().keys().copied().collect()
|
||||
}
|
||||
|
||||
pub fn placement(&self, point: &str) -> Option<Placement> {
|
||||
self.points.read().get(point).map(|p| p.placement())
|
||||
}
|
||||
|
||||
@@ -66,9 +66,6 @@ impl EventSink for RecordingSink {
|
||||
}
|
||||
}
|
||||
|
||||
/// A sink whose diagnostics are recorded; the store outlives every project.
|
||||
pub type RecordSinkFactory = Box<dyn Fn(&str) -> SharedSink + Send + Sync>;
|
||||
|
||||
/// Wraps a sink factory so every sink it creates records diagnostics.
|
||||
pub fn recording_sink_factory(store: Arc<DiagnosticsStore>, inner: crate::SinkFactory) -> crate::SinkFactory {
|
||||
Box::new(move |window| {
|
||||
|
||||
@@ -1204,11 +1204,6 @@ impl Project {
|
||||
self.with_log_repo_of(path, |r| f(r as &dyn Backend))
|
||||
}
|
||||
|
||||
/// `with_repo` through the backend-agnostic Changes-view surface.
|
||||
pub fn with_backend<T>(&self, f: impl FnOnce(&dyn Backend) -> IdeResult<T>) -> IdeResult<T> {
|
||||
self.with_backend_at(None, f)
|
||||
}
|
||||
|
||||
/// `with_repo_recorded` through the backend-agnostic Changes-view surface.
|
||||
pub fn with_backend_recorded<T>(
|
||||
&self,
|
||||
|
||||
@@ -1574,11 +1574,6 @@ impl Runtime {
|
||||
})
|
||||
}
|
||||
|
||||
/// The component exports `providers`.
|
||||
pub fn has_providers(&self) -> bool {
|
||||
self.exports.providers.is_some()
|
||||
}
|
||||
|
||||
fn provider_call<R>(
|
||||
&mut self,
|
||||
timeout: Duration,
|
||||
@@ -1865,11 +1860,6 @@ impl Runtime {
|
||||
result.map_err(|e| CallError::Guest(e.into()))
|
||||
}
|
||||
|
||||
/// The component exports `view-provider`.
|
||||
pub fn has_views(&self) -> bool {
|
||||
self.exports.views.is_some()
|
||||
}
|
||||
|
||||
/// Content of a view or custom editor (`invocation.editor`: its document).
|
||||
pub fn render_view(
|
||||
&mut self,
|
||||
@@ -2906,9 +2896,6 @@ impl Runtime {
|
||||
let result = self.language_feature_call(timeout, |p, s| p.call_gutter_actions(s, &d))?;
|
||||
Ok(result.into_iter().take(10000).map(gutter_action_from).collect())
|
||||
}
|
||||
pub fn has_hover_actions(&self) -> bool {
|
||||
self.exports.hover_actions.is_some()
|
||||
}
|
||||
|
||||
pub fn language_hover_actions(
|
||||
&mut self,
|
||||
|
||||
@@ -3,7 +3,7 @@ use crate::RunConfig;
|
||||
use ide_core::{IdeError, IdeResult};
|
||||
use std::collections::HashSet;
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::path::Path;
|
||||
use std::process::{Command, Stdio};
|
||||
use std::sync::OnceLock;
|
||||
use std::time::{Duration, Instant};
|
||||
@@ -97,16 +97,6 @@ pub fn plan(root: &Path, config: &RunConfig) -> IdeResult<Option<Plan>> {
|
||||
|
||||
/// Uses Go's own build-file selection, including platform suffixes, cgo and build tags.
|
||||
/// `-find` avoids dependency traversal and package downloads for this local directory.
|
||||
pub fn package_sources(command: Command, dir: &Path, flags: &[String]) -> IdeResult<Vec<PathBuf>> {
|
||||
let package = package_info(command, dir, flags)?;
|
||||
Ok(["GoFiles", "CgoFiles"]
|
||||
.iter()
|
||||
.flat_map(|key| package[key].as_array().into_iter().flatten())
|
||||
.filter_map(|p| p.as_str())
|
||||
.map(|p| dir.join(p))
|
||||
.collect())
|
||||
}
|
||||
|
||||
fn package_info(mut command: Command, dir: &Path, flags: &[String]) -> IdeResult<serde_json::Value> {
|
||||
command.args(["list", "-find", "-e", "-json"]);
|
||||
let mut it = flags.iter();
|
||||
|
||||
Reference in New Issue
Block a user