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.

() Update:* Nova released a lot of major updates since I developed this extension. I published it first when Nova 3 came out. Since Nova 7 they implemented most of the features I've developed in this extension, but my extension still fits my needs better.

To see how far they came I tried to get the same look with my Varia Theme for Nova's PHP and my advanced PHP highlighting. They're still some major differences. I focused more of the importance if strings and what kind of information they can hold. Also I tried to do a more logical separation of static keywords like: imports, processors, declarations, types and constants. I think when those features will be implement by Nova's standard PHP Syntax, my extension will be obsolete, but until then I will use it and try to improve it πŸ˜…

advanced PHP:

With Varia Theme:

standard PHP-HTML:

With Varia Theme:

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

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.2

  • add a statement to the README for Nova 7 and its PHP improvements

Version 2.2.1

  • fix parsing issue after \Exception call
  • more supported themes

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.