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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sublime Text support #28

Open
luwes opened this issue Nov 11, 2023 · 3 comments
Open

Sublime Text support #28

luwes opened this issue Nov 11, 2023 · 3 comments

Comments

@luwes
Copy link

luwes commented Nov 11, 2023

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

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

@Matsuuu
Copy link
Owner

Matsuuu commented Nov 11, 2023

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 Matsuuu mentioned this issue Nov 11, 2023
5 tasks
@Matsuuu
Copy link
Owner

Matsuuu commented Nov 16, 2023

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!

@luwes
Copy link
Author

luwes commented Nov 16, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants