Skip to content

Commit 020c1db

Browse files
committed
Add support for C# with some basic types
1 parent bb26d72 commit 020c1db

File tree

5 files changed

+53
-8
lines changed

5 files changed

+53
-8
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1010

1111
## [0.9.0]
1212
### Added
13-
- Support for debugpy
13+
- Support for debugpy Python debugger
14+
- Support for coreclr C# debugger
15+
- Visualization of C# array, Generic.List and Drawing.Point
1416
### Fixed
1517
- Visualization of Shapely geometries
1618

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ You can download this extension from [Visual Studio Marketplace](https://marketp
4040
* Boost.Geometry: `box`, `linestring`, `multi_linestring`, `multi_point`, `multi_polygon`, `point`, `point_xy`, `point_xyz`, `polygon`, `ring`, `segment`
4141
* Boost.Polygon: `point_data`, `polygon_data`, `polygon_with_holes_data`, `rectangle_data`, `segment_data`
4242

43+
##### C# (coreclr)
44+
45+
* Containers of values, points and other geometries
46+
* Array
47+
* System.Collections.Generic: `List`
48+
* 2D values/geometries
49+
* System.Drawing: `Point`
50+
4351
##### Javascript (chrome, msedge, node, pwa-node, pwa-chrome, pwa-msedge)
4452

4553
* Containers of values, points and other geometries

resources/csharp.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "graphicaldebugging",
3+
"language": "csharp",
4+
"types": [
5+
{
6+
"type": "[a-zA-Z_][\\w<,>:\\s]*\\[\\]",
7+
"kind": "container",
8+
"array": {
9+
"start": "$this",
10+
"size": "$this.Length"
11+
},
12+
"_comment": "C# array"
13+
},
14+
{
15+
"type": "System.Collections.Generic.List<.+>",
16+
"kind": "container",
17+
"array": {
18+
"start": "$this",
19+
"size": "$this.Count"
20+
}
21+
},
22+
{
23+
"type": "System.Drawing.Point",
24+
"kind": "point",
25+
"system": "cartesian",
26+
"coordinates": {
27+
"x": "$this.X",
28+
"y": "$this.Y"
29+
}
30+
}
31+
]
32+
}

src/debugger.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import * as vscode from 'vscode';
22
import * as util from './util'
33
import { DebugProtocol } from 'vscode-debugprotocol';
44

5+
export enum Language { Cpp, CSharp, Java, JavaScript, Python, Ruby };
6+
57
export class SessionInfo {
68
constructor(
79
public session: vscode.DebugSession,
@@ -19,13 +21,15 @@ export class SessionInfo {
1921
return undefined;
2022
if (['cppvsdbg', 'cppdbg', 'lldb', 'cortex-debug'].includes(sessionType))
2123
return Language.Cpp;
22-
else if (['python', 'debugpy', 'Python Kernel Debug Adapter'].includes(sessionType))
23-
return Language.Python;
24+
else if (['coreclr'].includes(sessionType))
25+
return Language.CSharp;
26+
else if (['java'].includes(sessionType))
27+
return Language.Java;
2428
else if (['node', 'chrome', 'msedge', 'pwa-node', 'pwa-chrome', 'pwa-msedge'].includes(sessionType))
2529
return Language.JavaScript;
26-
else if (sessionType === 'java')
27-
return Language.Java;
28-
else if (sessionType === 'rdbg')
30+
else if (['python', 'debugpy', 'Python Kernel Debug Adapter'].includes(sessionType))
31+
return Language.Python;
32+
else if (['rdbg'].includes(sessionType))
2933
return Language.Ruby;
3034
else
3135
return undefined;
@@ -72,8 +76,6 @@ export class MachineInfo {
7276
{}
7377
}
7478

75-
export enum Language { Cpp, Java, JavaScript, Python, Ruby };
76-
7779
export class Debugger {
7880
private _onStopped: vscode.EventEmitter<void> = new vscode.EventEmitter<void>();
7981
readonly onStopped: vscode.Event<void> = this._onStopped.event;

src/loader.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,7 @@ export class Types {
984984
private _stringToLanguage(name: string | undefined): debug.Language | undefined {
985985
switch(name){
986986
case 'cpp': return debug.Language.Cpp;
987+
case 'csharp': return debug.Language.CSharp;
987988
case 'java': return debug.Language.Java;
988989
case 'javascript': return debug.Language.JavaScript;
989990
case 'python': return debug.Language.Python;

0 commit comments

Comments
 (0)