From 3099c2a8f1d1b4d10e151405125e695b16c62e3a Mon Sep 17 00:00:00 2001 From: bagel897 Date: Wed, 10 Jan 2024 15:37:13 -0600 Subject: [PATCH] add preference --- pyproject.toml | 2 +- rope/base/prefs.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f35459cfd..66b2ab3dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ classifiers = [ 'Topic :: Software Development', ] version = '1.11.0' -dependencies = ['pytoolconfig[global] >= 1.2.2'] +dependencies = ['pytoolconfig[global] >= 1.3.0'] [[project.authors]] name = 'Ali Gholami Rudi' diff --git a/rope/base/prefs.py b/rope/base/prefs.py index ae35d7d68..314408fb1 100644 --- a/rope/base/prefs.py +++ b/rope/base/prefs.py @@ -2,6 +2,7 @@ # type: ignore """Rope preferences.""" from dataclasses import asdict, dataclass +from enum import Enum, unique from textwrap import dedent from typing import Any, Callable, Dict, List, Optional, Tuple @@ -10,7 +11,11 @@ from pytoolconfig.sources import Source from rope.base.resources import Folder - +@unique +class DocumentationMode(Enum): + DISABLED = False + ENABLED = True + LAZY = "lazy" @dataclass class AutoimportPrefs: @@ -18,6 +23,7 @@ class AutoimportPrefs: default=False, description="Cache underlined (private) modules") memory: bool = field(default=None, description="Cache in memory instead of disk") parallel: bool = field(default=True, description="Use multiple processes to parse") + documentation: DocumentationMode = field(default=DocumentationMode.DISABLED, description="Cache documentation") @dataclass