Ordner nicht angegeben with OmniPascal in VSCode

People get an error when opening a file in Visual Studio code when using OmniPascal :

enter image description here

Ordner nicht angegeben

which corresponds to:

No folder specified

The first thought is to provide paths in user.json settings:

  • objectpascal.delphiInstallationPath
  • objectpascal.objectpascal.searchPath

It would, of course, be the wrong tree to bark:

settings.json

 // Place your settings in this file to overwrite the default settings { "objectpascal.delphiInstallationPath": "D:\\Programs\\Embarcadero\\Studio\\14.0", "objectpascal.searchPath": "D:\\Delphi Components" } 

The error certainly comes from OmniPascal, as this is a line inside

Bin \ win \ OmniPascalServer.exe

enter image description here

I'm not the only person to get this

Anonymous has the same problem:

When I open the .pas file by right-clicking on the file in Windows Explorer, the file opens correctly, but then a messagedialog message appears with "Ordner nicht angegeben" and the OK button.

Is there any way to debug the code?

I see inside VSCode there is a variable in the root path of the workspace:

objectPascalServiceClient.js

 var config = vscode.workspace.getConfiguration('objectpascal'); var delphiSDK = config.get('delphiInstallationPath', ''); var searchPath = config.get('searchPath', ''); var workspacePath = vscode.workspace.rootPath; if (typeof delphiSDK == 'undefined') delphiSDK = ""; if (typeof searchPath == 'undefined') searchPath = ""; if (isWin) { childProcess = cp.spawn(path.join(__dirname, 'bin/win/OmniPascalServer.exe'), [workspacePath, delphiSDK, searchPath]); } 

Is there any source code?

OmniPascal seems to be giving up on software. Is there source code where someone can try to decrypt accurately?

The real question is how to get rid of the modal dialog that blocks the use of the window.

+5
source share
1 answer

OmniPascal seems to be a failure

No, he definitely did not disregard, although in recent months there has been no new public release. OmniPascal is still actively developing.

The real question: how to get rid of a modal dialog that blocks the use of a window.

This error message is sent from OmniPascalServer.exe , which comes with the OmniPascal plugin for VSCode in the (current) version 0.10.0, released on 2016-04-14.

Workaround for version <0.11.0

As far as I know, this error message only appears when opening a file in Visual Studio code instead of a folder . Thus, the easiest workaround is to open a folder containing the files (s) that you want to work with:

  • At the command prompt: enter code C:\Projects\MyProjectRootFolder
  • In Windows Explorer: right-click on the folder (or the white area inside the folder) and select "Open with code." Do not select the .pas file to open VSCode!
  • Inside VSCode: go to File -> Open Folder...

Or apply the fix

  • Open the file C:\Users\USERNAME\.vscode\extensions\Wosi.omnipascal-0.10.0\objectPascalServiceClient.js
  • Replace this line

     var workspacePath = vscode.workspace.rootPath; 

    with these lines

     var workspacePath = vscode.workspace.rootPath; if (typeof workspacePath == 'undefined') { var filePath = vscode.workspace.textDocuments[0].fileName; workspacePath = path.dirname(filePath); } 

Now the error should no longer appear.

+3
source

Source: https://habr.com/ru/post/1257702/


All Articles