Returns true if any LSP clients are currently registered. Mirrors the TS `LSP.hasClients(file)` which checks whether any server could handle the given file. Here we check if any registered client's id contains the detected language for the file.
(&self, path: &Path)
| 834 | /// could handle the given file. Here we check if any registered client's |
| 835 | /// id contains the detected language for the file. |
| 836 | pub async fn has_clients(&self, path: &Path) -> bool { |
| 837 | let clients = self.clients.read().await; |
| 838 | if clients.is_empty() { |
| 839 | return false; |
| 840 | } |
| 841 | let language = detect_language(path); |
| 842 | clients.keys().any(|id| id.contains(language)) |
| 843 | } |
| 844 | |
| 845 | /// Opens or refreshes a file in all matching LSP clients. |
| 846 | /// Mirrors the TS `LSP.touchFile(input, waitForDiagnostics)`. |
no test coverage detected