Skip to content

Commit

Permalink
preparation for 0.9.11
Browse files Browse the repository at this point in the history
  • Loading branch information
APerricone committed Jun 3, 2020
1 parent b117c48 commit a74287c
Show file tree
Hide file tree
Showing 11 changed files with 198 additions and 86 deletions.
6 changes: 5 additions & 1 deletion client/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
"label": "prelanch",
"type": "npm",
"script": "prelanch",
"problemMatcher": []
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
5 changes: 5 additions & 0 deletions client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log
All notable changes to the "Harbour and xHarbour" extension will be documented in this file.

# 0.9.11
- **debugger** better stability
- **task** better stability
- **task** correct management of batch option

# 0.9.10
- **debugger** added process list on attach, attach by process Id
- **task** added Harbour and HBMK2 tasks, BETA
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "harbour",
"displayName": "Harbour and xHarbour",
"description": "Harbour and xHarbour languages support for visual studio code",
"version": "0.9.10",
"version": "0.9.11",
"publisher": "aperricone",
"icon": "harbourIcon.png",
"main": "./dist/extension",
Expand Down
3 changes: 3 additions & 0 deletions client/package.nls.it.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"harbour.task.output": "tipo di output",
"harbour.task.ctype": "tipo di output C",
"harbour.task.HBMK2.input": "file HBP da buildare",
"harbour.task.HBMK2.output": "file di uscita",
"harbour.task.HBMK2.extraArgs": "Parametri extra liberi",
"harbour.task.HBMK2.debug": "Se true, verrà incluso anche il codice di debug per VSCode",
"harbour.task.HBMK2.platform": "Piattaforma di destinazione di default",
Expand All @@ -40,6 +41,8 @@
"harbour.task.portableName": "Genera un Harbour Portable Object (hrb)",
"harbour.task.cCodeName": "Genera un file C",
"harbour.task.HBMK2.provideName": "Builda {0}",
"harbour.task.HBMK2.provideName2": "Builda file corrente",
"harbour.task.HBMK2.provideName3": "Builda file corrente per il debugging",
"harbour.task.HBMK2.errorBatch": "Incapace di avviare il batch di setup",
"harbour.task.HBMK2.setup": "Impostando l'ambiente...",
"harbour.task.HBMK2.start": "Avvio HBMK2",
Expand Down
5 changes: 4 additions & 1 deletion client/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"harbour.task.input": "file to compile",
"harbour.task.output": "output type",
"harbour.task.ctype": "Type of C output",
"harbour.task.HBMK2.input": "HBP file to build",
"harbour.task.HBMK2.input": "file to build",
"harbour.task.HBMK2.output": "output file name",
"harbour.task.HBMK2.extraArgs": "Free extra arguments",
"harbour.task.HBMK2.debug": "if true includes the libray for debugging on VSCode",
"harbour.task.HBMK2.platform": "default target platform",
Expand All @@ -40,6 +41,8 @@
"harbour.task.portableName": "Generate Harbour Portable Object (hrb)",
"harbour.task.cCodeName": "Generate C file",
"harbour.task.HBMK2.provideName": "build {0}",
"harbour.task.HBMK2.provideName2": "build current file",
"harbour.task.HBMK2.provideName3": "build current file for debugging",
"harbour.task.HBMK2.errorBatch": "Unable to start setup batch",
"harbour.task.HBMK2.setup": "setting up the enviroment...",
"harbour.task.HBMK2.start": "Start HBMK2",
Expand Down
67 changes: 67 additions & 0 deletions client/src/debugProvider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
const vscode = require('vscode');
const path = require("path");
const fs = require("fs");
const cp = require("child_process");
const os = require("os");
const localize = require("./myLocalize.js").localize;
const getAllWorkspaceFiles = require("./utils.js").getAllWorkspaceFiles;
const taskProvider = require('./taskProvider.js');

