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

Warn about vscode-ansible conflict #404

Closed
gorkem opened this issue Dec 1, 2020 · 10 comments
Closed

Warn about vscode-ansible conflict #404

gorkem opened this issue Dec 1, 2020 · 10 comments

Comments

@gorkem
Copy link
Collaborator

gorkem commented Dec 1, 2020

Is your enhancement related to a problem? Please describe.

When vscode-ansible and vscode-yaml are both installed, because vscode-ansible ships the yaml server users see duplicate yaml syntax errors.

Describe the solution you would like

What I suggest is that the vscode-yaml extension detects when the ansible extension is installed (vscode.extensions.getExtension(‘vscoss.vscode-ansible’)) and then it informs the user about the problem and provides the option to uninstall the ansible extension (this can be implemented using the VS Code CLI).

Describe alternatives you have considered

Additional context

@joshuawilson
Copy link
Member

Is there a way to check for the second installed instance and where it is? I'm asking because what happens if it is in another extension?
Just wandering if we can make the warning generic.

@JPinkney
Copy link
Contributor

JPinkney commented Dec 1, 2020

It might be possible to make it a tad more generic. I did a quick look and you can do something like:

extensions.all.forEach((extension) => {
    if (extension.packageJSON.dependencies.hasOwnProperty("yaml-language-server")) {
        // show warning
   }
});

This check would only work though if everyone who had that dependency was spawning the language server and not just using the package as a library. If they were using the package as a library there would be false positives so I'm not sure if it would be worth it

@joshuawilson
Copy link
Member

A false positive is worse. Maybe just do the hard coded fix for this singular issue.

We can always come back to it if there is another case found.

@gorkem
Copy link
Collaborator Author

gorkem commented Dec 2, 2020

we can't depend on the "dependencies".

@fbricon
Copy link
Contributor

fbricon commented Dec 2, 2020

Yup, better take the conservative approach and rely on vscode.extensions.getExtension(‘vscoss.vscode-ansible’) for now to avoid false positives. If conflicts with other extensions are reported, it'll be easy to update and release a fix.

If you really really really want to be more "flexible", i.e. don't want to rerelease a new update every time you flag a conflicting dependency, you can always have vscode-yaml fetch a list of offending extensions at startup, so it's stays up-to-date even after a release. But that might be a tad overkill for now.

@egamma
Copy link

egamma commented Dec 2, 2020

The ansible extension provides a setting ansible.validate https://github.com/VSChina/vscode-ansible/blob/2201b217b4344b46adec31f3eed38e256a7528b6/package.json#L203 that supports to disable validation. Since you are already adding some special code for the ansible extension you could also programmatically disable this setting using the VS Code configuration setting API and disable validation.

@joshuawilson
Copy link
Member

Thanks @egamma that would be nicer then asking the user to uninstall the ansible extension. I think we should still tell them the issue and then give them the option to turn it off with a button press. Since the issue is that we are seeing double errors, that is not critical and they may want the current yaml validation in anisble.

That way they know the cause and can make it go away if they choose to.

@egamma
Copy link

egamma commented Dec 2, 2020

Quick update to avoid a wasted effort, after further discussion with the team that owns this extension it was decided to deprecate and retire the ansible extension. Having an extension that is not actively maintained will cause more frustration for users in the future. This was also suggested by users VSChina/vscode-ansible#272.

@kohtala
Copy link

kohtala commented May 12, 2021

I see commit eb107ed added a notification Ansible extension is incompatible with VSCode-YAML. Please uninstall it. Thanks.

@JPinkney, maybe I am a bit illiterate, but I was afraid pressing the offered Uninstall button because I was not sure which extension would be uninstalled. Would it be possible to reword to something like "VSCode-YAML found incompatible extensions. Please uninstall Ansible."

@ssbarnea
Copy link
Member

ssbarnea commented Apr 4, 2022

Closing because the original posting is no longer true. Both ansible and yaml vscode ansible are developed by redhat and they team-up quite well.

Just be sure you are using the official Ansible extension from https://marketplace.visualstudio.com/items?itemName=redhat.ansible and not another one, especially as there were quite a few floating around over time.

@ssbarnea ssbarnea closed this as completed Apr 4, 2022
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

7 participants