Vscode-cpptools: 为什么不能完美支持C 语言

Created on 8 Dec 2016  ·  8Comments  ·  Source: microsoft/vscode-cpptools

_From @guoqingaa on December 6, 2016 8:58_

  • VSCode Version: Code 1.7.2 (7ba55c5860b152d999dda59393ca3ebeb1b5c85f, 2016-11-21T22:06:37.428Z)
  • OS Version: Windows_NT ia32 10.0.14393
  • Extensions:

|Extension|Author|Version|
|---|---|---|
|Bookmarks|alefragnani|0.10.1|
|jsrefactor|cmstead|0.5.3|
|cocos-creator|Chukong Technologies|0.0.1|
|cocos-debug|Chukong Technology|0.0.1|
|compulim-vscode-closetag|Compulim|0.1.2|
|vscode-clock|Compulim|0.0.1|
|jshint|dbaeumer|0.10.15|
|vscode-eslint|dbaeumer|1.1.0|
|vscode-npm-source|dkundel|0.0.3|
|vscode-great-icons|emmanuelbeziat|1.1.26|
|CppSnippets|hars|0.0.5|
|vscode-todo-parser|minhthai|1.8.3|
|vscode-clang|mitaki28|0.2.1|
|prettify-json|mohsen1|0.0.3|
|cpptools|ms-vscode|0.9.2|
|debugger-for-chrome|msjsdiag|2.3.2|
|vscode-icons|robertohuertasm|4.0.5|
|guides|spywhere|0.5.1|
|addDocComments|stevencl|0.0.8|
|html-preview-vscode|tht13|0.0.3|
|comment-snippets|Tobiah|0.2.0|
|debug|webfreak|0.12.3|
|extension-manager|webstp|0.0.5|
|JavaScriptSnippets|xabikos|1.2.0|
|clang-format|xaver|1.0.0|


Steps to Reproduce:

1.不能正常编写纯C语言项目,比如keil for c51 的mcu项目。
2.代码提示不完善,注释说明提示没有提供,写代码很差。

_Copied from original issue: Microsoft/vscode#16578_

Language Service

Most helpful comment

If you are using the new IntelliSense engine ("C_Cpp.intelliSenseEngine": "Default"), you can emulate a custom keyword by adding something like "sbit=int" to the c_cpp_properties.json file in the "defines" array like this:

"defines": [
    "sbit=int",
]

When we do add document comments, we will also look at supporting the doxygen format as well.

All 8 comments

_From @alexandrudima on December 6, 2016 9:53_

rough translation:

Why not perfect support for C language

  1. Can not normally write pure C language projects, such as keil for c51 mcu project.
  2. Code hints are not perfect, note that note does not provide, write code is poor.

_From @guoqingaa on December 8, 2016 4:14_

对啊,在 keil for c51中,并没有合适的语法高亮支持,如 sbit 等关键字,另外includePath 也无法正常设置,鼠标移动到代码上,并不支持已经写有的注释说明Tips 提示,写C 语言代码的时候,代码提示也不够完整,无法查看方法的引用计数。

Yes, in the Keil for C51, and there is no suitable syntax highlighting support, such as the “sbit“ keyword, includePath also cannot be set, move the mouse to the code, do not support has written comment and improve Tips, when writing C code, the code that is not complete. Cannot view reference count.

_From @guoqingaa on December 8, 2016 6:29_

in vscode do not support show Comment Snippets tags(Comment tips)(in C language)

/**

  • Note .....
    */
    do not support show Tools Tips

Now how is the progress? When will the problem be solved?

Thank you for your feedback.

We do have support for C language projects but have no plans to support the language extensions offered by Keil for C51 (e.g. 'sbit' keyword).
The includePath can be set by selecting the "C/Cpp: Edit Configurations" command from the command palette or selecting one of the options from the lightbulb that appears when you select an #include line that has a squiggle under it.
"Move mouse to the code" I assume means "goto definition" which we do support.
We don't have document comments in our tooltips yet. That is being tracked by #399.
I'm not sure if you were asking about code completion, but we have support for that too.
We don't find all references support right now either. That is being tracked by #15.

Oh, shit!
1.don't have document comments of tooltips. That is being tracked by #399
2.Custom keyword is not supported, As by Keil for C51 (e.g. 'sbit' keyword).What I want is that users can customize it,do you understand? Embedded development, simply can not use, a bunch of prompt errors.

@bobbrow

Hope is as follows ->

  1. support for doc comments c/c++ style, such as:
/** brief $ {cursor}
  *
  * Write the details of the function here
  * @param [in] (input parameter description, including the role of each parameter, the value and the relationship between parameters)
  * @param [out] (description of output parameters)
  * @return (description of return value)
  * @see (this function refers to other related functions, here as a link)
  * @note (description of the need to pay attention to the problem)
*/
  1. supported setting by Custom keyword。

@bobbrow

If you are using the new IntelliSense engine ("C_Cpp.intelliSenseEngine": "Default"), you can emulate a custom keyword by adding something like "sbit=int" to the c_cpp_properties.json file in the "defines" array like this:

"defines": [
    "sbit=int",
]

When we do add document comments, we will also look at supporting the doxygen format as well.

Was this page helpful?
0 / 5 - 0 ratings