microsoft / typespec

https://typespec.io/
MIT License
3.88k stars 174 forks source link

JetBrains IDEs Plugin #3304

Open Ezard opened 2 months ago

Ezard commented 2 months ago

Clear and concise description of the problem

Currently, there are plugins available for VSCode and Visual Studio, but it'd be great if there was an official plugin for the JetBrains suite of IDEs

JetBrains IDEs support Microsoft's LSP, so hopefully an official plugin would require minimal work on Microsoft's part

Checklist

RodgeFu commented 1 month ago

Thanks for submitting the request. Further investigation needed in this area.

connorjs commented 2 weeks ago

Current workaround: Use TextMate bundle (example: IntelliJ’s documentation).

  1. Download TypeSpec grammar: https://github.com/microsoft/typespec/blob/main/grammars/typespec.json
  2. Create directory named typespec where you want to store the TextMate bundle
  3. Move typespec.json into the directory named typespec
  4. Rename typespec.json to typespec.tmLanguage
  5. Open JetBrains IDE preferences, go to Text Mate
  6. Click add (+) and select the typespec directory created in (2)

JetBrains IDE will now syntax highlight and given basic token autocomplete. A proper plugin would still provide more value and better auto-complete, but I do not know the effort to do that.


Edit: Alternative way to get typespec.tmLanguage. This replaces steps (1), (2), and (4).

The typespec.tmLanguage of your version of typespec exists in the @typespec/compiler package in your node_modules (at least at time of writing).

cp ./node_modules/@typespec/compiler/dist/typespec.tmLanguage /path/to/typespec/textmate/dir