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
Make it possible to define custom compiler keywords #6642
Comments
Hi @denis-shienkov . Thanks for suggesting this. We will consider this for a future milestone. |
Guys,
Someting like this: ==
== iar-c-cpp.tmLanguage.json ==
But, here I'm have a problem is that I need to do it dynamycally, e.g. I need to inject the appropriate keywords only for a specified compiler/architecture. For example, I will have a set of Also, I can't to specify all
But, here also it is unclear, how to use this provider to inject some additional compiler keywords to the document. F.e. I don't want to re-implement whole semantic features for every toolchain. I need only in ability to inject some additional compiler keywords depending on the current toolchain. Let's say, that I can detect the current used toolchain, it is not a problem here. A problem here is in injection... Guys, could you please point me, is it possible todo |
FYI, those grammars will only affect lexical colorization, which is not implemented by our C/C++ extension, but by https://github.com/jeff-hykin/cpp-textmate-grammar (that might be a better place to file an issue like this). The IntelliSense parser won't have knowledge of the extra keywords and might generate error squiggles, which might be worked around via using something like
in some file specified by the forcedInclude setting. |
Hi @sean-mcmanus ,
Ohh.. ok, clear, thanks.
I have checked it already, and this does not work too. The intelliSence marks this keywords (with all expression) as error. Is there are other UPD: So, as I understand, is it not enough just to use the TextMate feature? I need also implement an additional steps and for the IntelliSense? Maybe is it possible to add some new API to the intelliSence, e.g. a new property which is an array of additional keywords or something else? |
Yes, of course: Anyway, it is not an option to add the fake defines for that, because then the compilation can fails (and using the additional Also, how to define the
Could you please point me, what is a file with this section?
That's a bad, bad, bad. ;) It would be good to have this feature (even better if it was possible to change dynamically from the typescript code.) |
The "@" case isn't part of the C++ standard language. Our compiler is currently only scoped to handle compilers based on gcc, clang, cl.exe, and EDG compilers that support the standard C++ language features (e.g. https://en.cppreference.com/w/cpp/compiler_support ). You would have to replace all @ occurrences with a macro that defines nothing if The "defines" section I'm referring to is in c_cpp_properties.json or C_Cpp.default.defines. For the srf case, you would need to define it to something like "int" that would compile. We had a request to add Keil support, but it got closed due to not enough votes: #3222 ...you could file another request and we could see if it gets more votes. |
Ok, clear. Many thanks for your time and explanation. |
This feature request is being closed due to insufficient upvotes. When enough upvotes are received, this issue will be eligible for our backlog. |
This feature request has received enough votes to be added to our backlog. |
Helpfull information :) But in: |
I found the way :)
and using is:
|
Type: LanguageService
Right now the intellisence fails at highliting of a custom compiler keywords, like
__data
,data
,__xdata
and so forth,which are used, e.g. for 8051 (aka MCS51) architecture:
and so forth.
BTW, similar keywords also are exists and in many other compilers with different MCU architectures.
So, it would be good to allow to define the custom keywords in some VSCode API.
The text was updated successfully, but these errors were encountered: