-
Notifications
You must be signed in to change notification settings - Fork 97
Intelij LSP integration plugin based on LSP4IJ #2087
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
base: main
Are you sure you want to change the base?
Conversation
…nOptions class - Revised PLUGIN_DEV_NOTES to reflect the current status and next steps for the Tinymist language server integration, including completion of Phase 1 and Phase 2. - Introduced TinymistInitializationOptions class to structure initialization options for the language server, mirroring VSCode configuration. - Enhanced TinymistLspStreamConnectionProvider to utilize the new initialization options structure.
…ionality - Introduced a new development notes file detailing the project scope, current status, next steps, and identified technical debt for the Tinymist IntelliJ plugin. - Implemented TypstPreviewFileEditor and TypstTextEditorWithPreviewProvider to enable a split view for Typst files, integrating a JCEF-based preview panel. - Updated plugin.xml to register the new preview editor and removed the previously planned tool window for Typst preview. - Cleaned up unused code in TypstLexerAdapter and ensured proper handling of the preview functionality.
|
okay it seems as some slop wasnt cleaned up before. I gone take care of that |
…impl dependency; doesnt build yet - Added an explicit dependency on `platform-impl` in the build configuration to ensure proper functionality. - Updated `TypstPreviewFileEditor` to improve the loading of the preview page with local assets, including a JavaScript bridge for communication between the IntelliJ plugin and the preview content. - Enhanced error handling and logging for better debugging during the preview loading process. - Cleaned up development notes to reflect the current state and future plans for the Typst integration.
…components - Updated `TypstPreviewFileEditor` to directly load the Tinymist preview server URL, enhancing the integration with the background preview functionality. - Removed the `TypstPreviewResourceHandler` and related resource handling code, as the preview server now serves all necessary assets. - Cleaned up the `TinymistLspStreamConnectionProvider` to streamline initialization options and command execution. - Updated development notes to reflect changes in the preview strategy and current project status. - Adjusted `.gitignore` to include new entries for IntelliJ platform files.
…and error handling - Refactored `TypstPreviewFileEditor` to extend `JCEFHtmlPanel`, enhancing the integration with the JCEF browser. - Implemented a new loading mechanism for the Tinymist preview server, including improved error handling and user feedback. - Added a label to inform users when JCEF is not supported in their environment. - Updated `.gitignore` to exclude Kotlin-related files.
- Modified `.cursorignore` to comment out the IntelliJ community directory for better indexing. - Updated `Cargo.lock` and `Cargo.toml` to reflect changes in the `tinymist-assets` dependency path. - Added new IntelliJ project configuration files, including `.gitignore`, `compiler.xml`, `encodings.xml`, and others to enhance project setup. - Enhanced `TypstPreviewFileEditor` with additional logging for better debugging and performance tracking. - Introduced a new `trace.json` file for performance analysis of the preview functionality. - Updated development notes to include current focus on preview panel scrolling performance and ongoing investigations.
…lliJ integration - Consolidated project status and next steps into a structured roadmap format. - Documented completed milestones, current focus on preview panel performance, and identified technical debt. - Clarified the role of the IntelliJ plugin in the preview architecture and outlined future enhancements, including settings panel implementation and robust executable handling. - Removed outdated sections and streamlined content for better clarity and organization.
…oject roadmap for Tinymist IntelliJ plugin
…re consistency - Removed dead code and placeholder logic (OutlineDataHolder, mock outline, unused updateOutline). - Deleted and then restored a minimal TypstPreviewFileEditorProvider to serve as the preview editor provider. - Updated TypstTextEditorWithPreviewProvider to use the correct preview provider. - Cleaned up plugin.xml by removing commented-out tool window registration. - Ensured all code is consistent with dev-notes and current architecture.
- Added a new `TypstFindUsagesProvider` to support finding usages of named elements in Typst files, delegating scanning to the LSP. - Improved `TypstPreviewFileEditor` by ensuring the display handler is set up correctly and logging JavaScript console messages for better debugging. - Updated development notes with detailed insights into frontend performance investigations and ongoing debugging efforts related to the JCEF-based preview panel.
…ure view components as they are allready done by lps4ij - Deleted `TypstLexerAdapter`, `TypstParserDefinition`, `TypstSyntaxHighlighter`, and related structure view classes to clean up the codebase. - These components were no longer necessary following recent refactoring and enhancements to the Typst integration.
…ations which are allready done by lsp4ij - Updated the `lsp4ij` plugin dependency to version `0.13.0`. - Added a new lexer definition for Typst, improving the language parsing capabilities. - Introduced a new BNF grammar file for Typst, establishing a foundation for syntax parsing. - Removed outdated `TinymistOutlineModel` and `TypstFindUsagesProvider` classes to streamline the codebase. - Updated development notes to reflect changes in the architecture and language support.
|
I move and edit the dev-notes. The bigest change is that we remove these two steps because we develop the intellij plugin from the root directory: I mainly edit the development instructions, and leave rest part untouched. TBH, the rest parts may be summarized by LLM-powered search engine, for example, deep-wiki. I'm okay if we maintain an overview for people. |
| | `textDocument/documentSymbol` | ✅ Implemented | Handled by lsp4ij | Document outline/structure view | | ||
| | `textDocument/inlayHint` | ✅ Implemented | Handled by lsp4ij | Inlay additional information into code editor, i.e. the names of function parameters | | ||
| | `textDocument/codeAction` | ✅ Implemented | Handled by lsp4ij | Code fixes and refactoring actions | | ||
| | `textDocument/formatting` | ❌ Not implemented | - | Document formatting | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lsp4j can support it, why you say not implemented ?
| | `textDocument/inlayHint` | ✅ Implemented | Handled by lsp4ij | Inlay additional information into code editor, i.e. the names of function parameters | | ||
| | `textDocument/codeAction` | ✅ Implemented | Handled by lsp4ij | Code fixes and refactoring actions | | ||
| | `textDocument/formatting` | ❌ Not implemented | - | Document formatting | | ||
| | `textDocument/rangeFormatting` | ❌ Not implemented | - | Range-based formatting | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lsp4j can support it, why you say not implemented ?
| | `textDocument/codeAction` | ✅ Implemented | Handled by lsp4ij | Code fixes and refactoring actions | | ||
| | `textDocument/formatting` | ❌ Not implemented | - | Document formatting | | ||
| | `textDocument/rangeFormatting` | ❌ Not implemented | - | Range-based formatting | | ||
| | `textDocument/onTypeFormatting` | ❌ Not implemented | - | Format-on-type | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lsp4j can support it, why you say not implemented ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested it and it did not work, however im not sure if tinymist supports it all, which is why I have left the note as unimplemented
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest that you enable LSP console (set Trace as verbose in Debug tab and save it) and you will see the capabilities returned by your LSP server(do a search with onTypeFormatting)
| | `textDocument/formatting` | ❌ Not implemented | - | Document formatting | | ||
| | `textDocument/rangeFormatting` | ❌ Not implemented | - | Range-based formatting | | ||
| | `textDocument/onTypeFormatting` | ❌ Not implemented | - | Format-on-type | | ||
| | `textDocument/codeLens` | ❌ Not implemented | - | Inline code annotations | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lsp4j can support it, why you say not implemented ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will also need to customly implement code lens actions, which I have not done yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed but codelens should be displayed (handled by LSP4IJ), right?
| | `textDocument/codeLens` | ❌ Not implemented | - | Inline code annotations | | ||
| | `textDocument/foldingRange` | ✅ Implemented | Handled by lsp4ij | Code folding regions | | ||
| | `textDocument/selectionRange` | ✅ Implemented | Handled by lsp4ij | Smart text selection | | ||
| | `textDocument/prepareCallHierarchy` | ❌ Not implemented | - | Call hierarchy preparation | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lsp4j can support it, why you say not implemented ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prepareCallHierarchy also did not work in my experiments, however im not sure, where its failing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again I suggest that you enable LSP console to see if LSP request are called and if LSP server returns the proper capability.
|
Since I have run it successfully on my computer, I believe this PR has made some significant process. It is not a problem if there are still some bugs or bad smells in current implementation, instead the only missing is to add a CI to ensure the plugin to build. We should merge it once a simple CI is built. The CI must produce some artifacts to help people use the plugin without building locally. I don't know what specific artifacts to produce, but may be some bundle like
|
I could also just move the build files to the tinymist root if you want. |
Great to hear! Im going to work on the CI. |
|
regarding the plugin logo: I found an icon called tinymist.png. However intellij demands an svg. Do you still have that? |
See #1744 for more details