Repository: astral-sh/ruff
File: crates/ty_server/src/session.rs (Rust)

Code before:
            let ClientOptions {
                global, workspace, ..
            } = self
                .initialization_options
                .options
                .clone()
                .combine(options.clone());

            let unknown_options = &options.unknown;
            if !unknown_options.is_empty() {
                // HACK: This is to ensure that users with an older version of the ty VS Code
                // extension don't get warnings about unknown options when they are using a newer
                // version of the language server. This should be removed after a few releases.
                if !unknown_options.contains_key("importStrategy")
                    && !unknown_options.contains_key("interpreter")
                {
                    tracing::warn!(
                        "Received unknown options for workspace `{url}`: {}",
                        serde_json::to_string_pretty(unknown_options)
                            .unwrap_or_else(|_| format!("{unknown_options:?}"))
                    );

                    client.show_warning_message(format!(
                        "Received unknown options for workspace `{url}`: '{}'. \
                        Refer to the logs for more details.",
                        unknown_options
                            .keys()
                            .map(String::as_str)
                            .collect::<Vec<_>>()
                            .join("', '")
                    ));
                }
            }

            combined_global_options.combine_with(Some(global));

            let workspace_settings = workspace.into_settings();
            let Some((root, workspace)) = self.workspaces.initialize(&url, workspace_settings)
            else {
                continue;
            };

            // For now, create one project database per workspace.
            // In the future, index the workspace directories to find all projects
            // and create a project database for each.
            let system = LSPSystem::new(
                self.index.as_ref().unwrap().clone(),
                self.native_system.clone(),
            );

            let project = ProjectMetadata::discover(&root, &system)

Review comment (suggestion):
I also removed the "Refer to the logs for more details" part from the message because I don't think it provides additional details as the unknown options are already visible in the message.

Code after:
            let ClientOptions {
                global, workspace, ..
            } = self
                .initialization_options
                .options
                .clone()
                .combine(options.clone());

            let unknown_options = &options.unknown;
            if !unknown_options.is_empty() {
                warn_about_unknown_options(client, Some(&url), unknown_options);
            }

            combined_global_options.combine_with(Some(global));

            let workspace_settings = workspace.into_settings();
            let Some((root, workspace)) = self.workspaces.initialize(&url, workspace_settings)
            else {
                continue;
            };

            // For now, create one project database per workspace.
            // In the future, index the workspace directories to find all projects
            // and create a project database for each.
            let system = LSPSystem::new(
                self.index.as_ref().unwrap().clone(),
                self.native_system.clone(),
            );

            let project = ProjectMetadata::discover(&root, &system)
                .context("Failed to discover project configuration")
                .and_then(|mut metadata| {
                    metadata
                        .apply_configuration_files(&system)
                        .context("Failed to apply configuration files")?;

                    if let Some(overrides) = workspace.settings.project_options_overrides() {
                        metadata.apply_overrides(overrides);
                    }

                    ProjectDatabase::new(metadata, system.clone())
                });

            let (root, db) = match project {
                Ok(db) => (root, db),
                Err(err) => {
                    tracing::error!(
                        "Failed to create project for `{root}`: {err:#}. \
                        Falling back to default settings"
                    );