atom-languageclient icon indicating copy to clipboard operation
atom-languageclient copied to clipboard

Suggest ide-* packages based on file extensions

Open deankevorkian opened this issue 7 years ago • 12 comments

As the Atom language client is part of Atom IDE, maybe it should suggest its consumers to download the matching packages to give them the Atom IDE experience on every file they open, in case they don't have one installed at that moment. For example - when a user opens a C# file (and has the atom-languageclient package installed, of course), suggest him to download the ide-csharp package. For *.ts files - ide-typescript, etc. Such behavior exists in VSCode and I think should be a part of the Atom language client since whoever uses it expects an IDE experience anyway. In many cases a user might not know about the existence of such package, or just rather be notified of it automatically. I'd probably hit the Install button if there was one. :) Thoughts?

One "drawback" I can think of is having to maintain/manually handle a list of matching LSP clients for different language - be it remotely or as a part of the package...

deankevorkian avatar Oct 20 '17 13:10 deankevorkian

We do have plans for that - indeed the packages already have extra metadata in the package.json called enhancedScopes that describes what grammars they work. Atom.io also supports searching on this too.

As soon as the packages are more stable we'll add the discovery component to Atom itself.

I'll leave this issue open as the public tracking side of the work.

damieng avatar Oct 20 '17 15:10 damieng

It seems at least the outline view of atom-ide-ui already suggests packages.

screenshot 2017-11-01 11 20 07

Clicking on Install an IDE package first sends the user to a package search with ide-<language>,

screenshot 2017-11-01 11 20 15

Seems the search functionality is sort of a nice middle ground between helping the user find the package and not having to maintain a list of language servers.

Tehnix avatar Nov 01 '17 02:11 Tehnix

Yeah, it is a nice functionality but I was thinking (maybe at least for the Atom maintained ide packages) that they could be automatically downloaded & installed if the user wanted. By the language (or the grammar scope) we can find a package and download it to the user to even simplify things. For community maintained packages, I think displaying the user a list of packages that implement atom-languageclient functionality by the scope would be great (and not querying ide-languageName packages). Just a better experience IMHO

deankevorkian avatar Nov 03 '17 12:11 deankevorkian

You should also take into account that some languages will have several packages implementing this functionality, for example, for different language servers. It's up to user to decide which one they want.

laughedelic avatar Nov 03 '17 12:11 laughedelic

@laughedelic I agree that's true for community packages. But maybe for packages that are maintained by the Atom team you'd want to offer the user to get the package instantly, or choose from a list. Some middle ground solution between offering and instantly downloading - suggesting them both when it comes to the Atom team's packages.. I'm not sure :)

EDIT - When I say community packages I mean community packages that don't have an alternative package maintained by the Atom team

deankevorkian avatar Nov 03 '17 12:11 deankevorkian

I think a generic way to link a specific package while also linking to alternatives would be nice (e.g. an Atom maintained one is not necessarily guaranteed to be the one you want).

Something like Install ide-haskell-hie (or look for other IDE packages), and Find an IDE package for Haskell would probably be satisfying to most IMO (wording not necessarily final ofc).

Then the specific package mentions would only be for Atom maintained (or very de facto ones), and fallback on searching. Thoughts?

Tehnix avatar Nov 04 '17 04:11 Tehnix

As I mentioned in my original reply we have plans in place. Any package that is uploaded with an "enhancedScopes" section in the package.json that contains a list of the grammar scopes it can do things with will be part of a suggested list presented to the user when they are editing files of that grammar scope and they have no existing packages that can enhance it.

More details as the package ecosystem matures to the point where we want to be actively rolling out to otherwise passive eyes.

damieng avatar Nov 04 '17 05:11 damieng

The plan is to present all packages that match the current scope with their enhancedScopes whether they are Atom maintained or not.

damieng avatar Nov 04 '17 15:11 damieng

@damieng Seems like current backend api (as documented here) doesn't allow searching more "advanced" queries (packages that must have an enhancedScope of source.cs, and atom-languageclient as a dependency). This will make many results irrelevant as we only want to display packages that are best-suited to work with the atom-ide-ui and not packages that have their own implementation. Am I doing something wrong? or perhaps the docs need to be updated?

deankevorkian avatar Jan 19 '18 10:01 deankevorkian

This is temporarily on hold while scope and language names are reworked for tree-sitter. Once they are stable we'll rework enhancedScopes to support the new naming and add some appropriate UI.

damieng avatar Feb 20 '18 17:02 damieng

Looking at file extensions instead of only the grammar scope might be useful, as Atom doesn't provide grammars for every single language by default. Since grammar files contain the extensions they cover in fileTypes, it would seem feasible to also suggest packages depending on file extensions directly if no grammar was found for a file.

LaurentTreguier avatar May 06 '18 15:05 LaurentTreguier

Development of atom-languageclient has officially moved to https://github.com/atom-ide-community/atom-languageclient 🎉

If this is still an issue please consider opening an issue on that repo.

UziTech avatar Oct 19 '20 19:10 UziTech