Skip to content

Commit

Permalink
- Codebase cleanup v2.2.3-pre
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-shilo committed Jun 21, 2024
1 parent 39d543b commit 2b6b7eb
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 48 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
11 changes: 3 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "cs-script",
"displayName": "CS-Script",
"description": "Execution, debugging and editing C# code that targets .NET and Mono (no .NET Core required)",
"version": "2.2.2",
"description": "Execution, debugging and editing C# code that targets .NET (.NET SDK is required)",
"version": "2.2.3-pre",
"license": "MIT",
"publisher": "oleg-shilo",
"icon": "images/css_logo.png",
Expand Down Expand Up @@ -82,11 +82,6 @@
"default": true,
"description": "Decorate file locations (e.g. error info) in the output panel as document links (underlined)."
},
"cs-script.debug_as_external_console": {
"type": "boolean",
"default": false,
"description": "Runs the script in external console during debugging."
},
"cs-script.fallback_to_launch_json": {
"type": "boolean",
"default": false,
Expand Down Expand Up @@ -416,4 +411,4 @@
"typescript": "^4.1.2",
"vscode-test": "^1.4.1"
}
}
}
42 changes: 2 additions & 40 deletions src/cs-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ export let csproj_dir = path.join(os.tmpdir(), "CSSCRIPT", "VSCode", "cs-script

function extra_args(): string { return vsc_config.get("cs-script.extra_args_for_debug", "-co:/debug:pdbonly"); }

// -----------------------------------

function is_dotnet_debug(): Boolean { return vsc_config.get("cs-script.engine_debug.dotnet", true); }

// -----------------------------------
export function load_project() {
with_lock(() => {
Expand Down Expand Up @@ -669,50 +665,16 @@ export async function debug() {

with_lock(() => {

let config = "";
if (os.platform() == "win32") {
// to allow assemblies to be resolved on Windows Mono build the same way as under .NET
let run_as_dotnet = vsc_config.get("cs-script.dotnet_run_host_on_win", false);
if (run_as_dotnet) {
config = `-config:css_config.xml`;
}
}

// "externalConsole": "true", // shows external console. Full equivalent of Ctrl+F5 in VS.
let debug_as_external_console = vsc_config.get("cs-script.debug_as_external_console", false);

let launchConfigMono = {
name: "Launch",
type: "mono",
request: "launch",
program: cscs_exe,
externalConsole: debug_as_external_console.toString(),
showOutput: "always",
// mono debugger requires non-inmemory asms and injection of the breakpoint ("-ac:2)
args: ["-d", "-inmem:0", extra_args(), config, "-ac:2", editor.document.fileName],
env: {
// "css_vscode_roslyn_dir": process.env.css_vscode_roslyn_dir
// "cscs_exe_dir": path.dirname(cscs_exe)
// "CSS_PROVIDER_TRACE": 'true'
}
};

////////////////////////////////
let launchConfigCore = {
let launchConfig = {
name: ".NET Core Launch (console)",
type: "coreclr",
request: "launch",
program: "dotnet",
args: [settings.cscs, "-d", extra_args().replace("-co:/debug:pdbonly", ""), vsc_config.get("cs-script.extra_args"), "", "-l", config, "-ac:2", editor.document.fileName],
args: [settings.cscs, "-d", extra_args().replace("-co:/debug:pdbonly", ""), vsc_config.get("cs-script.extra_args"), "", "-l", "-ac:2", editor.document.fileName],
cwd: path.dirname(editor.document.fileName),
console: "internalConsole",
stopAtEntry: false
}
////////////////////////////////

var launchConfig: object = launchConfigMono;
if (is_dotnet_debug())
launchConfig = launchConfigCore;

// vscode.startDebug has been deprecated
vscode.debug.startDebugging(undefined, <vscode.DebugConfiguration>launchConfig).then(
Expand Down

0 comments on commit 2b6b7eb

Please sign in to comment.