Skip to content

Commit 57f79a1

Browse files
committed
More lint
1 parent 3e7a84a commit 57f79a1

File tree

98 files changed

+306
-399
lines changed

Some content is hidden

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

98 files changed

+306
-399
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module.exports = {
2424
"caughtErrorsIgnorePattern": "^_"
2525
}
2626
],
27+
"@typescript-eslint/no-namespace": "off"
2728
},
2829
ignorePatterns: [
2930
"out/",

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,10 @@
136136
"js-yaml": ">=3.13.1",
137137
"minimatch": "3.0.5",
138138
"mocha": "10.0.0",
139-
"mock-fs": "4.13.0",
139+
"mock-fs": "^4.13.0",
140140
"mock-http-server": "1.4.2",
141141
"rimraf": "2.6.3",
142+
"source-map-support": "^0.5.21",
142143
"ts-loader": "9.0.0",
143144
"ts-node": "9.1.1",
144145
"tslint": "5.12.1",
@@ -862,17 +863,17 @@
862863
"items": {
863864
"type": "string"
864865
},
865-
"description": "Array of symbol server URLs (example: http://MyExampleSymbolServer) or directories (example: /build/symbols) to search for .pdb files. These directories will be searched in addition to the default locations -- next to the module and the path where the pdb was originally dropped to.",
866+
"description": "Array of symbol server URLs (example: http\u200b://MyExampleSymbolServer) or directories (example: /build/symbols) to search for .pdb files. These directories will be searched in addition to the default locations -- next to the module and the path where the pdb was originally dropped to.",
866867
"default": []
867868
},
868869
"searchMicrosoftSymbolServer": {
869870
"type": "boolean",
870-
"description": "If 'true' the Microsoft Symbol server (https://msdl.microsoft.com/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
871+
"description": "If 'true' the Microsoft Symbol server (https\u200b://msdl.microsoft.com\u200b/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
871872
"default": false
872873
},
873874
"searchNuGetOrgSymbolServer": {
874875
"type": "boolean",
875-
"description": "If 'true' the NuGet.org symbol server (https://symbols.nuget.org/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
876+
"description": "If 'true' the NuGet.org symbol server (https\u200b://symbols.nuget.org\u200b/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
876877
"default": false
877878
},
878879
"cachePath": {
@@ -1504,17 +1505,17 @@
15041505
"items": {
15051506
"type": "string"
15061507
},
1507-
"description": "Array of symbol server URLs (example: http://MyExampleSymbolServer) or directories (example: /build/symbols) to search for .pdb files. These directories will be searched in addition to the default locations -- next to the module and the path where the pdb was originally dropped to.",
1508+
"description": "Array of symbol server URLs (example: http\u200b://MyExampleSymbolServer) or directories (example: /build/symbols) to search for .pdb files. These directories will be searched in addition to the default locations -- next to the module and the path where the pdb was originally dropped to.",
15081509
"default": []
15091510
},
15101511
"csharp.debug.symbolOptions.searchMicrosoftSymbolServer": {
15111512
"type": "boolean",
1512-
"description": "If 'true' the Microsoft Symbol server (https://msdl.microsoft.com/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
1513+
"description": "If 'true' the Microsoft Symbol server (https\u200b://msdl.microsoft.com\u200b/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
15131514
"default": false
15141515
},
15151516
"csharp.debug.symbolOptions.searchNuGetOrgSymbolServer": {
15161517
"type": "boolean",
1517-
"description": "If 'true' the NuGet.org symbol server (https://symbols.nuget.org/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
1518+
"description": "If 'true' the NuGet.org symbol server (https\u200b://symbols.nuget.org\u200b/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
15181519
"default": false
15191520
},
15201521
"csharp.debug.symbolOptions.cachePath": {
@@ -2257,17 +2258,17 @@
22572258
"items": {
22582259
"type": "string"
22592260
},
2260-
"description": "Array of symbol server URLs (example: http://MyExampleSymbolServer) or directories (example: /build/symbols) to search for .pdb files. These directories will be searched in addition to the default locations -- next to the module and the path where the pdb was originally dropped to.",
2261+
"description": "Array of symbol server URLs (example: http\u200b://MyExampleSymbolServer) or directories (example: /build/symbols) to search for .pdb files. These directories will be searched in addition to the default locations -- next to the module and the path where the pdb was originally dropped to.",
22612262
"default": []
22622263
},
22632264
"searchMicrosoftSymbolServer": {
22642265
"type": "boolean",
2265-
"description": "If 'true' the Microsoft Symbol server (https://msdl.microsoft.com/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
2266+
"description": "If 'true' the Microsoft Symbol server (https\u200b://msdl.microsoft.com\u200b/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
22662267
"default": false
22672268
},
22682269
"searchNuGetOrgSymbolServer": {
22692270
"type": "boolean",
2270-
"description": "If 'true' the NuGet.org symbol server (https://symbols.nuget.org/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
2271+
"description": "If 'true' the NuGet.org symbol server (https\u200b://symbols.nuget.org\u200b/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
22712272
"default": false
22722273
},
22732274
"cachePath": {
@@ -2697,17 +2698,17 @@
26972698
"items": {
26982699
"type": "string"
26992700
},
2700-
"description": "Array of symbol server URLs (example: http://MyExampleSymbolServer) or directories (example: /build/symbols) to search for .pdb files. These directories will be searched in addition to the default locations -- next to the module and the path where the pdb was originally dropped to.",
2701+
"description": "Array of symbol server URLs (example: http\u200b://MyExampleSymbolServer) or directories (example: /build/symbols) to search for .pdb files. These directories will be searched in addition to the default locations -- next to the module and the path where the pdb was originally dropped to.",
27012702
"default": []
27022703
},
27032704
"searchMicrosoftSymbolServer": {
27042705
"type": "boolean",
2705-
"description": "If 'true' the Microsoft Symbol server (https://msdl.microsoft.com/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
2706+
"description": "If 'true' the Microsoft Symbol server (https\u200b://msdl.microsoft.com\u200b/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
27062707
"default": false
27072708
},
27082709
"searchNuGetOrgSymbolServer": {
27092710
"type": "boolean",
2710-
"description": "If 'true' the NuGet.org symbol server (https://symbols.nuget.org/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
2711+
"description": "If 'true' the NuGet.org symbol server (https\u200b://symbols.nuget.org\u200b/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
27112712
"default": false
27122713
},
27132714
"cachePath": {
@@ -3411,17 +3412,17 @@
34113412
"items": {
34123413
"type": "string"
34133414
},
3414-
"description": "Array of symbol server URLs (example: http://MyExampleSymbolServer) or directories (example: /build/symbols) to search for .pdb files. These directories will be searched in addition to the default locations -- next to the module and the path where the pdb was originally dropped to.",
3415+
"description": "Array of symbol server URLs (example: http\u200b://MyExampleSymbolServer) or directories (example: /build/symbols) to search for .pdb files. These directories will be searched in addition to the default locations -- next to the module and the path where the pdb was originally dropped to.",
34153416
"default": []
34163417
},
34173418
"searchMicrosoftSymbolServer": {
34183419
"type": "boolean",
3419-
"description": "If 'true' the Microsoft Symbol server (https://msdl.microsoft.com/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
3420+
"description": "If 'true' the Microsoft Symbol server (https\u200b://msdl.microsoft.com\u200b/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
34203421
"default": false
34213422
},
34223423
"searchNuGetOrgSymbolServer": {
34233424
"type": "boolean",
3424-
"description": "If 'true' the NuGet.org symbol server (https://symbols.nuget.org/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
3425+
"description": "If 'true' the NuGet.org symbol server (https\u200b://symbols.nuget.org\u200b/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
34253426
"default": false
34263427
},
34273428
"cachePath": {
@@ -3851,17 +3852,17 @@
38513852
"items": {
38523853
"type": "string"
38533854
},
3854-
"description": "Array of symbol server URLs (example: http://MyExampleSymbolServer) or directories (example: /build/symbols) to search for .pdb files. These directories will be searched in addition to the default locations -- next to the module and the path where the pdb was originally dropped to.",
3855+
"description": "Array of symbol server URLs (example: http\u200b://MyExampleSymbolServer) or directories (example: /build/symbols) to search for .pdb files. These directories will be searched in addition to the default locations -- next to the module and the path where the pdb was originally dropped to.",
38553856
"default": []
38563857
},
38573858
"searchMicrosoftSymbolServer": {
38583859
"type": "boolean",
3859-
"description": "If 'true' the Microsoft Symbol server (https://msdl.microsoft.com/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
3860+
"description": "If 'true' the Microsoft Symbol server (https\u200b://msdl.microsoft.com\u200b/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
38603861
"default": false
38613862
},
38623863
"searchNuGetOrgSymbolServer": {
38633864
"type": "boolean",
3864-
"description": "If 'true' the NuGet.org symbol server (https://symbols.nuget.org/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
3865+
"description": "If 'true' the NuGet.org symbol server (https\u200b://symbols.nuget.org\u200b/download/symbols) is added to the symbols search path. If unspecified, this option defaults to 'false'.",
38653866
"default": false
38663867
},
38673868
"cachePath": {
@@ -4864,4 +4865,4 @@
48644865
}
48654866
]
48664867
}
4867-
}
4868+
}

