|
1 | | -#[cfg(test)] |
2 | | -mod tests { |
3 | | - use crate::handlers::test_lib::{ProviderVirtualWorkspace, VirtualCodeAction, check}; |
4 | | - use googletest::prelude::*; |
5 | | - use xmake_code_analysis::{DiagnosticCode, Emmyrc}; |
| 1 | +// #[cfg(test)] |
| 2 | +// mod tests { |
| 3 | +// use crate::handlers::test_lib::{ProviderVirtualWorkspace, VirtualCodeAction, check}; |
| 4 | +// use googletest::prelude::*; |
| 5 | +// use xmake_code_analysis::{DiagnosticCode, Emmyrc}; |
6 | 6 |
|
7 | | - #[gtest] |
8 | | - fn test_1() -> Result<()> { |
9 | | - let mut ws = ProviderVirtualWorkspace::new(); |
10 | | - ws.def( |
11 | | - r#" |
12 | | - ---@class Cast1 |
13 | | - ---@field get fun(self: self, a: number): Cast1? |
14 | | - "#, |
15 | | - ); |
| 7 | +// #[gtest] |
| 8 | +// fn test_1() -> Result<()> { |
| 9 | +// let mut ws = ProviderVirtualWorkspace::new(); |
| 10 | +// ws.def( |
| 11 | +// r#" |
| 12 | +// ---@class Cast1 |
| 13 | +// ---@field get fun(self: self, a: number): Cast1? |
| 14 | +// "#, |
| 15 | +// ); |
16 | 16 |
|
17 | | - check!(ws.check_code_action( |
18 | | - r#" |
19 | | - ---@type Cast1 |
20 | | - local A |
| 17 | +// check!(ws.check_code_action( |
| 18 | +// r#" |
| 19 | +// ---@type Cast1 |
| 20 | +// local A |
21 | 21 |
|
22 | | - local _a = A:get(1):get(2):get(3) |
23 | | - "#, |
24 | | - vec![ |
25 | | - VirtualCodeAction { |
26 | | - title: "use cast to remove nil".to_string() |
27 | | - }, |
28 | | - VirtualCodeAction { |
29 | | - title: "Disable current line diagnostic (need-check-nil)".to_string() |
30 | | - }, |
31 | | - VirtualCodeAction { |
32 | | - title: "Disable all diagnostics in current file (need-check-nil)".to_string() |
33 | | - }, |
34 | | - VirtualCodeAction { |
35 | | - title: |
36 | | - "Disable all diagnostics in current project (need-check-nil)".to_string() |
37 | | - }, |
38 | | - VirtualCodeAction { |
39 | | - title: "use cast to remove nil".to_string() |
40 | | - }, |
41 | | - VirtualCodeAction { |
42 | | - title: "Disable current line diagnostic (need-check-nil)".to_string() |
43 | | - }, |
44 | | - VirtualCodeAction { |
45 | | - title: "Disable all diagnostics in current file (need-check-nil)".to_string() |
46 | | - }, |
47 | | - VirtualCodeAction { |
48 | | - title: |
49 | | - "Disable all diagnostics in current project (need-check-nil)".to_string() |
50 | | - }, |
51 | | - ] |
52 | | - )); |
| 22 | +// local _a = A:get(1):get(2):get(3) |
| 23 | +// "#, |
| 24 | +// vec![ |
| 25 | +// VirtualCodeAction { |
| 26 | +// title: "use cast to remove nil".to_string() |
| 27 | +// }, |
| 28 | +// VirtualCodeAction { |
| 29 | +// title: "Disable current line diagnostic (need-check-nil)".to_string() |
| 30 | +// }, |
| 31 | +// VirtualCodeAction { |
| 32 | +// title: "Disable all diagnostics in current file (need-check-nil)".to_string() |
| 33 | +// }, |
| 34 | +// VirtualCodeAction { |
| 35 | +// title: |
| 36 | +// "Disable all diagnostics in current project (need-check-nil)".to_string() |
| 37 | +// }, |
| 38 | +// VirtualCodeAction { |
| 39 | +// title: "use cast to remove nil".to_string() |
| 40 | +// }, |
| 41 | +// VirtualCodeAction { |
| 42 | +// title: "Disable current line diagnostic (need-check-nil)".to_string() |
| 43 | +// }, |
| 44 | +// VirtualCodeAction { |
| 45 | +// title: "Disable all diagnostics in current file (need-check-nil)".to_string() |
| 46 | +// }, |
| 47 | +// VirtualCodeAction { |
| 48 | +// title: |
| 49 | +// "Disable all diagnostics in current project (need-check-nil)".to_string() |
| 50 | +// }, |
| 51 | +// ] |
| 52 | +// )); |
53 | 53 |
|
54 | | - Ok(()) |
55 | | - } |
| 54 | +// Ok(()) |
| 55 | +// } |
56 | 56 |
|
57 | | - #[gtest] |
58 | | - fn test_add_doc_tag() -> Result<()> { |
59 | | - let mut ws = ProviderVirtualWorkspace::new(); |
60 | | - let mut emmyrc = Emmyrc::default(); |
61 | | - emmyrc |
62 | | - .diagnostics |
63 | | - .enables |
64 | | - .push(DiagnosticCode::UnknownDocTag); |
65 | | - ws.analysis.update_config(emmyrc.into()); |
66 | | - check!(ws.check_code_action( |
67 | | - r#" |
68 | | - ---@class Cast1 |
69 | | - ---@foo bar |
70 | | - "#, |
71 | | - vec![ |
72 | | - VirtualCodeAction { |
73 | | - title: "Add @foo to the list of known tags".to_string() |
74 | | - }, |
75 | | - VirtualCodeAction { |
76 | | - title: "Disable current line diagnostic (unknown-doc-tag)".to_string() |
77 | | - }, |
78 | | - VirtualCodeAction { |
79 | | - title: "Disable all diagnostics in current file (unknown-doc-tag)".to_string() |
80 | | - }, |
81 | | - VirtualCodeAction { |
82 | | - title: |
83 | | - "Disable all diagnostics in current project (unknown-doc-tag)".to_string() |
84 | | - }, |
85 | | - ] |
86 | | - )); |
| 57 | +// #[gtest] |
| 58 | +// fn test_add_doc_tag() -> Result<()> { |
| 59 | +// let mut ws = ProviderVirtualWorkspace::new(); |
| 60 | +// let mut emmyrc = Emmyrc::default(); |
| 61 | +// emmyrc |
| 62 | +// .diagnostics |
| 63 | +// .enables |
| 64 | +// .push(DiagnosticCode::UnknownDocTag); |
| 65 | +// ws.analysis.update_config(emmyrc.into()); |
| 66 | +// check!(ws.check_code_action( |
| 67 | +// r#" |
| 68 | +// ---@class Cast1 |
| 69 | +// ---@foo bar |
| 70 | +// "#, |
| 71 | +// vec![ |
| 72 | +// VirtualCodeAction { |
| 73 | +// title: "Add @foo to the list of known tags".to_string() |
| 74 | +// }, |
| 75 | +// VirtualCodeAction { |
| 76 | +// title: "Disable current line diagnostic (unknown-doc-tag)".to_string() |
| 77 | +// }, |
| 78 | +// VirtualCodeAction { |
| 79 | +// title: "Disable all diagnostics in current file (unknown-doc-tag)".to_string() |
| 80 | +// }, |
| 81 | +// VirtualCodeAction { |
| 82 | +// title: |
| 83 | +// "Disable all diagnostics in current project (unknown-doc-tag)".to_string() |
| 84 | +// }, |
| 85 | +// ] |
| 86 | +// )); |
87 | 87 |
|
88 | | - Ok(()) |
89 | | - } |
90 | | -} |
| 88 | +// Ok(()) |
| 89 | +// } |
| 90 | +// } |
0 commit comments