Remove graphql syntax as it causes issues, closes #236

This commit is contained in:
Adam Stankiewicz 2017-09-27 22:09:06 +02:00
parent 7673a61990
commit d5e38fa97b
No known key found for this signature in database
GPG Key ID: A62480DCEAC884DF
7 changed files with 0 additions and 193 deletions

View File

@ -71,7 +71,6 @@ Most importantly, vim-polyglot contains all runtime syntax files from upstream [
- [gmpl](https://github.com/maelvalais/gmpl.vim) (syntax)
- [gnuplot](https://github.com/vim-scripts/gnuplot-syntax-highlighting) (syntax)
- [go](https://github.com/fatih/vim-go) (syntax, compiler, indent)
- [graphql](https://github.com/jparise/vim-graphql) (syntax, indent, ftplugin)
- [groovy](https://github.com/vim-scripts/groovy.vim) (syntax)
- [haml](https://github.com/sheerun/vim-haml) (syntax, indent, compiler, ftplugin)
- [handlebars](https://github.com/mustache/vim-mustache-handlebars) (syntax, indent, ftplugin)

View File

@ -1,21 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
if exists('b:current_syntax')
let s:current_syntax = b:current_syntax
unlet b:current_syntax
endif
syn include @GraphQLSyntax syntax/graphql.vim
if exists('s:current_syntax')
let b:current_syntax = s:current_syntax
endif
syntax region graphqlTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`+ contains=@GraphQLSyntax,jsTemplateExpression,jsSpecial extend
exec 'syntax match graphqlTaggedTemplate +\%(' . join(g:graphql_javascript_tags, '\|') . '\)\%(`\)\@=+ nextgroup=graphqlTemplateString'
hi def link graphqlTemplateString jsTemplateString
hi def link graphqlTaggedTemplate jsTaggedTemplate
syn cluster jsExpression add=graphqlTaggedTemplate
syn cluster graphqlTaggedTemplate add=graphqlTemplateString
endif

1
build
View File

@ -141,7 +141,6 @@ PACKS="
glsl:tikhomirov/vim-glsl
gnuplot:vim-scripts/gnuplot-syntax-highlighting
go:fatih/vim-go:_BASIC
graphql:jparise/vim-graphql
groovy:vim-scripts/groovy.vim
haml:sheerun/vim-haml
handlebars:mustache/vim-mustache-handlebars

View File

@ -356,11 +356,6 @@ au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl
" vim: sw=2 ts=2 et
augroup END
augroup filetypedetect
" graphql:jparise/vim-graphql
au BufRead,BufNewFile *.graphql,*.graphqls,*.gql setfiletype graphql
augroup END
augroup filetypedetect
" groovy:vim-scripts/groovy.vim
augroup END

View File

@ -1,17 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
" Vim filetype plugin
" Language: GraphQL
" Maintainer: Jon Parise <jon@indelible.org>
if (exists('b:did_ftplugin'))
finish
endif
let b:did_ftplugin = 1
setlocal comments=:#
setlocal commentstring=#\ %s
setlocal formatoptions-=t
setlocal iskeyword+=$,@-@
endif

View File

@ -1,81 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
" Vim indent file
" Language: GraphQL
" Maintainer: Jon Parise <jon@indelible.org>
if exists('b:did_indent')
finish
endif
let b:did_indent = 1
setlocal autoindent
setlocal nocindent
setlocal nolisp
setlocal nosmartindent
setlocal indentexpr=GetGraphQLIndent()
setlocal indentkeys=0{,0},0),0[,0],0#,!^F,o,O,e
" If our indentation function already exists, we have nothing more to do.
if exists('*GetGraphQLIndent')
finish
endif
let s:cpo_save = &cpoptions
set cpoptions&vim
" Check if the character at lnum:col is inside a string.
function s:InString(lnum, col)
return synIDattr(synID(a:lnum, a:col, 1), 'name') is# 'graphqlString'
endfunction
function GetGraphQLIndent()
" If this is the first non-blank line, we have nothing more to do because
" all of our indentation rules are based on matching against earlier lines.
let l:prevlnum = prevnonblank(v:lnum - 1)
if l:prevlnum == 0
return 0
endif
let l:line = getline(v:lnum)
" If this line contains just a closing bracket, find its matching opening
" bracket and indent the closing backet to match.
let l:col = matchend(l:line, '^\s*[]})]')
if l:col > 0 && !s:InString(v:lnum, l:col)
let l:bracket = l:line[l:col - 1]
call cursor(v:lnum, l:col)
if l:bracket is# '}'
let l:matched = searchpair('{', '', '}', 'bW')
elseif l:bracket is# ']'
let l:matched = searchpair('\[', '', '\]', 'bW')
elseif l:bracket is# ')'
let l:matched = searchpair('(', '', ')', 'bW')
else
let l:matched = -1
endif
return l:matched > 0 ? indent(l:matched) : virtcol('.') - 1
endif
" If we're inside of a multiline string, continue with the same indentation.
if s:InString(v:lnum, matchend(l:line, '^\s*') + 1)
return indent(v:lnum)
endif
" If the previous line contained an opening bracket, and we are still in it,
" add indent depending on the bracket type.
if getline(l:prevlnum) =~# '[[{(]\s*$'
return indent(l:prevlnum) + shiftwidth()
endif
" Default to the existing indentation level.
return indent(l:prevlnum)
endfunction
let &cpoptions = s:cpo_save
unlet s:cpo_save
endif

View File

@ -1,67 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
" Vim syntax file
" Language: GraphQL
" Maintainer: Jon Parise <jon@indelible.org>
if exists('b:current_syntax')
finish
endif
syn match graphqlComment "#.*$" contains=@Spell
syn match graphqlOperator "="
syn match graphqlOperator "!"
syn match graphqlOperator "|"
syn match graphqlOperator "\M..."
syn keyword graphqlBoolean true false
syn keyword graphqlNull null
syn match graphqlNumber "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>"
syn region graphqlString start=+"+ skip=+\\\\\|\\"+ end=+"\|$+
syn keyword graphqlKeyword on nextgroup=graphqlType skipwhite
syn keyword graphqlStructure enum scalar type union nextgroup=graphqlType skipwhite
syn keyword graphqlStructure input interface subscription nextgroup=graphqlType skipwhite
syn keyword graphqlStructure implements nextgroup=graphqlType skipwhite
syn keyword graphqlStructure query mutation fragment nextgroup=graphqlIdentifier skipwhite
syn keyword graphqlStructure directive nextgroup=graphqlDirective skipwhite
syn keyword graphqlStructure extend nextgroup=graphqlStructure skipwhite
syn match graphqlDirective "\<@\h\w*\>" display
syn match graphqlVariable "\<\$\h\w*\>" display
syn match graphqlIdentifier "\<\h\w*\>" display contained
syn match graphqlType "\<_*\u\w*\>" display contained
syn match graphqlConstant "\<[A-Z_]\+\>" display contained
syn keyword graphqlMetaFields __schema __type __typename
syn region graphqlFold matchgroup=graphqlBraces start="{" end=/}\(\_s\+\ze\("\|{\)\)\@!/ transparent fold contains=ALLBUT,graphqlStructure
syn region graphqlList matchgroup=graphqlBraces start="\[" end=/]\(\_s\+\ze"\)\@!/ transparent contains=ALLBUT,graphqlDirective,graphqlStructure
hi def link graphqlComment Comment
hi def link graphqlOperator Operator
hi def link graphqlBraces Delimiter
hi def link graphqlBoolean Boolean
hi def link graphqlNull Keyword
hi def link graphqlNumber Number
hi def link graphqlString String
hi def link graphqlConstant Constant
hi def link graphqlDirective PreProc
hi def link graphqlIdentifier Identifier
hi def link graphqlMetaFields Special
hi def link graphqlKeyword Keyword
hi def link graphqlStructure Structure
hi def link graphqlType Type
hi def link graphqlVariable Identifier
syn sync minlines=500
let b:current_syntax = 'graphql'
endif