feat: separating compiler/lint diagnostics#2302
feat: separating compiler/lint diagnostics#2302hongjr03 wants to merge 8 commits intoMyriad-Dreamin:mainfrom
Conversation
Summary of ChangesHello @hongjr03, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the diagnostic reporting system to differentiate between compiler and lint diagnostics. By introducing new data structures and modifying the diagnostic publishing pipeline, the system can now handle and present these two types of issues separately, leading to a more organized and informative diagnostic experience for users. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively separates compiler and lint diagnostics, which is a great improvement for clarity. The changes are well-implemented across the affected crates. I've provided a couple of suggestions to enhance the code further: one to improve performance by avoiding an unnecessary collection and another to increase maintainability by refactoring duplicated code.
63dca2c to
05062ec
Compare
…ting compiler/lint diagnostics
…iagnostic management
…mpiler diagnostics and a new `LintHook` for lint-specific diagnostics.
…, replacing individual handlers for diagnostics, linting, preview, and export.
…ector initialization.
cce57ec to
5dbcd4e
Compare
This pull request refactors how diagnostics and editor notifications are handled, introducing a more modular and extensible system for reporting diagnostics from both the compiler and the lint engine. The changes separate compiler and lint diagnostics, introduce a new hook-based architecture for compile-time notifications, and update the data structures and APIs throughout the codebase to support these improvements.
Diagnostics Handling and Data Structures:
DiagnosticsResultstruct to encapsulate both compiler and lint diagnostics, replacing the previous singleDiagnosticsMapresponse inCheckRequest.DiagKindenum andDiagKeystruct to distinguish and track diagnostics from different sources (compiler vs. lint) per project, updating all related data structures and methods inEditorActoraccordingly. [1] [2]Editor Notification and API Changes:
EditorRequest::Diagvariant and related methods to accept aDiagKind, allowing the editor to receive and manage diagnostics from multiple sources independently. [1] [2] [3] [4]DiagKindparameter, ensuring correct routing and clearing of diagnostics for both compiler and lint results. [1] [2] [3]Hook-Based Compile Notification System:
CompileHookand implemented it forDiagHook,LintHook,PreviewHook, andExportHook, enabling modular notification logic for different compile-time events (diagnostics, preview updates, export tasks).CompileHandlerImplto accept and use a list ofCompileHookobjects, replacing inline notification logic with calls to these hooks for improved extensibility and separation of concerns. [1] [2] [3] [4] [5]Project State and Feature Handling:
These changes make the diagnostics system more robust, allow for future extensibility (e.g., adding more diagnostic sources), and improve the maintainability of compile-time notification logic.