File tree Expand file tree Collapse file tree 4 files changed +42
-2
lines changed Expand file tree Collapse file tree 4 files changed +42
-2
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "version" : " 0.2.0" ,
3
+ "configurations" : [
4
+
5
+ {
6
+ "name" : " .NET Core Launch (console)" ,
7
+ "type" : " coreclr" ,
8
+ "request" : " launch" ,
9
+ "preLaunchTask" : " build" ,
10
+ "program" : " ${workspaceRoot}/bin/Debug/<target-framework>/<project-name.dll>" ,
11
+ "args" : [],
12
+ "cwd" : " ${workspaceRoot}" ,
13
+ "externalConsole" : false ,
14
+ "stopAtEntry" : false ,
15
+ "internalConsoleOptions" : " openOnSessionStart"
16
+ },
17
+ {
18
+ "name" : " .NET Core Attach" ,
19
+ "type" : " coreclr" ,
20
+ "request" : " attach" ,
21
+ "processId" : " ${command:pickProcess}"
22
+ },
23
+ {
24
+ "name" : " .NET Full Attach" ,
25
+ "type" : " clr" ,
26
+ "request" : " attach" ,
27
+ "processId" : " ${command:pickProcess}"
28
+ }
29
+ ]
30
+ }
Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ public bool IsValidRange(Range range)
126
126
127
127
return range . Start . Line <= Lines . Count
128
128
&& range . End . Line <= Lines . Count
129
- && range . Start . Column <= Lines [ range . Start . Line - 1 ] . Length
129
+ && range . Start . Column <= Lines [ range . Start . Line - 1 ] . Length + 1
130
130
&& range . End . Column <= Lines [ range . End . Line - 1 ] . Length + 1 ;
131
131
}
132
132
Original file line number Diff line number Diff line change @@ -315,7 +315,8 @@ private IEnumerable<DiagnosticRecord> FindOperatorViolations(TokenOperations tok
315
315
}
316
316
317
317
var hasWhitespaceBefore = IsPreviousTokenOnSameLineAndApartByWhitespace ( tokenNode ) ;
318
- var hasWhitespaceAfter = IsPreviousTokenOnSameLineAndApartByWhitespace ( tokenNode . Next ) ;
318
+ var hasWhitespaceAfter = tokenNode . Next . Value . Kind == TokenKind . NewLine
319
+ || IsPreviousTokenOnSameLineAndApartByWhitespace ( tokenNode . Next ) ;
319
320
320
321
if ( ! hasWhitespaceAfter || ! hasWhitespaceBefore )
321
322
{
Original file line number Diff line number Diff line change @@ -173,6 +173,15 @@ $x = 1
173
173
'@
174
174
Invoke-ScriptAnalyzer - ScriptDefinition $def - Settings $settings | Should Be $null
175
175
}
176
+
177
+ It " Should not find violation if a binary operator is followed by new line" {
178
+ $def = @'
179
+ $x = $true -and
180
+ $false
181
+ '@
182
+ Invoke-ScriptAnalyzer - ScriptDefinition $def - Settings $settings | Should Be $null
183
+ }
184
+
176
185
}
177
186
178
187
Context " When a comma is not followed by a space" {
You can’t perform that action at this time.
0 commit comments