custom-elements-language-server icon indicating copy to clipboard operation
custom-elements-language-server copied to clipboard

Sublime Text support

Open luwes opened this issue 1 year ago • 3 comments

Support for Sublime Text would be greatly appreciated! Showing my gray hair here 😄

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

luwes avatar Nov 11 '23 23:11 luwes

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

Matsuuu avatar Nov 11 '23 23:11 Matsuuu

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!

Matsuuu avatar Nov 16 '23 06:11 Matsuuu

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

luwes avatar Nov 16 '23 14:11 luwes