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

Add a switch to load configuration from a file. #1108

Closed
NicoPy opened this issue Jan 8, 2023 · 10 comments
Closed

Add a switch to load configuration from a file. #1108

NicoPy opened this issue Jan 8, 2023 · 10 comments
Assignees

Comments

@NicoPy
Copy link

NicoPy commented Jan 8, 2023

As mentioned in another issue, I'm trying to use ALS with Eclipse (without writing a dedicated Eclipse plugin).
The Eclipse 'language server' client has, of course, no knowledge of ALS additional configuration parameters.
What would be very useful is to be able to add a config (or similar) switch to ALS to provide a file path containing ALS configuration.
One could then use ada_language_server --config=<FILE> with 'dumb' language clients.

I thought I could easily work on it and publish a PR but building ALS on Windows is not documented. I tried using Alire but this builds a non working executable (see issue #1103).

@NicoPy NicoPy changed the title Add a launch switch to load configuration from a file. Add a switch to load configuration from a file. Jan 8, 2023
@AnthonyLeonardoGracio AnthonyLeonardoGracio self-assigned this Jan 12, 2023
@AnthonyLeonardoGracio
Copy link
Collaborator

Hello!

That's a very interesting idea indeed. Do you know other language servers that provide this option?

@NicoPy
Copy link
Author

NicoPy commented Jan 13, 2023

Hi,

That's a very interesting idea indeed.

Thanks.

Do you know other language servers that provide this option?

None I'm aware of.

@AnthonyLeonardoGracio
Copy link
Collaborator

Ok! In any case, looks like a good idea, we'll add the option.

@NicoPy
Copy link
Author

NicoPy commented Jan 13, 2023

That's good news 😃

@NicoPy
Copy link
Author

NicoPy commented Jan 14, 2023

Just remembered that language servers for VHDL use a configuration file to manage specific configuration parameters (like libraries content, top level entity...).

For example :

adacore-bot pushed a commit that referenced this issue Feb 8, 2023
Add --config option to specify a server configuration

Closes #1108

See merge request eng/ide/ada_language_server!1135
@NicoPy
Copy link
Author

NicoPy commented Feb 8, 2023

👍

@NicoPy
Copy link
Author

NicoPy commented Feb 24, 2023

Can you provide a config file example ?
I tried many syntaxes/structures. Either ALS complains on bad content or ALS crashes :

Unhandled Exception raised
raised GNATCOLL.VFS.VFS_INVALID_FILE_ERROR : gnatcoll-vfs.adb:340
[Z:\ada\language_server\ada_language_server.exe]
0x7ff7a271d6da
0x7ff7a0d4026d
0x7ff7a0d41a0b
0x7ff7a0d41dd0
0x7ff7a0643dde
0x7ff7a2cb1a59
0x7ff7a064143c
0x7ff7a0641144
[C:\WINDOWS\System32\KERNEL32.DLL]
0x7ffaf6c97612
[C:\WINDOWS\SYSTEM32\ntdll.dll]
0x7ffaf8bc269f

@reznikmm
Copy link
Member

the same for me

@reznikmm reznikmm reopened this Feb 25, 2023
@AnthonyLeonardoGracio
Copy link
Collaborator

Hello @NicoPy ,

Do you have a config that exhibits the issue? I have tested with a simple config file that just sets the projectFile and it seems to work on my side.

@AnthonyLeonardoGracio
Copy link
Collaborator

Actually the issue only exists with the ada_language_server packaged with the extension. We are able to reproduce now. Thanks for reporting!

adacore-bot pushed a commit that referenced this issue Mar 1, 2023
when Self.Root hasn't been set yet by Initialize request, but
Change_Configuration relies on it.

Refs #1108
adacore-bot pushed a commit that referenced this issue Mar 1, 2023
@reznikmm reznikmm closed this as completed Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants