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

Prompt user if there is a collision in file to language association (two extensions registering different languages for a file extension) #34450

Closed
nehashri opened this issue Sep 15, 2017 · 6 comments
Labels
extensions Issues concerning extensions feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code
Milestone

Comments

@nehashri
Copy link

Hi, I am trying to write an extension that recognizes ".spec" files as Gauge language. However, if a user has installed some plugins the file association is overridden by the other extension. I noticed that my extension does not even get activated in this case. Is there any way that this can be prevented, other than the user changing the settings per workspace? Something that can be done in the extension itself would be useful.
Or when a new extension is installed, can the user choose the default file association if there are conflicts.

@vscodebot vscodebot bot added the extensions Issues concerning extensions label Sep 15, 2017
@alexdima
Copy link
Member

@nehashri Have you figured out which other extension your extension is "fighting with" over the .spec file extension?

Unfortunately, today, extensions are processed in alphabetical order and, for file extensions => lang association, the last one wins.

@alexdima alexdima self-assigned this Sep 18, 2017
@nehashri
Copy link
Author

@alexandrudima The ruby RSpec is if fighting with Gauge extension in our projects. Gauge can be used with ruby too. In this case both the extensions are activated in the workspace. The only way to resolve this is to have file associations for the project, where .spec files will be associated to gauge.
The problem with this is that it is not very discoverable and many times, the user is not aware that this should be done. Hence, if there is a explicit prompt for the user that the file may be associated with the wrong extension, and asking him to change this would be useful.

@alexdima
Copy link
Member

I agree this is unhappy, but it seems to me that nobody except the users working on a specific project would know if their .spec files in that project are Ruby RSpec files or Gauge files.

In VS Code, this can currently be configured per-project via the ~/.vscode/settings.json where a custom association can be written which wins over anything that the extensions try to do. It can be done with something like this:

"files.associations": {
	"*.spec": "languageId"
}

For all languages, users have the chance to spot the currently configured language in the bottom right status bar:

image

I'm not sure what else would be needed from VS Code to improve end-user experience ?

@alexdima alexdima added the info-needed Issue requires more information from poster label Sep 20, 2017
@nehashri
Copy link
Author

@alexandrudima I understand that the only way to solve this is through a custom association. I would like a feature where the user gets a pop-up/notification/warning that this has happened and that he/she can change the behaviour through a custom association. I am taking about a notification similar to the one that comes when a file is opened, if not extension that can handle such a file is found, notification pops up with the recommended extensions that can be used.
screen shot 2017-09-21 at 10 50 24
Can such a notification be given the user if conflicts are found?

@alexdima alexdima changed the title Files associated with wrong language/extension Prompt user if there is a collision in file to language association (two extensions registering different languages for a file extension) Sep 21, 2017
@alexdima
Copy link
Member

Thank you for the follow up, now I understand what you would have in mind. I've updated the title to reflect this.

fyi @bpasero

@alexdima alexdima added feature-request Request for new features or functionality and removed info-needed Issue requires more information from poster labels Sep 21, 2017
@alexdima alexdima added this to the Backlog milestone Sep 21, 2017
@alexdima alexdima removed their assignment Sep 21, 2017
@isidorn isidorn added the *out-of-scope Posted issue is not in scope of VS Code label Dec 6, 2022
@VSCodeTriageBot
Copy link
Collaborator

We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding, and happy coding!

@VSCodeTriageBot VSCodeTriageBot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extensions Issues concerning extensions feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
Development

No branches or pull requests

4 participants