dafintellisense adds IntelliSense for DAF component tags in PHP view files.
- Designed for DAF tags used in
*.view.phpfiles. - 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 ...).
Primary source of truth is PHP class properties:
publictyped properties only.- Property name must start with uppercase (
Message,Type,For). - Ignores non-public, untyped, and
staticproperties. - 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:
// ...
- multiline docblock:
required = trueonly 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";
}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.
For recognized DAF tags in *.view.php:
- Namespace part is colored white.
- Final component name is colored by
daf.tagNameColor(default#4ec9b0).
daf.namespaces(string[]): Additional component namespaces.- Examples:
views\\Shared\\*,Shared\\*,Auth\\Login
- Examples:
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"]
- Example:
- PHP must be available in
PATH. - Workspace should include your app and/or vendor component sources.
- Vendor PHAR components are supported.
- Built-in skipped PHAR files:
DafDb.phar,DafGlobals.phar. - PHAR cache is rebuilt on extension activation.
See CHANGELOG.md.