Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for memory limit for MacOS #22

Merged
merged 2 commits into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions coq/lsp/client.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import time
import subprocess
from lsp.json_rpc_endpoint import JsonRpcEndpoint
Expand Down Expand Up @@ -38,7 +39,7 @@ def __init__(
timeout (int, optional): Timeout used for the coq-lsp operations.
Defaults to 2.
memory_limit (int, optional): RAM limit for the coq-lsp process
in kbytes. Defaults to 2097152.
in kbytes. It only works for Linux systems. Defaults to 2097152.
coq_lsp(str, optional): Path to the coq-lsp binary. Defaults to "coq-lsp".
init_options (Dict, optional): Initialization options for coq-lsp server.
Available options are:
Expand All @@ -57,8 +58,14 @@ def __init__(
Defaults to 1.
"""
self.file_progress: Dict[str, List[CoqFileProgressParams]] = {}

if sys.platform.startswith("linux"):
command = f"ulimit -v {memory_limit}; {coq_lsp}"
else:
command = coq_lsp

proc = subprocess.Popen(
f"ulimit -v {memory_limit}; {coq_lsp}",
command,
stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
shell=True,
Expand Down