Skip to content

Commit

Permalink
Release v.1.6.3
Browse files Browse the repository at this point in the history
- Fixed #22: folder `runtimes` (of the syntaxer) is added to the package
  • Loading branch information
lbs-contributor committed Apr 10, 2020
1 parent 249ae51 commit a48e676
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 36 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Change Log

## 1.6.0-1 (8 Apr, 2020)
## 1.6.0-3 (11 Apr, 2020)

#### _This release delivers hosting script execution under .NET Core. Meaning that raw VSCode deployment with the extension extension "ms-dotnettools.csharp" is enough to edit, run and debug C# script. Mono and Mono extension are no longer required. Mono support is still available via settings but it will be eventually phased out._

- _v.1.6.1_
- Removed unnecessary check for presence of Mono
- _v.1.6.3_
- Fixed #22: folder `runtimes` (of the syntaxer) is added to the package
- _v.1.6.2_
- Fixed #21: Removed unnecessary check for presence of Mono
- _v.1.6.0_
- Migrated on .NET Core
- Hosting on Mono is still supported. If required it needs to be enabled via settings specific for the type of the activity:
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "cs-script",
"displayName": "CS-Script",
"description": "Execution, debugging and editing C# code that targets .NET and Mono (no .NET Core required)",
"version": "1.6.1",
"version": "1.6.3",
"license": "MIT",
"publisher": "oleg-shilo",
"icon": "images/css_logo.png",
Expand Down
7 changes: 6 additions & 1 deletion src/cs-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,12 @@ export async function save_script_project(dependencies_only: boolean): Promise<v
editor.document.save();
}

let command = build_command(`"${cscs_exe}" -proj:dbg "${file}"`);
let command = "";
if (is_dotnet_run())
command = `dotnet "${core_engine}" -proj:dbg "${file}"`;
else
command = build_command(`"${cscs_exe}" -proj:dbg "${file}"`);

let response = Utils.RunSynch(command);

let dependencies = response.lines()
Expand Down
68 changes: 37 additions & 31 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,16 @@ import * as fsx from "fs-extra";
import * as child_process from "child_process"
import { StatusBarAlignment, StatusBarItem, TextEditor, window, Disposable, commands, MarkdownString, ParameterInformation, SignatureInformation } from "vscode";
import { start_syntaxer, Syntaxer } from "./syntaxer";

// import { Syntax } from "./cs-script";

export class vsc_config {
public static get<T>(section_value: string, defaultValue?: T): T {
let tokens = section_value.split('.')
return vscode.workspace.getConfiguration(tokens[0]).get(tokens[1], defaultValue);
}
}

let ext_dir = path.join(__dirname, "..");
let exec = require('child_process').exec;
let execSync = require('child_process').execSync;
Expand All @@ -41,7 +49,12 @@ export let diagnosticCollection: vscode.DiagnosticCollection;
let sources_temp_dir = path.join(os.tmpdir(), "Roslyn.Intellisense", "sources");
create_dir(sources_temp_dir);


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


declare global {
Expand Down Expand Up @@ -263,6 +276,15 @@ export function copy_file_to_sync(fileName: string, srcDir: string, destDir: str
}
}

export function copy_dir_to_sync(srcDir: string, destDir: string): void {

try {
fsx.copySync(srcDir, destDir);
} catch (error) {
console.log(error.toString());
}
}

export function copy_file_to_sync2(fileName: string, newFileName: string, srcDir: string, destDir: string): void {

try {
Expand Down Expand Up @@ -405,13 +427,15 @@ export function deploy_engine(): void {
run_async(deploy_files);
}
else {
ensure_default_config(path.join(user_dir(), 'mono', 'cscs.exe'));
_ready = true;
run_async(preload_roslyn);
run_async(() => {
start_syntaxer();
check_syntaxer_ready(5);
});
if (need_mono) {
ensure_default_config(path.join(user_dir(), 'mono', 'cscs.exe'));
_ready = true;
run_async(preload_roslyn);
run_async(() => {
start_syntaxer();
check_syntaxer_ready(5);
});
}
}
} catch (error) {
console.log(error);
Expand Down Expand Up @@ -492,23 +516,10 @@ function deploy_files(): void {
try {

// dotnet
let dotnet_dir_root = path.join(user_dir(), "dotnet");
let src_dir_root = path.join(ext_dir, 'bin', 'dotnet');

let dotnet_dir = dotnet_dir_root;
let src_dir = src_dir_root;
fsx.readdirSync(src_dir)
.forEach(file => copy_file_to_sync(file, src_dir, dotnet_dir));

dotnet_dir = path.join(dotnet_dir_root, "syntaxer");
src_dir = path.join(src_dir_root, "syntaxer");
fsx.readdirSync(src_dir)
.forEach(file => copy_file_to_sync(file, src_dir, dotnet_dir));
let dotnet_dir = path.join(user_dir(), "dotnet");
let src_dir = path.join(ext_dir, 'bin', 'dotnet');
copy_dir_to_sync(src_dir, dotnet_dir);

dotnet_dir = path.join(dotnet_dir_root, ".vscode");
src_dir = path.join(src_dir_root, '.vscode');
fsx.readdirSync(src_dir)
.forEach(file => copy_file_to_sync(file, src_dir, dotnet_dir));

// mono
let mono_dir = path.join(user_dir(), "mono");
Expand Down Expand Up @@ -620,7 +631,8 @@ export function deploy_roslyn(): void {
copy_file_to_sync("syntaxer.exe", path.join(ext_dir, 'bin', 'mono'), dest_dir);

// the following will extract roslyn from syntaxer and place it in the destination folder
if (_environment_ready) {
if (_environment_ready && need_mono()) {

let command = 'mono "' + path.join(dest_dir, 'syntaxer.exe') + '" -dr';
execSync(command);
}
Expand Down Expand Up @@ -823,12 +835,6 @@ export class ErrorInfo {
}
}

export class vsc_config {
public static get<T>(section_value: string, defaultValue?: T): T {
let tokens = section_value.split('.')
return vscode.workspace.getConfiguration(tokens[0]).get(tokens[1], defaultValue);
}
}

// Writable extension settings
export class Settings {
Expand Down
Binary file added vsix/cs-script-1.6.3.vsix
Binary file not shown.

0 comments on commit a48e676

Please sign in to comment.