Novaβ„’

Extensions


Readme

advanced PHP πŸ”₯

advanced PHP provides syntax highlighting for special PHP writing. It is also fully compatible with HTML, you don't need to switch between syntaxes.

Note: you need a compatible Theme, like Varia Theme, for proper highlighting.

Why, though? πŸ€”

Nova is a pretty editor with rich features, but it seems in lacking for language support. Because I'm a long time Sublime Text 3 user I wanted to get some fresh air and started looking into Nova. Unfortunately all my projects looked horrible with the standard PHP-HTML syntax, so I started building this extension.

Nova is still fresh and can't compete in terms of extensions with other editors which are on the market for years now. But this for sure will change.

Language Support 🧩

advanced PHP currently supports the following features:

βœ… compatible with HTML

βœ… variable substitution

βœ… variable substitution with curly brackets

βœ… SQL recognition within strings

βœ… CURL-, WP-Constants

βœ… separation between function parameters, arguments, variables and this

βœ… separation between different elements like declarations, methods, variable prefixes etc.

βœ… supports Nova's rainbow brackets option

βœ… supports Nova's hierarchical subtree

βœ… supports Nova's function folding

βœ… offers completions and suggestions

advanced PHP:

With Varia Theme:

standard PHP-HTML:

With standard "Palette" theme:

Theming 🎨

πŸ‘‰ supported Themes

πŸ‘‰ Development

The syntax provides an easy way to style the syntax for theme developers. As a theme developer please let me know if your theme supports "advanced PHP". ✌️

Statics

advphp.static.condition { 
    if, else, elseif, foreach, ...
}
advphp.static.processor { 
    echo, return, print, ...
}
advphp.static.declaration {
    new, public, private, ...
}
advphp.static.import {
    include, require, ...
}
advphp.static.constant {
    __DIR__, __METHOD__, ...
}
advphp.static.wordOperator {
    AND, OR, XOR, ...
}

Wordpress Keywords

advphp.wp.keywords {
    ABSPATH, WP_ADMIN, ...
}

CURL Keywords

advphp.curl.keywords {
    CURLOPT_HEADER, CURLOPT_PROXY, ...
}

SQL Keywords

advphp.sql.keywords {
    SELECT, FROM, WHERE, ...
}

Syntax

advphp.operator {
    +, -, /, >, ...
}
advphp.bracket {
    [], {}, (), "", ...
}
advphp.delimiter {
    ,
}
advphp.semicolon {
    ;
}

Variables

advphp.identifier.variable.prefix {
    $
}
advphp.identifier.variable.name {
    $variable
}
advphp.identifier.variable.this {
    $this
}

Functions

advphp.identifier.function.keyword {
    function
}
advphp.identifier.function.name {
    my_function()
}
advphp.identifier.parameter.prefix {
    my_function($parameter) {}
}
advphp.identifier.parameter.name {
    my_function($parameter) {}
}

Objects

advphp.identifier.object.name {
    Object::
}

Namespace

advphp.definition.namespace {
    Name\Space
}

Strings

advphp.string,
advphp.value.string,
advphp.string.doubleQuote,
advphp.string.singleQuote, {
    "string", 'string'
}

advphp.string.backTic {
    `string`
}

Contribution 🀝

This is my first extension for Nova or any other IDE. So, if you feel to improve things, then you are more than welcome. πŸ˜…


Changelog

Version 2.2.0

  • add namespace highlighting

Version 2.1.3

  • add custom semicolon highlighting

Version 2.1.2

  • add more static keywords

Version 2.1.1

  • more supported themes

Version 2.1.0

  • add more PHP constants
  • add Wordpress keywords

Issue Fixes:

  • CURL keywords recognition
  • escaping within double quotes string

Version 2.0.0

  • Nova 4 support (if you don't use Nova 4, please stay at v1.1.2 since Nova made some changes to syntax file parsing)

Version 1.1.2

  • add CURL keywords

Version 1.1.1

  • add SQL keywords
  • add more PHP constants

Version 1.1.0

  • SQL recognition within strings

Version 1.0.1

  • README changes

Version 1.0.0

  • PHP suggestions
  • better completions
  • hierarchy subtree
  • extended keywords list
  • function folding

Issue Fixes:

  • commenting shortcut PHP within HTML
  • selecting variable with prefix at double-click
  • escaping characters within double-quotes

Version 0.9.0 (Beta)

  • initial build

License

MIT License

Copyright (c) 2020

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.