src/coreclr-debug/debuggerEventsProtocol.ts

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,30 @@
77
// property on a launch or attach request.
88
//
99
// All messages are sent as UTF-8 JSON text with a tailing '\n'
10-
export namespace DebuggerEventsProtocol {
11-
export namespace EventType {
12-
// Indicates that the vsdbg-ui has received the attach or launch request and is starting up
13-
export const Starting = "starting";
14-
// Indicates that vsdbg-ui has successfully launched the specified process.
15-
// The ProcessLaunchedEvent interface details the event payload.
16-
export const ProcessLaunched = "processLaunched";
17-
// Debug session is ending
18-
export const DebuggingStopped = "debuggingStopped";
19-
}
10+
export const Starting = "starting";
11+
// Indicates that vsdbg-ui has successfully launched the specified process.
12+
// The ProcessLaunchedEvent interface details the event payload.
13+
export const ProcessLaunched = "processLaunched";
14+
// Debug session is ending
15+
export const DebuggingStopped = "debuggingStopped";
2016

21-
export interface DebuggerEvent {
22-
// Contains one of the 'DebuggerEventsProtocol.EventType' values
23-
eventType: string;
24-
}
17+
export interface DebuggerEvent {
18+
// Contains one of the 'DebuggerEventsProtocol.EventType' values
19+
eventType: string;
20+
}
2521

26-
export interface ProcessLaunchedEvent extends DebuggerEvent {
27-
// Process id of the newly-launched target process
28-
targetProcessId: number;
29-
}
22+
export interface ProcessLaunchedEvent extends DebuggerEvent {
23+
// Process id of the newly-launched target process
24+
targetProcessId: number;
25+
}
3026

31-
// Decodes a packet received from the debugger into an event
32-
export function decodePacket(packet: Buffer): DebuggerEvent {
33-
// Verify the message ends in a newline
34-
if (packet[packet.length - 1] != 10 /*\n*/) {
35-
throw new Error("Unexpected message received from debugger.");
36-
}
37-
38-
const message = packet.toString('utf-8', 0, packet.length - 1);
39-
return JSON.parse(message);
27+
// Decodes a packet received from the debugger into an event
28+
export function decodePacket(packet: Buffer): DebuggerEvent {
29+
// Verify the message ends in a newline
30+
if (packet[packet.length - 1] != 10 /*\n*/) {
31+
throw new Error("Unexpected message received from debugger.");
4032
}
33+
34+
const message = packet.toString('utf-8', 0, packet.length - 1);
35+
return JSON.parse(message);
4136
}

src/features/codeLensProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export default class OmniSharpCodeLensProvider extends AbstractProvider implemen
100100
return createCodeLenses(response.Elements, document.fileName, options);
101101
}
102102
}
103-
catch (error) { }
103+
catch (error) { /* empty */ }
104104

