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

Project support (scenario) #1049

Open
AlexandreMarkus opened this issue Sep 16, 2022 · 3 comments
Open

Project support (scenario) #1049

AlexandreMarkus opened this issue Sep 16, 2022 · 3 comments

Comments

@AlexandreMarkus
Copy link

AlexandreMarkus commented Sep 16, 2022

Would be great if scenario would be supported in VS Code. There is some extensions that uses dropdown menu in the status bar or you could add an icon in the activity bar with some options in there.

@reznikmm
Copy link
Member

I agree. For now you can specify scenario variables in settings.

@AlexandreMarkus
Copy link
Author

I agree. For now you can specify scenario variables in settings.

I do use 3 different scenario variables with multiple values in each. Then, depending on each value I choose, it will build something different. Not sure how I can use the current method efficiently. Do you think I can?

@TamaMcGlinn
Copy link

Note I requested the same thing here, in an alr issue. I wrote a plugin for this for NeoVim, which is equivalent to what we would need (but I have never written a VSCode plugin before).

A quickfix for VSCode that should but doesn't currently work, is to set your editor settings to read the project file from an environment variable; GPR_PROJECT_FILE is customary for this, and restart vscode but prepending the env variable so that you can quite quickly switch, for example GPR_PROJECT_FILE=foo.gpr vscode .

That should work if you just have a .vscode/settings.json with this:

{
    "ada.projectFile": "${env:GPR_PROJECT_FILE}"
}

The error message I get from als indicates that VSCode is not expanding the env variable like the docs say it should:

Unable to load project file: /home/tama/code/test_multigpr/${env:GPR_PROJECT_FILE} /home/tama/code/test_multigpr/${env:GPR_PROJECT_FILE} is not a regular file

By the way, test_multigpr may be useful to you for debugging this; a simple open source multiple gpr project where you can easily see if switching worked before Foo.Get_Foo has two different definitions for each gpr file.

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