-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Adds workspace generation as part of init. #904
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like having VSCode support, the only downside would the be extra file that is not going to be useful for everyone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a test that check the content of directories after init, it needs to be adjusted:
INFO FAIL workflows__init-options: non-zero status code
Running: /opt/hostedtoolcache/Python/3.10.1/x64/bin/python3 test.py (cwd=/tmp/tmp8jlyspok/workflows__init-options)
Status code: 1
Output:
Traceback (most recent call last):
File "/tmp/tmp8jlyspok/workflows__init-options/test.py", line 20, in <module>
compare(contents('xxx'), ['xxx/.gitignore',
File "/home/runner/work/alire/alire/testsuite/drivers/helpers.py", line 49, in compare
assert found == wanted, 'Got: {}\nWanted: {}'.format(found, wanted)
AssertionError: Got: ['xxx/.gitignore', 'xxx/alire.toml', 'xxx/src', 'xxx/src/xxx.adb', 'xxx/workspace.code-workspace', 'xxx/xxx.gpr']
Wanted: ['xxx/.gitignore', 'xxx/alire.toml', 'xxx/src', 'xxx/src/xxx.adb', 'xxx/xxx.gpr']
* Test for bug * Fix bug in which a flattened tree may be empty * Update test with bugfix URL
@Fabien-Chouteau I guess there's nothing blocking this one? |
I am not a huge fan of having this extra file just for VScode. |
Perhaps we can add a config option to disable it? |
Up to you and @pyjarrett. The risk with an option is that some people won't see it. |
My intent was to move towards first-class support of VS code since it's an incredibly common editor on all platforms, and would minimize friction of people to try Ada + Alire very easily. Anecdotally, nearly everyone I know has an VS Code install. The continuation of this PR would be a setting up Maybe a configuration option on first Alire run would set the preferred editor between GNAT studio and VS code and set this? @Fabien-Chouteau , I understand why you don't want this specific file, which is why I had asked about the question on gitter about |
@reznikmm might want to be involved in this discussion as well. |
I fully agree that we have to up our VS Code game 👍
This is typically the kind of stuff I am afraid of. Extra files that will need to be maintained as the Ada plugin or VScode evolve.
100% 👍
That may change in the near future ;)
What about this: a new We could also rename |
I think Alire should not get special commands for specific editors (that would pollute the commands list), but rather have a generic command that uses 1) a subcommand or About Just my 2 cents. |
"Polution" of the command list doesn't seem like a strong argument to me. There are not many commands in Alire and we already have a system of categories to provide a clear list. Now, if this is a shared concern, we can also go with:
Or in the future add support for
You can already do 1) with The difference here is that, unlike GNAT Studio, VS code requires special files to work.
Templated |
@reznikmm why not define Alire tasks in the AdaCore vscode plugin?https://code.visualstudio.com/api/extension-guides/task-provider |
What these tasks should do exactly? |
I've found generating Visual Studio Code workspaces for projects for use with the Language Support for Ada plugin very helpful. I wasn't sure if you wanted this hidden behind an option, or if this was even a good idea in the general case.
When I've done this, I do:
alr config --global --set editor.cmd "code.cmd workspace.code-workspace"
to be able to easily swap between projects.