dissolve_python/types.rs
1// Copyright (C) 2024 Jelmer Vernooij <jelmer@samba.org>
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Common types used across the dissolve crate.
16
17use serde::{Deserialize, Serialize};
18
19/// Method to use for type introspection during replacement
20#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize)]
21pub enum TypeIntrospectionMethod {
22 /// Use pyright LSP for type inference
23 #[default]
24 PyrightLsp,
25 /// Use mypy daemon for type inference
26 MypyDaemon,
27 /// Try pyright first, fallback to mypy if it fails
28 PyrightWithMypyFallback,
29}
30
31/// Response from user during interactive mode
32#[derive(Debug, Clone, PartialEq, Eq)]
33pub enum UserResponse {
34 Yes,
35 No,
36 Always,
37 Never,
38 Quit,
39}