Skip to content

Commit 610bdf8

Browse files
committed
Lexer: support #warnon
1 parent 66d94e1 commit 610bdf8

File tree

41 files changed

+151
-15
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+151
-15
lines changed

ReSharper.FSharp/src/FSharp/FSharp.Psi.Features/src/CodeCompletion/Rules/FSharpKeywordsRule.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ type FSharpKeywordsRule() =
305305
let hashDirectives isFSharp9Supported =
306306
let spaceOrQuotesSuffix = if isFSharp9Supported then KeywordSuffix.Space else KeywordSuffix.Quotes
307307

308-
[| spaceOrQuotesSuffix, [| "#nowarn"; "#time" |]
308+
[| spaceOrQuotesSuffix, [| "#nowarn"; "#warnon"; "#time" |]
309309
KeywordSuffix.Quotes, [| "#load"; "#r"; "#I" |]
310310
KeywordSuffix.None, [| "#if"; "#else"; "#endif" |] |]
311311

ReSharper.FSharp/src/FSharp/FSharp.Psi/src/Parsing/FSharpTokens.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
<Token name="PP_ELSE_SECTION" representation="#else" />
129129
<Token name="PP_ENDIF" representation="#endif" />
130130
<Token name="PP_NOWARN" representation="#nowarn" />
131+
<Token name="PP_WARNON" representation="#warnon" />
131132

132133
<Token name="PP_OR" representation="||" />
133134
<Token name="PP_AND" representation="&amp;&amp;" />

ReSharper.FSharp/src/FSharp/FSharp.Psi/src/Parsing/Lexing/FSharpRules.lex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,7 @@ PP_CONDITIONAL_SYMBOL={IDENT}
643643
<PPDIRECTIVE> {HASH}"time" { yybegin(LINE); return MakeToken(PP_TIME); }
644644
<PPDIRECTIVE> {HASH}"I" { yybegin(LINE); return MakeToken(PP_I); }
645645
<PPDIRECTIVE> {HASH}"nowarn" { yybegin(LINE); return MakeToken(PP_NOWARN); }
646+
<PPDIRECTIVE> {HASH}"warnon" { yybegin(LINE); return MakeToken(PP_WARNON); }
646647

647648
<PPDIRECTIVE> {HASH}"if" { yypushback(yylength()); yybegin(PPSHARP); Clear(); break; }
648649
<PPDIRECTIVE> {HASH}"else" { yypushback(yylength()); yybegin(PPSHARP); Clear(); break; }

ReSharper.FSharp/test/data/features/completion/filtered/Expr - Base 01.fs.gold

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Completion: Basic
2-
Count: 3866
2+
Count: 3867
33
Focus: Soft
44
Range: "♦"
55

@@ -236,6 +236,7 @@ voption
236236
#nowarn
237237
#r
238238
#time
239+
#warnon
239240
FSharpFunc
240241
Failure exn
241242
abs ^T
@@ -3890,6 +3891,7 @@ second |(in Microsoft.FSharp.Data.UnitSystems.SI.UnitNames)
38903891
#nowarn
38913892
#r
38923893
#time
3894+
#warnon
38933895
AbstractClassAttribute
38943896
AllowNullLiteralAttribute
38953897
Array

ReSharper.FSharp/test/data/features/completion/filtered/Expr - Base 02 - Local.fs.gold

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Completion: Basic
2-
Count: 3867
2+
Count: 3868
33
Focus: Soft
44
Range: "♦"
55

@@ -237,6 +237,7 @@ voption
237237
#nowarn
238238
#r
239239
#time
240+
#warnon
240241
FSharpFunc
241242
Failure exn
242243
abs ^T
@@ -3891,6 +3892,7 @@ second |(in Microsoft.FSharp.Data.UnitSystems.SI.UnitNames)
38913892
#nowarn
38923893
#r
38933894
#time
3895+
#warnon
38943896
AbstractClassAttribute
38953897
AllowNullLiteralAttribute
38963898
Array

ReSharper.FSharp/test/data/features/completion/filtered/Expr - Record - Field - Empty 01.fs.gold

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Completion: Basic
2-
Count: 3871
2+
Count: 3872
33
Focus: Soft
44
Range: "let r: R1 = { ♦ }"
55

@@ -241,6 +241,7 @@ voption
241241
#nowarn
242242
#r
243243
#time
244+
#warnon
244245
FSharpFunc
245246
Failure exn
246247
abs ^T
@@ -3900,6 +3901,7 @@ F3 int
39003901
#nowarn
39013902
#r
39023903
#time
3904+
#warnon
39033905
AbstractClassAttribute
39043906
AllowNullLiteralAttribute
39053907
Array

ReSharper.FSharp/test/data/features/completion/filtered/Expr - Record - Field - Empty 02.fs.gold

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Completion: Basic
2-
Count: 3877
2+
Count: 3878
33
Focus: Soft
44
Range: "f { ♦ }"
55

@@ -247,6 +247,7 @@ voption
247247
#nowarn
248248
#r
249249
#time
250+
#warnon
250251
FSharpFunc
251252
Failure exn
252253
abs ^T
@@ -3906,6 +3907,7 @@ F3 int
39063907
#nowarn
39073908
#r
39083909
#time
3910+
#warnon
39093911
AbstractClassAttribute
39103912
AllowNullLiteralAttribute
39113913
Array

ReSharper.FSharp/test/data/features/completion/filtered/Expr - Record - Field - Empty 03.fs.gold

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Completion: Basic
2-
Count: 3870
2+
Count: 3871
33
Focus: Soft
44
Range: "if true then { F1 = 1 } else { ♦ }"
55

@@ -241,6 +241,7 @@ voption
241241
#nowarn
242242
#r
243243
#time
244+
#warnon
244245
FSharpFunc
245246
Failure exn
246247
abs ^T
@@ -3899,6 +3900,7 @@ F3 int
38993900
#nowarn
39003901
#r
39013902
#time
3903+
#warnon
39023904
AbstractClassAttribute
39033905
AllowNullLiteralAttribute
39043906
Array

ReSharper.FSharp/test/data/features/completion/filtered/Expr - Record - Field - Empty 04.fs.gold

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Completion: Basic
2-
Count: 3871
2+
Count: 3872
33
Focus: Soft
44
Range: "{ R = { ♦ } }"
55

@@ -242,6 +242,7 @@ voption
242242
#nowarn
243243
#r
244244
#time
245+
#warnon
245246
FSharpFunc
246247
Failure exn
247248
abs ^T
@@ -3900,6 +3901,7 @@ F3 int
39003901
#nowarn
39013902
#r
39023903
#time
3904+
#warnon
39033905
AbstractClassAttribute
39043906
AllowNullLiteralAttribute
39053907
Array

ReSharper.FSharp/test/data/features/completion/filtered/Expr - Record - Field - Empty 05 - Another ns.fs.gold

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Completion: Basic
2-
Count: 3874
2+
Count: 3875
33
Focus: Soft
44
Range: "f { ♦ }"
55

@@ -244,6 +244,7 @@ voption
244244
#nowarn
245245
#r
246246
#time
247+
#warnon
247248
FSharpFunc
248249
Failure exn
249250
abs ^T
@@ -3901,6 +3902,7 @@ Field int <==
39013902
#nowarn
39023903
#r
39033904
#time
3905+
#warnon
39043906
AbstractClassAttribute
39053907
AllowNullLiteralAttribute
39063908
Array

0 commit comments

Comments
 (0)