feat: expose public API for custom syntax parsers
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- developer-experience
Research direction
Start by reading the syntax parser implementation and package exports referenced by the issue, then inspect extensions/tree-sitter/integration.lisp and PR #2046 to understand how the extension uses the parser protocol. Define and document the public class and scanning API, and update the integration to use exported symbols; done when custom parsers can use the documented public API without internal symbol access.
Written by the indexing model from the issue text.
Description
Summary
Currently, implementing a custom syntax parser (like tree-sitter integration) requires using internal symbols:
lem/buffer/internal::syntax-parser- base class for custom parserslem/buffer/internal::%syntax-scan-region- method to implement syntax scanning
Background
In PR #2046 (tree-sitter integration), we needed to create a custom syntax parser that integrates with Lem's syntax highlighting system. While we refactored to use public APIs for text property manipulation (put-text-property, remove-text-property, text-property-at), the parser class itself still requires internal symbol access.
Current Implementation
;; extensions/tree-sitter/integration.lisp
(defclass treesitter-parser (lem/buffer/internal::syntax-parser)
...)
(defmethod lem/buffer/internal::%syntax-scan-region ((parser treesitter-parser) start end)
...)
Proposal
Export a public API for custom syntax parsers:
- Export
syntax-parserclass fromlemorlem-corepackage - Export
%syntax-scan-regiongeneric function (possibly renamed tosyntax-scan-region) - Document the protocol for implementing custom syntax parsers
Benefits
- Enables extensions to implement custom syntax highlighting without internal symbol access
- Follows Lem's convention of using exported symbols
- Makes the syntax parser extension point official and stable
Related
- PR #2046: tree-sitter syntax highlighting integration
- Dominant language
- Common Lisp
- Stars
- 3.1k
- Forks
- 261
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 133
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lem-project/lem
-
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
lem-project/lem#2525 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
lem-project/lem#2524 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
lem-project/lem#2488 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
lem-project/lem#2369 ·
Maintainers usually reply within 1 day
-
unix-paste-bugOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
lem-project/lem#2360 ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
mcpx scan: flag unsafe tool namesPossibly taken @zeyadbadawyy claimed this today. Openarea/scan enhancement good first issue priority/medium size/small
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rohitgollarahalli/mcpx#45 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
facebookresearch/atlas-lean#20218 ·
Maintainers usually reply within 1 day