diff --git a/crates/biome_lsp/src/handlers/text_document.rs b/crates/biome_lsp/src/handlers/text_document.rs index 3d03fabb6830..a85facdd85ee 100644 --- a/crates/biome_lsp/src/handlers/text_document.rs +++ b/crates/biome_lsp/src/handlers/text_document.rs @@ -1,3 +1,5 @@ +use crate::utils::apply_document_changes; +use crate::{documents::Document, session::Session}; use anyhow::Result; use biome_service::workspace::{ ChangeFileParams, CloseFileParams, DocumentFileSource, GetFileContentParams, OpenFileParams, @@ -5,9 +7,6 @@ use biome_service::workspace::{ use tower_lsp::lsp_types; use tracing::{error, field}; -use crate::utils::apply_document_changes; -use crate::{documents::Document, session::Session}; - /// Handler for `textDocument/didOpen` LSP notification #[tracing::instrument( level = "debug", diff --git a/crates/biome_lsp/src/session.rs b/crates/biome_lsp/src/session.rs index 44ce8d84a0ef..a68b93dd6780 100644 --- a/crates/biome_lsp/src/session.rs +++ b/crates/biome_lsp/src/session.rs @@ -318,6 +318,16 @@ impl Session { path: biome_path.clone(), })?; + if !file_features.supports_lint() + && !file_features.supports_organize_imports() + && !file_features.supports_assists() + { + self.client + .publish_diagnostics(url, vec![], Some(doc.version)) + .await; + return Ok(()); + } + let diagnostics: Vec = { let mut categories = RuleCategoriesBuilder::default().with_syntax(); if self.configuration_status().is_loaded() {