Matsuuu/custom-elements-language-server

Sublime Text support

Opened this issue ยท 3 comments

Support for Sublime Text would be greatly appreciated! Showing my gray hair here ๐Ÿ˜„

https://lsp.sublimetext.io/language_servers/

From a quick look, doesn't seem like a big hurdle to get the client side setup! Thanks for the link.

I'll aim this for the same release as INTELLIJ compat

Heya @luwes ! I've gotten quite close to supporting sublime, but I'm in need of a little help. What are some tools/packages you use to in Sublime to get some of the highlighting etc. in the template literal / jsx contexts?

I've been able to hook up the system to the editor, but am missing a small part in there, and also am trying to figure out what to set up as a languagetype trigger for the plugin.

Also: Is it common for sublime users to modify their plugin's settings to that they support the filetypes they want? Or is that expected from the plugin authors themselves?

I'll be happy to continue on this after getting some clarity on these. Thanks!

That's great to hear!

ST4 has built-in JSX syntax highlighting and for HTML in template literals I use JS-Custom

My JS-Custom config looks like this to support the /* html */` comment prefixed literal or the html` tagged template

{
  "configurations": {
    "TypeScript": {
      "file_extensions": [ "ts" ],
      "typescript": true,
      "scope": "source.ts",
      "custom_templates": {
        "comments": {
          "css": "scope:source.css",
          "html" : "scope:text.html.basic"
        },
        "tags": {
          "css": "scope:source.css",
          "html": "scope:text.html.basic"
        }
      }
    },
    "TypeScriptJSX": {
      "file_extensions": [ "tsx" ],
      "typescript": true,
      "scope": "source.tsx",
      "jsx": true,
      "custom_templates": {
        "comments": {
          "css": "scope:source.css",
          "html" : "scope:text.html.basic"
        },
        "tags": {
          "css": "scope:source.css",
          "html": "scope:text.html.basic"
        }
      }
    },
    "Template": {
      "string_object_keys": true,
      "custom_templates": {
        "comments": {
          "css": "scope:source.css",
          "html" : "scope:text.html.basic"
        },
        "tags": {
          "css": "scope:source.css",
          "html": "scope:text.html.basic"
        }
      }
    }
  }
}

Also: Is it common for sublime users to modify their plugin's settings to that they support the filetypes they want? Or is that expected from the plugin authors themselves?

I think it's pretty common yes, I've used the scope naming a bunch of times for plugins
https://www.sublimetext.com/docs/scope_naming.html#source