Skip to content

Commit

Permalink
Do not start pasls without valid PP
Browse files Browse the repository at this point in the history
  • Loading branch information
michaliskambi committed Sep 24, 2024
1 parent 9a25f2b commit 1ef886f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"markdowndescription",
"pasls",
"spammy",
"Testcase",
"theangryepicbanana",
"Typecheck",
"unregisters",
Expand Down
1 change: 0 additions & 1 deletion src/castleConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ class CastleConfiguration {

// exit with clear error message when FPC compiler not found
if (fpcExe === '') {

vscode.window.showErrorMessage('FPC compiler executable not configured and not found on the PATH. Configure the FPC compiler location in the extension settings.');
return;
}
Expand Down
8 changes: 8 additions & 0 deletions src/castlePascalLanguageServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ class CastlePascalLanguageServer {
this.environmentForPascalServer['FPCTARGET'] = this._castleConfig.fpcTargetOs;
this.environmentForPascalServer['FPCTARGETCPU'] = this._castleConfig.fpcTargetCpu;

/* pasls cannot work without FPC executable.
Testcase: without this line, editing settings of PP back and forth
from valid to invalid FPC executable location, would cause a number
of errors that pasls cannot be stopped because it is still starting. */
if (this._castleConfig.fpcExecutablePath === '') {
return false;
}

/* We need to set environment variable CASTLE_ENGINE_PATH, this is
how we pass engine path (maybe from $CASTLE_ENGINE_PATH, maybe from
VS extension config) to pasls. */
Expand Down

0 comments on commit 1ef886f

Please sign in to comment.