Skip to content

Commit

Permalink
Merge pull request #1157 from getong/fix-watchdog-error
Browse files Browse the repository at this point in the history
fix watchdog error
  • Loading branch information
manateelazycat authored Feb 8, 2025
2 parents 16c9054 + 6555f9b commit 27b9e0c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions core/lspserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import json
import os
import platform
import queue
import re
import subprocess
Expand All @@ -30,7 +31,10 @@
from sys import stderr
from typing import TYPE_CHECKING, Dict
from urllib.parse import urlparse
from watchdog.observers import Observer
if platform.system() == "Darwin" and platform.machine() == "arm64":
from watchdog.observers.kqueue import KqueueObserver
else:
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler

from core.handler import Handler
Expand Down Expand Up @@ -900,7 +904,10 @@ def handle_recv_message(self, message: dict):

def start_workspace_watch_files(self):
if self.workspace_file_watcher is None:
self.workspace_file_watcher = Observer()
if platform.system() == "Darwin" and platform.machine() == "arm64":
self.workspace_file_watcher = KqueueObserver()
else:
self.workspace_file_watcher = Observer()
self.workspace_file_watcher.start()

if self.workspace_file_watch_handler is None:
Expand Down

0 comments on commit 27b9e0c

Please sign in to comment.