You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/hls-pragmas-plugin/test/Main.hs
+60
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,66 @@ codeActionTests =
32
32
liftIO $"Add \"FlexibleInstances\""`elem`map (^.L.title) cas @?"Contains FlexibleInstances code action"
33
33
executeCodeAction $head cas
34
34
35
+
, goldenWithPragmas "adds LANGUAGE with no other pragmas at start ignoring later INLINE pragma""AddPragmaIgnoreInline"$\doc ->do
36
+
_ <- waitForDiagnosticsFrom doc
37
+
cas <-map fromAction <$> getAllCodeActions doc
38
+
liftIO $"Add \"TupleSections\""`elem`map (^.L.title) cas @?"Contains TupleSections code action"
39
+
executeCodeAction $head cas
40
+
41
+
, goldenWithPragmas "adds LANGUAGE after shebang preceded by other LANGUAGE and GHC_OPTIONS""AddPragmaAfterShebangPrecededByLangAndOptsGhc"$\doc ->do
42
+
_ <- waitForDiagnosticsFrom doc
43
+
cas <-map fromAction <$> getAllCodeActions doc
44
+
liftIO $"Add \"TupleSections\""`elem`map (^.L.title) cas @?"Contains TupleSections code action"
45
+
executeCodeAction $head cas
46
+
47
+
, goldenWithPragmas "adds LANGUAGE after shebang with other Language preceding shebang""AddPragmaAfterShebangPrecededByLanguage"$\doc ->do
48
+
_ <- waitForDiagnosticsFrom doc
49
+
cas <-map fromAction <$> getAllCodeActions doc
50
+
liftIO $"Add \"TupleSections\""`elem`map (^.L.title) cas @?"Contains TupleSections code action"
51
+
executeCodeAction $head cas
52
+
53
+
, goldenWithPragmas "adds LANGUAGE before Doc comments after interchanging pragmas""BeforeDocInterchanging"$\doc ->do
54
+
_ <- waitForDiagnosticsFrom doc
55
+
cas <-map fromAction <$> getAllCodeActions doc
56
+
liftIO $"Add \"NamedFieldPuns\""`elem`map (^.L.title) cas @?"Contains NamedFieldPuns code action"
57
+
executeCodeAction $head cas
58
+
59
+
, goldenWithPragmas "Add language after altering OPTIONS_GHC and Language""AddLanguagePragmaAfterInterchaningOptsGhcAndLangs"$\doc ->do
60
+
_ <- waitForDiagnosticsFrom doc
61
+
cas <-map fromAction <$> getAllCodeActions doc
62
+
liftIO $"Add \"TupleSections\""`elem`map (^.L.title) cas @?"Contains TupleSections code action"
63
+
executeCodeAction $head cas
64
+
65
+
, goldenWithPragmas "Add language after pragmas with non standard space between prefix and name""AddPragmaWithNonStandardSpacingInPrecedingPragmas"$\doc ->do
66
+
_ <- waitForDiagnosticsFrom doc
67
+
cas <-map fromAction <$> getAllCodeActions doc
68
+
liftIO $"Add \"TupleSections\""`elem`map (^.L.title) cas @?"Contains TupleSections code action"
69
+
executeCodeAction $head cas
70
+
71
+
, goldenWithPragmas "adds LANGUAGE after OptGHC at start ignoring later INLINE pragma""AddPragmaAfterOptsGhcIgnoreInline"$\doc ->do
72
+
_ <- waitForDiagnosticsFrom doc
73
+
cas <-map fromAction <$> getAllCodeActions doc
74
+
liftIO $"Add \"TupleSections\""`elem`map (^.L.title) cas @?"Contains TupleSections code action"
75
+
executeCodeAction $head cas
76
+
77
+
, goldenWithPragmas "adds LANGUAGE ignore later Ann pragma""AddPragmaIgnoreLaterAnnPragma"$\doc ->do
78
+
_ <- waitForDiagnosticsFrom doc
79
+
cas <-map fromAction <$> getAllCodeActions doc
80
+
liftIO $"Add \"BangPatterns\""`elem`map (^.L.title) cas @?"Contains BangPatterns code action"
81
+
executeCodeAction $head cas
82
+
83
+
, goldenWithPragmas "adds LANGUAGE after interchanging pragmas ignoring later Ann pragma""AddLanguageAfterInterchaningIgnoringLaterAnn"$\doc ->do
84
+
_ <- waitForDiagnosticsFrom doc
85
+
cas <-map fromAction <$> getAllCodeActions doc
86
+
liftIO $"Add \"BangPatterns\""`elem`map (^.L.title) cas @?"Contains BangPatterns code action"
87
+
executeCodeAction $head cas
88
+
89
+
, goldenWithPragmas "adds LANGUAGE after OptGHC preceded by another language pragma""AddLanguageAfterLanguageThenOptsGhc"$\doc ->do
90
+
_ <- waitForDiagnosticsFrom doc
91
+
cas <-map fromAction <$> getAllCodeActions doc
92
+
liftIO $"Add \"NamedFieldPuns\""`elem`map (^.L.title) cas @?"Contains NamedFieldPuns code action"
93
+
executeCodeAction $head cas
94
+
35
95
, goldenWithPragmas "adds LANGUAGE pragma after shebang and last language pragma""AfterShebangAndPragma"$\doc ->do
0 commit comments