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

add JetBrains ecosystem plugin (WIP) reference #423

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Lordfirespeed
Copy link

@Lordfirespeed Lordfirespeed commented Jul 15, 2023

This plugin is WIP, not-yet-released for various reasons:

  1. LS Executables are not bundled into the plugin / downloaded at an appropriate time.
  2. Currently requires JetBrains EAP builds (>=2023.2).
  3. Not feature-complete.

To-do list:

  • Plugin should bundle or download appropriate executables
  • Plugin should automatically provide access to Roblox type definitions and docs (when appropriate)
  • Plugin should integrate with Rojo (notably sourcemap.json)
  • Errors/warning highlighting (Supported via LSP)
  • Syntax highlighting
  • Autocompletion provider (Supported via LSP)
  • Go to reference provider (Supported via LSP)
  • Refactor provider
  • Folding builder
  • Commenter
  • Quick fixes (Supported via LSP)
  • Wait for 2023.2 to be released in earnest
  • Publish to JetBrains plugin marketplace

@JohnnyMorganz
Copy link
Owner

This is pretty neat, thank you!
Is the expectation that the Todo list is completed before this is available? Or is it usable in its current state

@Lordfirespeed
Copy link
Author

It's not yet usable, no - a bit more of the to-do list needs to be done (especially the points relating to the binaries).
I didn't realise quite how difficult implementing this plugin would be 😂 even just refactoring support is difficult.

@JohnnyMorganz
Copy link
Owner

I don't think luau lsp has any refactoring operations. What kind of stuff does that entail?

@Lordfirespeed
Copy link
Author

Lordfirespeed commented Aug 5, 2023

It involves some specific implementation (on my part) in the plugin. It's not trivial to explain, but

  • see here for a simple properties language example
  • see here for details

Essentially, whilst VSCode implements a 'naive' renaming system that looks for particular strings and replaces them, JetBrains language support plugins use a more complicated 'smart' renaming system that involves a language lexer and parser to generate tokens and use them to build a 'PSI tree' which can then be traversed to find usages of the text that will definitely be a reference, rather than just a coincidental instance of the text.

@JohnnyMorganz JohnnyMorganz marked this pull request as draft August 6, 2023 10:15
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

Successfully merging this pull request may close these issues.

2 participants