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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As a "Language Service Plugin" to have broad support for IDEs besides vscode #51

Open
eddyw opened this issue May 4, 2022 · 9 comments · May be fixed by #154
Open

As a "Language Service Plugin" to have broad support for IDEs besides vscode #51

eddyw opened this issue May 4, 2022 · 9 comments · May be fixed by #154
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@eddyw
Copy link
Collaborator

eddyw commented May 4, 2022

Hey 👋

So, just throwing random ideas here. Instead of a vscode extension or adding an additional package, this could be wrapped as a TypeScript Language Service Plugin.

Language Service Plugins allow to report additional errors such as from a linter and technically they should have access to original diagnostics so theoretically it'd be possible to add "translated" diagnostics along side original diagnostics.

Assuming this works, then user can simply add this to tsconfig:

{
    "compilerOptions": {
        "plugins": [{ "name": "ts-error-translator" }]
    }
}

So any IDE that uses TypeScript language service would be able to load the plugin and report errors in that IDE's native way for displaying/reporting errors/messages.


I haven't personally written a TS language service plugin before, I'm slightly familiar with the APIs thought which I learned for no reason lol. If there is interest in this I could try this out when I get some time.

@mattpocock mattpocock added enhancement New feature or request help wanted Extra attention is needed labels May 4, 2022
@mattpocock
Copy link
Owner

Yes, this makes sense - I don't think I'll be prioritising this myself because:

  1. It's kind of a 'power user' flow - most beginners don't know that TS plugins exist, or that they're an option. They can feel worried diving into tsconfig.json.
  2. I want to target beginners, who are much more likely to get excited about and download an IDE extension.

@entropitor
Copy link

I've written a simple plugin before and I think if there is a function to get the "better" error message from a diagnostic code / id / number, it should be pretty easy to write this plugin (just call the original and map over the results).

Where I think this would shine is in certain teams / big open-source repositories where beginners wouldn't add this plugin but more experienced users might and the beginners would benefit. They don't need to install anything, it will be set up for them. This could help convince people to use typescript over javascript.

@mattpocock
Copy link
Owner

This doesn't change my above state opinion, but I'm happy to leave this issue open if anyone else wants to work on this.

@Jarrodsz
Copy link

Jarrodsz commented Jan 8, 2023

Anyone works on this or wants to? I want this in intellij

@Jarrodsz
Copy link

Jarrodsz commented Jan 8, 2023

@Jarrodsz
Copy link

Jarrodsz commented Jan 8, 2023

Anyone ever started on this?

@Jarrodsz
Copy link

Jarrodsz commented Jan 8, 2023

Anyone ever started working on this?
Shame thrre is so little effort would love to look into this, get some people together on discord and build thid in an hour

@ivan-demchenko
Copy link

I am happy to give it a go. @mattpocock @Jarrodsz

@Jarrodsz
Copy link

Jarrodsz commented Feb 6, 2023

I am happy to give it a go. @mattpocock @Jarrodsz

Would love to help. its probably not overcomplicated. There is already a prisma extension for intellij

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants