intelliwacc ide #43

Merged
gc1523 merged 9 commits from intelliwacc-ide into master 2025-03-14 13:22:53 +00:00
9 changed files with 318 additions and 0 deletions
Showing only changes of commit 051ef02011 - Show all commits

View File

@@ -15,8 +15,7 @@ function activate(context) {
if (document.languageId !== 'wacc') return; if (document.languageId !== 'wacc') return;
let diagnostics = []; let diagnostics = [];
let errors = generateErrors(document.getText()); let errors = generateErrors(document.getText(), document.fileName);
errors.forEach(error => { errors.forEach(error => {
console.log(error); console.log(error);
let range = new vscode.Range(error.line - 1 , error.column - 1, error.line - 1, error.column + error.size); let range = new vscode.Range(error.line - 1 , error.column - 1, error.line - 1, error.column + error.size);
@@ -32,22 +31,21 @@ function deactivate() {
console.log('IntelliWACC is deactivating...'); console.log('IntelliWACC is deactivating...');
} }
function generateErrors(code) { function generateErrors(code, filePath) {
try { try {
console.log("generating errors") console.log("generating errors")
const fs = require('fs'); const fs = require('fs');
const tmpFilePath = '/tmp/temp_wacc_file.wacc'; const tmpFilePath = parse(filePath).dir + '/.temp_wacc_file.wacc';
fs.writeFileSync(tmpFilePath, code); fs.writeFileSync(tmpFilePath, code);
let output; let output;
try { try {
// currently only works if the wacc compiler exe is in the parent directory const waccExePath = `${__dirname}/wacc-compiler`;
const waccExePath = `${__dirname}/wacc_exe`;
output = execSync(`${waccExePath} ${tmpFilePath}`, { encoding: 'utf8', stdio: 'pipe' }); output = execSync(`${waccExePath} ${tmpFilePath}`, { encoding: 'utf8', stdio: 'pipe' });
} catch (err) { } catch (err) {
console.log("this aint working buddy") console.log("Error running compiler");
console.log(err)
output = err.stdout; output = err.stdout;
console.log(output);
} }
let errors = []; let errors = [];
errorRegex = /\(line ([\d]+), column ([\d]+)\):\n([^>]+)([^\^]+)([\^]+)\n([^\n]+)([^\(]*)/g errorRegex = /\(line ([\d]+), column ([\d]+)\):\n([^>]+)([^\^]+)([\^]+)\n([^\n]+)([^\(]*)/g

View File

@@ -20,7 +20,16 @@
"language": "wacc", "language": "wacc",
"scopeName": "source.wacc", "scopeName": "source.wacc",
"path": "./syntaxes/wacc.tmLanguage.json" "path": "./syntaxes/wacc.tmLanguage.json"
}] }],
"properties": {
"files.exclude": {
"type": "object",
"default": {
"**/.temp_wacc_file.*": true
},
"description": "Configure patterns for excluding files and folders."
}
}
}, },
"scripts": { "scripts": {
"vscode:prepublish": "npm run compile", "vscode:prepublish": "npm run compile",

Binary file not shown.