better-cpp-syntax icon indicating copy to clipboard operation
better-cpp-syntax copied to clipboard

Allow to inject custom language grammars dynamically

Open denis-shienkov opened this issue 4 years ago • 0 comments

Hi all.

I'm currently in a process of creation of a some VSCode extension for a some build system.

This build system allows to compile the C/CPP projects using the different toolchains (not only the GCC/MSVC/CLANG, but also and SDCC, IAR, KEIL and etc), and the different CPU architectures (not only the x86/ARM, but also and 8051, AVR and etc).

But my problem is that some toolchains provides a custom keywords for some architectures. So, I need in abitily to somehow inject an additional C/CPP compiler keywords in a 'dymanic" way.

E.g. when I use the IAR toolchain for the 8051 architecture, then I need in some additional compiler keywords, like _data, _at and etc. But, when I use the ARM toolchain for the ARM architecture, then I don't need in this keywords.

I can take the current used toolchain type, and the CPU architecture from a build ystem, this is not a problem.

A problem is how to inject the additional language keywords dynamically.

Could someone help me in this issue? Is it possible at all?

PS: I already have created the related issues here:

  • https://github.com/microsoft/vscode-cpptools/issues/6642
  • https://github.com/microsoft/vscode/issues/113496

So, you can look there a some detailed information.

denis-shienkov avatar Dec 29 '20 11:12 denis-shienkov