php

package
v0.9.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

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

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:

  1. tree-sitter-php extracts HTML text nodes from PHP source
  2. 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) Close

func (h *Handler) Close()

Close cleans up resources

func (*Handler) CreateDocument

func (h *Handler) CreateDocument(uri, content string, version int32) types.Document

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

func (h *Handler) FindCustomElements(doc types.Document) ([]types.CustomElementMatch, error)

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

func (*Handler) Language

func (h *Handler) Language() string

Language returns the language identifier

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL