Skip to content

Latest commit

 

History

History
96 lines (71 loc) · 2.92 KB

File metadata and controls

96 lines (71 loc) · 2.92 KB

Daf - IntelliSense

dafintellisense adds IntelliSense for DAF component tags in PHP view files.

Features

  • Designed for DAF tags used in *.view.php files.
  • Component tag completion when typing <....
  • Supports simple and namespaced component tags, for example:
    • <Alert />
    • <Components\Alert />
    • <App\Views\Components\Alert />
  • Go to Definition (Ctrl/Cmd+Click) on component tag names.
  • Hover documentation for component tags.
  • Parameter autocomplete inside DAF opening tags.
    • Triggered after typing space inside the tag.
    • Prioritizes required params in suggestions.
    • Hides params already used in the same tag.
  • Parameter hover tooltip when hovering attribute names.
  • Parameter spelling diagnostics for uppercase DAF attributes.
    • Warns on unknown params.
    • Offers quick fix suggestions (Did you mean ...).

Component Parameter Model

Primary source of truth is PHP class properties:

  • public typed properties only.
  • Property name must start with uppercase (Message, Type, For).
  • Ignores non-public, untyped, and static properties.
  • Includes inherited properties declared on parent classes that extend DafCore\Component.
  • Excludes properties declared on base DafCore\Component.
  • Description is read from the comment directly above the property:
    • multiline docblock: /** ... */
    • single-line comment: // ...
  • required = true only when property type is non-nullable and no default value is defined.
  • Otherwise required = false.

If no valid properties are found, the extension falls back to legacy @daf-param.

Example (property-based):

/**
 * @daf-summary Alert box component.
 */
class Alert extends Component {
    // Text to display
    public string $Message = "";

    /**
     * Visual style
     */
    public string $Type = "info";
}

DAF Doc Tags

The extension also reads:

  • @daf-summary
  • @daf-note
  • @daf-param (legacy fallback only when no valid property params exist)

Standalone view components (*.view.php without a class) can still use doc tags for docs and params.

Tag Coloring

For recognized DAF tags in *.view.php:

  • Namespace part is colored white.
  • Final component name is colored by daf.tagNameColor (default #4ec9b0).

Extension Settings

  • daf.namespaces (string[]): Additional component namespaces.
    • Examples: views\\Shared\\*, Shared\\*, Auth\\Login
  • daf.tagNameColor (string): Color for the component name segment.
  • daf.skipPhars (string[]): PHAR files to skip during indexing (file names or path fragments).
    • Example: ["LegacyPackage.phar", "vendor/private/BigPack.phar"]

Requirements

  • PHP must be available in PATH.
  • Workspace should include your app and/or vendor component sources.

Notes

  • Vendor PHAR components are supported.
  • Built-in skipped PHAR files: DafDb.phar, DafGlobals.phar.
  • PHAR cache is rebuilt on extension activation.

Release Notes

See CHANGELOG.md.