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

ansible.lightspeed.enabled setting is not applied if it's declared in .vscode/settings.json file in multi-root workspace #1443

Open
svor opened this issue Jul 23, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@svor
Copy link

svor commented Jul 23, 2024

Summary

I have a multi-root workspace (in Dev Spaces it is a default state), I'd like to automatically enable Ansible Lightspeed, for this I've added "ansible.lightspeed.enabled": true into .vscode/settings.json file. It means that this setting was applied on Workspace Folder level but it's not enough to enable Ansible Lightspeed:

screenshot-nimbusweb me-2024 07 23-11_44_30

Would it be possible to check if ansible.lightspeed.enabled was set in Workspace Folder settings level to apply it?

Steps to reproduce on VS Code:
1/ Open any project and create .vscode/settings.json file with the content:

{
    "ansible.lightspeed.enabled": true
}

2/ Add another project to the workspace File -> Add Folder to Workspace
3/ Check that Ansible Lightspeed is not enabled

Extension version

v24.8.3

VS Code version

1.91.0

Ansible Version

ansible [core 2.16.6]
  config file = None
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.11/site-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections:/projects/ansible-devspaces-demo/collections
  executable location = /usr/local/bin/ansible
  python version = 3.11.5 (main, Sep 22 2023, 15:34:29) [GCC 8.5.0 20210514 (Red Hat 8.5.0-20)] (/usr/bin/python3.11)
  jinja version = 3.1.4
  libyaml = True

OS / Environment

NAME="Red Hat Enterprise Linux"
VERSION="8.9 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.9"

ansible-lint 24.2.3

Relevant log output

No response

@TamiTakamiya
Copy link
Collaborator

Currently we check if Lightspeed is enabled or not using the logic like:

    const lightspeedSettings = <LightSpeedServiceSettings>(
      vscode.workspace.getConfiguration("ansible").get("lightspeed")
    );
    const lightspeedEnabled = lightspeedSettings?.enabled;

i.e. we are using the "non-scoped" getConfiguration and it should be the reason that the Workspace Folder-level settings are not picked up (reference).

In order to supporting Workspace Folder-level settings, just updating the "non-scoped" getConfiguration to the "scoped" one in this logic would not be enough. There are other settings retrieved in the same way and at least Lightspeed-related ones likely need to be updated. Also we need to implement corresponding UI changes, for example the Ansible Lightspeed view on the sidebar needs to change contents displayed depending on the current workspace folder that the current file opened in the editor.

I think we'd better handle this as a new feature rather than a bug. @ssbarnea what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

3 participants