Skip to content

Commit

Permalink
Merge pull request #2 from kuhnt/main
Browse files Browse the repository at this point in the history
🐛 fix FarmDyn compilation errors
  • Loading branch information
chrispahm authored Sep 29, 2023
2 parents 6d6d476 + 47ca0b3 commit 82e03d4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 106 deletions.
2 changes: 1 addition & 1 deletion dist/gams-ide.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/gams-ide.js.map

Large diffs are not rendered by default.

102 changes: 7 additions & 95 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "gams-ide",
"displayName": "gams-ide",
"description": "A GAMS integrated development environment for vscode",
"version": "0.0.41",
"version": "0.0.42",
"repository": {
"type": "git",
"url": "https://github.com/chrispahm/gams-ide"
Expand Down Expand Up @@ -193,8 +193,7 @@
"glob": "^10.2.7",
"lodash": "^4.17.21",
"readline-specific": "^1.0.4",
"shelljs": "^0.8.5",
"table": "^6.8.1"
"shelljs": "^0.8.5"
},
"extensionDependencies": [
"lolow.gams"
Expand Down
12 changes: 6 additions & 6 deletions src/diagnostics.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const parseError = require("./utils/parseError.js");
const createRefTree = require("./utils/createRefTree.js");
const createGamsCompileCommand = require("./utils/createGamsCompileCommand.js");
// const gdx = require('node-gdx')();
const { table } = require('table');
const createRefTreeWithSymbolValues = require("./createRefTreeWithSymbolValues.js");

function execAsync(command) {
Expand All @@ -25,13 +24,14 @@ module.exports = async function updateDiagnostics(args) {
terminal
} = args;

const shouldParseSymbolValues = vscode.workspace.getConfiguration("gamsIde").get("parseSymbolValues")

if (document && collection) {
// get the compile statement for the current document
const compileCommand = await createGamsCompileCommand(document, ["dumpopt=11"]);
console.log("compileCommand", compileCommand);

const compileCommand = await createGamsCompileCommand(document, [shouldParseSymbolValues ? "dumpopt=11" : ""]);
// run the compile command
const command = `${compileCommand.gamsExe} ${compileCommand.gamsArgs.join(" ")}`;
console.log("compileCommand", compileCommand, command);
let res
try {
// run the compile command
Expand All @@ -53,7 +53,7 @@ module.exports = async function updateDiagnostics(args) {
// vscode.window.showErrorMessage("GAMS compilation failed: Check the GAMS output in the terminal");
// terminal?.show(true);
// terminal?.sendText(command);
console.log("error", res.error);
// console.log("error", res.error);
// return;
}
const stdout = res.stdout;
Expand All @@ -70,7 +70,7 @@ module.exports = async function updateDiagnostics(args) {
if (errorFileContents.split(/\n/).length <= 2) {
collection.clear();
// only parse symbol values if the according setting is enabled
if (vscode.workspace.getConfiguration("gamsIde").get("parseSymbolValues")) {
if (shouldParseSymbolValues) {
// and the gdx smybol container
// we mutate the reference tree with symbol values, and explicitly do not await
// this potentially long-running process in order to return the diagnostic
Expand Down

0 comments on commit 82e03d4

Please sign in to comment.