Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on langserver startup #36

Open
mstoffel-sag opened this issue Apr 1, 2021 · 4 comments
Open

Error on langserver startup #36

mstoffel-sag opened this issue Apr 1, 2021 · 4 comments
Assignees

Comments

@mstoffel-sag
Copy link

Hi,

great work here! One problem on windows though.

Is the extension only supported on linux?
image

@sag-tgo
Copy link
Contributor

sag-tgo commented Apr 27, 2021

Hi Marco,
Firstly thanks for taking the time to report this!
I think the most likely reason for this error is if your Apama installation is the core version, not the full version. The core version of Apama doesn't include eplbuddy.exe but the full version does (because it's used by Designer). If you have the full version installed somewhere else you can change the location of the Apama home directory in the settings. Alternatively you could disable the language server in the settings which should prevent that error when the extension starts.

The error message is not very clear, so there are a couple of things we could improve around this:

  • Make the documentation clearer about this limitation of the core version
  • Handle the absence of eplbuddy more gracefully when the extension starts

Future versions of Apama core might include EPL Buddy, but I can't make any guarantees.

@nicholasadams
Copy link
Collaborator

tl:dr: THis doesn't work on Windows because the syntax doesn't work with Powershell.

I've been investigating this after I ran into the same issue. The problem is that the && used to chain the apama_env.bat and eplbuddy comaasnds doesn't work in Windows Powershell.

There are a couple of issues:

  1. The && isn't supported in Windows Powershell, which I believe is v5 (although it is supported in v7, not installed by default, and I don't think we should require an upgrade just to use this extension).

  2. It looks as if VS Code ShellExecution is treating the command line as a complete string and playing it safe by prefixing it with & for powershell. This is a problembecuase as far as I can work out Powershell only allows one & per line.

So if I try the commands separately in Powershell, all is fine. The commands have the full path which I'm omitting for brevity from here on:

&'apama_env.bat'
&'eplbuddy.exe'
works

&'apama_env.bat && eplbuddy.exe'
which is what we have doesn't work, because a) && isn't supported in v5 and I don't think the command string will be parsed correctly even if it was because:

&'apama_env.bat -and eplybuddy.exe'
also doesn't work. The other common online suggestion of a semicolon doesn't work in this context either:

&'apama_env.bat; eplbuddy.exe'
doesn't work. Whe I try

&'apama_env.bat' -and &'eplbuddy.exe'
that also doesn't work as Powershell then starts complaining that & is reserved for future use, which seems a bit odd as an error message.

So I think the extension needs to be refactored for Windows so that the two calls are made as separated invocations of ShellExecution. This seems to affect quite a few correlator commands as they all try and ensure the Apama environment has been correctly setup first and are chained using && which works on Linux, but not POwershell.

Of course, the previous comment is also correct, it isn't going to work if eplbuddy isn't present either.

@nicholasadams
Copy link
Collaborator

I don't appear to have permissions to assign this tom myself, but am looking at fixing it.

@sag-tgo
Copy link
Contributor

sag-tgo commented Oct 15, 2021

Thanks Nick :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants