Documentation
¶
Overview ¶
Copyright © 2025 Benny Powers <[email protected]>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- type Handler
- func (h *Handler) AnalyzeCompletionContext(doc types.Document, position protocol.Position) *types.CompletionAnalysis
- func (h *Handler) Close()
- func (h *Handler) CreateDocument(uri, content string, version int32) types.Document
- func (h *Handler) FindAttributeAtPosition(doc types.Document, position protocol.Position) (*types.AttributeMatch, string)
- func (h *Handler) FindCustomElements(doc types.Document) ([]types.CustomElementMatch, error)
- func (h *Handler) FindElementAtPosition(doc types.Document, position protocol.Position) *types.CustomElementMatch
- func (h *Handler) Language() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler implements language-specific operations for PHP documents. It uses a two-stage pipeline:
- tree-sitter-php extracts HTML text nodes from PHP source
- The HTML handler parses the reconstructed HTML for custom elements
PHP blocks are replaced with whitespace to preserve line/column positions.
func NewHandler ¶
func NewHandler(htmlHandler types.LanguageHandler) (*Handler, error)
NewHandler creates a new PHP language handler
func (*Handler) AnalyzeCompletionContext ¶
func (h *Handler) AnalyzeCompletionContext(doc types.Document, position protocol.Position) *types.CompletionAnalysis
AnalyzeCompletionContext delegates to the HTML handler
func (*Handler) CreateDocument ¶
CreateDocument creates a new PHP document by extracting HTML and delegating to the HTML handler
func (*Handler) FindAttributeAtPosition ¶
func (h *Handler) FindAttributeAtPosition(doc types.Document, position protocol.Position) (*types.AttributeMatch, string)
FindAttributeAtPosition delegates to the HTML handler
func (*Handler) FindCustomElements ¶
FindCustomElements delegates to the HTML handler
func (*Handler) FindElementAtPosition ¶
func (h *Handler) FindElementAtPosition(doc types.Document, position protocol.Position) *types.CustomElementMatch
FindElementAtPosition delegates to the HTML handler