class HarbourDBGProvider {
provideDebugConfigurations(folder,token) {
return new getAllWorkspaceFiles(token).then((values)=>{
var retValue = [{
"type": "harbour-dbg",
"request": "launch",
"name": "Launch currentFile",
"preLaunchTask": localize("harbour.task.HBMK2.provideName3")
}];
if(token.isCancellationRequested) {
return;
}
for(let j=0;j<values.length;j++) {
let ff = values[j];
for(let i=0;i<ff.length;++i) {
if(!ff[i].isFile()) continue;
var ext = path.extname(ff[i].name).toLowerCase();
if(ext==".hbp") {
var debugInfo = {
"type": "harbour-dbg",
"request": "launch",
"name": "Launch currentFile",
"preLaunchTask": localize("harbour.task.HBMK2.provideName",path.basename(ff[i].name))
};
retValue.push(debugInfo);
}
}
}
return retValue;
});
}

resolveDebugConfiguration(folder, debugConfiguration, token) {
/*
var textDocument = {uri: {fsPath:""}};
if(vscode && vscode.window && vscode.window.activeTextEditor && vscode.window.activeTextEditor.document)
textDocument =vscode.window.activeTextEditor.document;
var task = new vscode.Task({
"type": "HBMK2",
"input": "${file}",
"debugSymbols": true,
"output": "${fileBasenameNoExtension}_dbg"
}, vscode.TaskScope.Global, localize("harbour.task.HBMK2.provideName3") ,"HBMK2");
*/
return {
"type": "harbour-dbg",
"request": "launch",
"name": "Launch currentFile",
"preLaunchTask": localize("harbour.task.HBMK2.provideName3")
};
}
}

function activate() {
vscode.debug.registerDebugConfigurationProvider("harbour-dbg", new HarbourDBGProvider());
}

exports.activate = activate;
20 changes: 12 additions & 8 deletions client/src/debugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,16 +385,20 @@ harbourDebugSession.prototype.sendStack = function(line) {
var completePath = infos[0]
var found = false;
if(infos[0].length>0) {
if(path.isAbsolute(infos[0]) && fs.existsSync(infos[0])) {
completePath = trueCase.trueCasePathSync(infos[0]);
found=true;
} else
for(i=0;i<this.sourcePaths.length;i++) {
if(fs.existsSync(path.join(this.sourcePaths[i],infos[0]))) {
completePath = trueCase.trueCasePathSync(infos[0],this.sourcePaths[i]);
try {
if(path.isAbsolute(infos[0]) && fs.existsSync(infos[0])) {
completePath = trueCase.trueCasePathSync(infos[0]);
found=true;
break;
} else
for(i=0;i<this.sourcePaths.length;i++) {
if(fs.existsSync(path.join(this.sourcePaths[i],infos[0]))) {
completePath = trueCase.trueCasePathSync(infos[0],this.sourcePaths[i]);
found=true;
break;
}
}
} catch(ex) {
found=false;
}
}
if(found) infos[0]=path.basename(completePath);
Expand Down
2 changes: 2 additions & 0 deletions client/src/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const decorator = require('./decorator.js');
const docCreator = require('./docCreator.js');
const taskProvider = require('./taskProvider.js');
const net = require("net");
const debugProvider = require("./debugProvider.js");

var diagnosticCollection;

Expand Down Expand Up @@ -41,6 +42,7 @@ function activate(context) {
decorator.activate(context,cl);
docCreator.activate(context,cl);
taskProvider.activate();
//debugProvider.activate();
}

function DebugList(args) {
Expand Down
6 changes: 2 additions & 4 deletions client/src/myLocalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ function reInit(config)
function myLocalize()
{
var arg = Array.prototype.slice.call(arguments);
if(arg[0] in messages)
{
if(arg[0] in messages) {
arg[0] = messages[arg[0]];
} else
{
} else {
arg[0] = "Error: '" + arg[0] + "' not found";
}
arg.splice(0,0,null);
Expand Down
Loading

0 comments on commit a74287c

Please sign in to comment.