Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add Support for PHP HEREDOC Strings #61

Closed
phatsk opened this issue Sep 7, 2020 · 1 comment · Fixed by #68
Closed

Feature: Add Support for PHP HEREDOC Strings #61

phatsk opened this issue Sep 7, 2020 · 1 comment · Fixed by #68
Labels

Comments

@phatsk
Copy link

phatsk commented Sep 7, 2020

PHP has support for HEREDOC strings. This allows large string blocks to be set between delimiters and vim supports syntax highlighting within these blocks.

In PHP in vim, using a HEREDO specifier such as SQL will cause vim to highlight the given block:

<?php
$my_query = <<<SQL
SELECT * FROM my_tables WHERE foo='bar';
SQL;

This proposal is to have the same kind of support for GraphQL queries:

<?php
$my_query = <<<GQL
{
    posts {
        id
        title
        author
    }
    category
}
GQL;

Screenshot

image

Vim Version

NVIM v0.5.0-nightly
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/tmp/neovim-20200316-52073-155cxzr/build/config -I/tmp/neovim-20200316-52073-155cxzr/src -I/usr/local/include -I/tmp/neovim-20200316-52073-155cxzr/deps-build/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -I/usr/local/opt/gettext/include -I/tmp/neovim-20200316-52073-155cxzr/build/src/nvim/auto -I/tmp/neovim-20200316-52073-155cxzr/build/include
Compiled by zachowen@MacBook-Pro

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/HEAD-2b00d1d/share/nvim"

Run :checkhealth for more info

@jparise
Copy link
Owner

jparise commented Nov 11, 2020

@phatsk I just added PHP support. Let me know how it works or if you run into any issues with it.

Thanks for the suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants