language-cython-for-vscode icon indicating copy to clipboard operation
language-cython-for-vscode copied to clipboard

Improve it (just small changes are needed)

Open Naereen opened this issue 6 years ago • 6 comments

Hi! Thanks for this extension!

Could it be possible to improve it, to support some syntax that are not yet supported?

  • from ... cimport ... the cimport should be colored as import
  • 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 color flat

Thanks in advance (if you can fix this)

Naereen avatar Apr 30 '18 14:04 Naereen

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.

guyskk avatar May 03 '18 11:05 guyskk

Hi, No problem. Do you think we could try to improve it?

Naereen avatar May 03 '18 11:05 Naereen

  • We should work on MagicPython file grammars/src/MagicPython.syntax.yaml, not on the generated Cython.tmLanguage.
  • Here is a first proposal to fix at least the cdef and cimport issues, https://github.com/guyskk/language-cython-for-vscode/pull/2. See this screenshot for example (before / after): first try of new cython language before first try of new cython language

Naereen avatar May 03 '18 11:05 Naereen

That's very basic, but it's almost enough for me.

Naereen avatar May 03 '18 11:05 Naereen

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!~

cmpute avatar Dec 14 '18 03:12 cmpute

And also highlighting for C/C++ types are missing: double, short, long, char, struct, unsigned

cmpute avatar Dec 14 '18 03:12 cmpute