105105
return [];
106106
}

src/features/dotnetTest.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import * as serverUtils from "../omnisharp/utils";
1111
import * as utils from '../common';
1212
import * as vscode from 'vscode';
1313
import AbstractProvider from './abstractProvider';
14-
import { DebuggerEventsProtocol } from '../coreclr-debug/debuggerEventsProtocol';
14+
import * as DebuggerEventsProtocol from '../coreclr-debug/debuggerEventsProtocol';
1515
import { OmniSharpServer } from '../omnisharp/server';
1616
import { TestExecutionCountReport, ReportDotNetTestResults, DotNetTestRunStart, DotNetTestMessage, DotNetTestRunFailure, DotNetTestsInClassRunStart, DotNetTestDebugWarning, DotNetTestDebugProcessStart, DotNetTestDebugComplete, DotNetTestDebugStart, DotNetTestsInClassDebugStart, DotNetTestDebugStartFailure, DotNetTestRunInContextStart, DotNetTestDebugInContextStart } from '../omnisharp/loggingEvents';
1717
import { EventStream } from '../EventStream';
@@ -182,7 +182,7 @@ export default class TestManager extends AbstractProvider {
182182
const response = await serverUtils.discoverTests(this._server, request);
183183
return response.Tests;
184184
}
185-
catch {}
185+
catch { /* empty */ }
186186

187187
return undefined;
188188
}
@@ -586,13 +586,14 @@ class DebugEventListener {
586586
}
587587

588588
switch (event.eventType) {
589-
case DebuggerEventsProtocol.EventType.ProcessLaunched:
589+
case DebuggerEventsProtocol.ProcessLaunched: {
590590
const processLaunchedEvent = <DebuggerEventsProtocol.ProcessLaunchedEvent>(event);
591591
this._eventStream.post(new DotNetTestDebugProcessStart(processLaunchedEvent.targetProcessId));
592592
this.onProcessLaunched(processLaunchedEvent.targetProcessId);
593593
break;
594+
}
594595

595-
case DebuggerEventsProtocol.EventType.DebuggingStopped:
596+
case DebuggerEventsProtocol.DebuggingStopped:
596597
this._eventStream.post(new DotNetTestDebugComplete());
597598
this.onDebuggingStopped();
598599
break;

src/features/implementationProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default class OmniSharpImplementationProvider extends AbstractSupport imp
2020
// Allow language middlewares to re-map its edits if necessary.
2121
const result = await this._languageMiddlewareFeature.remap("remapLocations", implementations, token);
2222
return result;
23-
} catch {}
23+
} catch { /* empty */ }
2424

2525
return undefined;
2626
}

0 commit comments

Comments
 (0)