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 ada.selectProject command to select project #1132

Closed

Conversation

TamaMcGlinn
Copy link

This adds a filedialog command called 'Ada Select GPR Project' which lets the user select a .gpr file and puts that into the workspace configuration.

For a test project, see https://github.com/TamaMcGlinn/test_multigpr

Tested this with latest Ada_language_server (23.0.14) and it works beatifully; even if you had no .vscode/settings.json, it is created if you run the command. Note this command is only needed for non-alire projects, as ALS autodetects the right gpr file for alire projects now.

"Note: you can configure a project " &
" through the ada.projectFile setting."));
"Configure using the ada.chooseProject command" & Line_Feed &
" or the ada.projectFile setting."));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thought, we probably don't want to mention vscode specific stuff here. ada.projectFile is actually what you need to set in all LSP clients.

@CLAassistant
Copy link

CLAassistant commented Mar 9, 2023

CLA assistant check
All committers have signed the CLA.

@TamaMcGlinn TamaMcGlinn force-pushed the topic/vscode_project_selection branch from 90ed0e1 to 076b2e2 Compare March 10, 2023 13:05
Copy link
Member

@reznikmm reznikmm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have README.md updated.

This adds a filedialog command called 'Ada Select GPR Project'
which lets the user select a .gpr file and puts that into the workspace
configuration.

For a test project, see https://github.com/TamaMcGlinn/test_multigpr
@TamaMcGlinn TamaMcGlinn force-pushed the topic/vscode_project_selection branch from 076b2e2 to 38f4979 Compare March 16, 2023 12:25
@TamaMcGlinn
Copy link
Author

Added this note in the readme under VSCode > project support

If there is a single .gpr file in the root of the project, it will be selected automatically. To choose the active project file, use the ada.chooseProject command and select a project file in the file dialog.

@reznikmm
Copy link
Member

@TamaMcGlinn
I've tried it locally, but when I execute command the setting doesn't save in .vscode/settings.json immediately. So ALS doesn't get didConfigurationChange and "Build current project" task doesn't get project name.

Any idea?

@TamaMcGlinn
Copy link
Author

I had not tested that; good find! I will have more time to test this next week, I'll get back to you when I know if I can reproduce and/or fix it.

My own test was using test_multigpr, and just checking from the main.adb where cntrl+click on the Foo function call takes you. With that I could see that the language server was switching as soon as the command had been issued.

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

Successfully merging this pull request may close these issues.

3 participants