liuderchi / ide-html

:atom: Atom-IDE for HTML, Go Template, Mustache and other Templates
https://atom.io/packages/ide-html
MIT License
20 stars 5 forks source link

added the ability to register an array of grammars for example handle… #4

Closed rwatts3 closed 6 years ago

rwatts3 commented 6 years ago

…bars and mustache can also benefit from the html lsp

liuderchi commented 6 years ago

@rwatts3 Thanks for your awesome proposal. I'm now considering 2 aspects:

  1. config format:
    • maybe it's simpler to use checkboxes to support multiple grammar? (we would need to handle more error cases for text input)
  2. how many grammars can be benefited by html lang-server?
rwatts3 commented 6 years ago

Hi @liuderchi , Ideally we would need to pass an array of grammars to the auto language client. I would imagine there are a lot of different grammars that can benefit, for example handlebars, mustache and Meteor's spacebars, all support standard html tags and attributes within the language, and who knows what else is out there or what else may be developed in the future.

By providing a way to add an additional language to the package, will allow more control to the end user or the future end user.

I considered check boxes, but soon realized that we'd or you would then have to maintain and update as new languages are created, or added in the future.

Right now if someone wanted to create atom language-foo they could simply just add that item to the config setting and call it a day.

liuderchi commented 6 years ago

By providing a way to add an additional language to the package, will allow more control to the end user or the future end user.

@rwatts3 I really agree with the advantages and they are nice features to have. But I think it's good to be aware of the side effects of such flexibility.

We're not sure every text.html.* grammar are parsed correctly. Should this package handle handlebars related issues?

Maybe we can notice user this feature is experimental as a future enhancement.

liuderchi commented 6 years ago

@rwatts3 LGTM and I think we're ready to merge it 💯

TODO for myself