language-cython-for-vscode
language-cython-for-vscode copied to clipboard
Improve it (just small changes are needed)
Hi! Thanks for this extension!
Could it be possible to improve it, to support some syntax that are not yet supported?
-
from ... cimport ...
thecimport
should be colored asimport
-
cdef [type] variable
cdef should be colored as keyword -
cdef function
same - in def/cdef function definitions, types before variable names should be correctly colored:
def test(float x, float y)
should colorflat
Thanks in advance (if you can fix this)
Hi, the grammar was just copyed from https://github.com/MagicStack/MagicPython. But I have no time to improve it recently, also sorry for the delayed reply.
Hi, No problem. Do you think we could try to improve it?
- We should work on MagicPython file
grammars/src/MagicPython.syntax.yaml
, not on the generatedCython.tmLanguage
. - Here is a first proposal to fix at least the
cdef
andcimport
issues, https://github.com/guyskk/language-cython-for-vscode/pull/2. See this screenshot for example (before / after):
That's very basic, but it's almost enough for me.
There are some keywords need to be highlighted: cppclass
, extern
, namespace
, void
, api
, public
, const
. These keywords are all related to interop with C/C++ code. Hope these could be added!~
And also highlighting for C/C++ types are missing: double
, short
, long
, char
, struct
, unsigned