[PR #453] [MERGED] Switch to adapter pattern #561

Closed
opened 2025-12-30 01:25:20 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/apple/pkl/pull/453
Author: @bioball
Created: 4/25/2024
Status: Merged
Merged: 4/26/2024
Merged by: @stackoverflow

Base: lsp-setupHead: lsp-setup


📝 Commits (2)

📊 Changes

28 files changed (+1571 additions, -1858 deletions)

View changed files

📝 pkl-lsp/src/main/kotlin/org/pkl/lsp/Builder.kt (+39 -18)
📝 pkl-lsp/src/main/kotlin/org/pkl/lsp/ErrorMessages.kt (+18 -2)
📝 pkl-lsp/src/main/kotlin/org/pkl/lsp/LSPUtil.kt (+8 -4)
📝 pkl-lsp/src/main/kotlin/org/pkl/lsp/PklLSPServer.kt (+3 -3)
pkl-lsp/src/main/kotlin/org/pkl/lsp/analyzers/Analyzer.kt (+43 -0)
pkl-lsp/src/main/kotlin/org/pkl/lsp/analyzers/ModifierAnalyzer.kt (+121 -0)
📝 pkl-lsp/src/main/kotlin/org/pkl/lsp/analyzers/PklDiagnostic.kt (+13 -10)
📝 pkl-lsp/src/main/kotlin/org/pkl/lsp/analyzers/StringLiteralAnalyzer.kt (+6 -10)
📝 pkl-lsp/src/main/kotlin/org/pkl/lsp/analyzers/SyntaxAnalyzer.kt (+8 -3)
pkl-lsp/src/main/kotlin/org/pkl/lsp/ast/Basic.kt (+34 -0)
pkl-lsp/src/main/kotlin/org/pkl/lsp/ast/Expr.kt (+155 -0)
pkl-lsp/src/main/kotlin/org/pkl/lsp/ast/Member.kt (+96 -0)
pkl-lsp/src/main/kotlin/org/pkl/lsp/ast/ModuleOrClass.kt (+132 -0)
pkl-lsp/src/main/kotlin/org/pkl/lsp/ast/Node.kt (+421 -0)
📝 pkl-lsp/src/main/kotlin/org/pkl/lsp/ast/Span.kt (+1 -1)
pkl-lsp/src/main/kotlin/org/pkl/lsp/ast/Terminal.kt (+145 -0)
pkl-lsp/src/main/kotlin/org/pkl/lsp/ast/TokenType.kt (+135 -0)
pkl-lsp/src/main/kotlin/org/pkl/lsp/ast/Type.kt (+54 -0)
pkl-lsp/src/main/kotlin/org/pkl/lsp/cst/CstBuilder.kt (+0 -1088)
pkl-lsp/src/main/kotlin/org/pkl/lsp/cst/DocComment.kt (+0 -18)

...and 8 more files

📄 Description

This switches the LSP implementation to use the adapter pattern, deferring as much as possible to the ANTLR-generated classes.

It also gets rid of CstBuilder, instead moving diagnostic handling to the analyzers.

It's not complete but provides a skeleton to be filled in.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/apple/pkl/pull/453 **Author:** [@bioball](https://github.com/bioball) **Created:** 4/25/2024 **Status:** ✅ Merged **Merged:** 4/26/2024 **Merged by:** [@stackoverflow](https://github.com/stackoverflow) **Base:** `lsp-setup` ← **Head:** `lsp-setup` --- ### 📝 Commits (2) - [`ca34809`](https://github.com/apple/pkl/commit/ca34809c255858de3cedfd15e82d54bd9e7153a3) Switch to adapter pattern - [`7644913`](https://github.com/apple/pkl/commit/764491341f866fee6f25c44c4fa9648eb435d54d) wip ### 📊 Changes **28 files changed** (+1571 additions, -1858 deletions) <details> <summary>View changed files</summary> 📝 `pkl-lsp/src/main/kotlin/org/pkl/lsp/Builder.kt` (+39 -18) 📝 `pkl-lsp/src/main/kotlin/org/pkl/lsp/ErrorMessages.kt` (+18 -2) 📝 `pkl-lsp/src/main/kotlin/org/pkl/lsp/LSPUtil.kt` (+8 -4) 📝 `pkl-lsp/src/main/kotlin/org/pkl/lsp/PklLSPServer.kt` (+3 -3) ➕ `pkl-lsp/src/main/kotlin/org/pkl/lsp/analyzers/Analyzer.kt` (+43 -0) ➕ `pkl-lsp/src/main/kotlin/org/pkl/lsp/analyzers/ModifierAnalyzer.kt` (+121 -0) 📝 `pkl-lsp/src/main/kotlin/org/pkl/lsp/analyzers/PklDiagnostic.kt` (+13 -10) 📝 `pkl-lsp/src/main/kotlin/org/pkl/lsp/analyzers/StringLiteralAnalyzer.kt` (+6 -10) 📝 `pkl-lsp/src/main/kotlin/org/pkl/lsp/analyzers/SyntaxAnalyzer.kt` (+8 -3) ➕ `pkl-lsp/src/main/kotlin/org/pkl/lsp/ast/Basic.kt` (+34 -0) ➕ `pkl-lsp/src/main/kotlin/org/pkl/lsp/ast/Expr.kt` (+155 -0) ➕ `pkl-lsp/src/main/kotlin/org/pkl/lsp/ast/Member.kt` (+96 -0) ➕ `pkl-lsp/src/main/kotlin/org/pkl/lsp/ast/ModuleOrClass.kt` (+132 -0) ➕ `pkl-lsp/src/main/kotlin/org/pkl/lsp/ast/Node.kt` (+421 -0) 📝 `pkl-lsp/src/main/kotlin/org/pkl/lsp/ast/Span.kt` (+1 -1) ➕ `pkl-lsp/src/main/kotlin/org/pkl/lsp/ast/Terminal.kt` (+145 -0) ➕ `pkl-lsp/src/main/kotlin/org/pkl/lsp/ast/TokenType.kt` (+135 -0) ➕ `pkl-lsp/src/main/kotlin/org/pkl/lsp/ast/Type.kt` (+54 -0) ➖ `pkl-lsp/src/main/kotlin/org/pkl/lsp/cst/CstBuilder.kt` (+0 -1088) ➖ `pkl-lsp/src/main/kotlin/org/pkl/lsp/cst/DocComment.kt` (+0 -18) _...and 8 more files_ </details> ### 📄 Description This switches the LSP implementation to use the adapter pattern, deferring as much as possible to the ANTLR-generated classes. It also gets rid of `CstBuilder`, instead moving diagnostic handling to the analyzers. It's not complete but provides a skeleton to be filled in. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 01:25:20 +01:00
adam closed this issue 2025-12-30 01:25:20 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#561