File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ """Test parsing of the initialization options."""
2
+
3
+ import re
4
+
5
+ from hamcrest import assert_that , is_
6
+
7
+ from jedi_language_server .initialization_options import InitializationOptions
8
+
9
+
10
+ def test_initialization_options () -> None :
11
+ """Test our adjustments to parsing of the initialization options."""
12
+
13
+ initialization_options = InitializationOptions .model_validate (
14
+ {
15
+ "completion" : {
16
+ "resolveEagerly" : True ,
17
+ "ignorePatterns" : [r"foo" , r"bar/.*" ],
18
+ },
19
+ "hover" : {
20
+ "disable" : {
21
+ "keyword" : {"all" : False },
22
+ "class" : {"all" : True },
23
+ "function" : {"all" : True },
24
+ },
25
+ },
26
+ "extra" : "ignored" ,
27
+ },
28
+ )
29
+
30
+ assert_that (initialization_options .completion .resolve_eagerly , is_ (True ))
31
+ assert_that (
32
+ initialization_options .completion .ignore_patterns ,
33
+ is_ (
34
+ [
35
+ re .compile (r"foo" ),
36
+ re .compile (r"bar/.*" ),
37
+ ]
38
+ ),
39
+ )
40
+ assert_that (initialization_options .hover .disable .keyword_ .all , is_ (False ))
41
+ assert_that (initialization_options .hover .disable .class_ .all , is_ (True ))
42
+ assert_that (initialization_options .hover .disable .function_ .all , is_ (True ))
You can’t perform that action at this time.
0 commit comments