microsoft / microsoft/vscode-cpptools

Add IntelliSense modes for MPLAB (XC8/XC16/XC32) compilers

オープン
#8,533 コメント 28 件 リアクション 22 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Feature Request Feature: Configuration Language Service
主要言語
TypeScript
スター
6.2k
フォーク
1.7k
平均マージ
14時間 46分
マージ済み PR(30日)
61

説明

Bug type: Language Service

uint16_t type unrecognized with xc16 compiler

  • Ubuntu 20.04 under WSL2 on Windows 10:
  • VS Code Version: Version: 1.63.0 (user setup)
    Commit: 7db1a2b88f7557e0a43fec75b6ba7e50b3e9f77e
    Date: 2021-12-07T06:26:56.179Z
    Electron: 13.5.2
    Chromium: 91.0.4472.164
    Node.js: 14.16.0
    V8: 9.1.269.39-electron.0
    OS: Windows_NT x64 10.0.19044
  • C/C++ Extension Version: v1.8.0-insiders2
  • Other extensions you installed (and if the issue persists after disabling them): https://gist.github.com/DanieleNardi/d7201e044a00744a8f63dbb900113c09#file-extensions-json
  • If using SSH remote, specify OS of remote machine: n/a
  • A clear and concise description of what the bug is, including information about the workspace (i.e. is the workspace a single project or multiple projects, size of the project, etc).

It's a small prject developed with Microchip's dsPIC33EP128MC502.
An error message as follows appears when a uint16_t type is used:

"[{
	"resource": "main.c",
	"owner": "C/C++",
	"code": "757",
	"severity": 8,
	"message": "variable \"uint16_t\" is not a type name",
	"source": "C/C++",
	"startLineNumber": 230,
	"startColumn": 1,
	"endLineNumber": 230,
	"endColumn": 2
}]

Error squiggle only under the 'u' of uint16_t.
Hover window shows correct definition of type.
CTRL+Click works, redirect to compiler-specific stdint.h, where uint16_t is defined as follows:

#ifndef uint16_t
typedef unsigned int uint16_t;
#define uint16_t uint16_t
#define UINT16_MAX (65535U)
#endif

Other types defined in stdint.h in the same way work fine.
Simple call to compiler (from Microchip's IDE or command line) doesn't show this error.

Steps to reproduce
Create c file, .c extension, including stdint.h.
Declare a uint16_t variable in .c file.

Expected behavior
No error at all.

Code sample and logs

  • Code sample

  • Configurations in c_cpp_properties.json

"configurations": [
        {
            "name": "Application",
            "includePath": [
                "${workspaceFolder}/ApplicationFW",
                "/xc16/include",
                "/opt/microchip/xc16/v1.70/include",
                "/xc16/include/lega-c",
                "/xc16/support/generic/h"
            ],
            "defines": [],
            "compilerPath": "/xc16/bin/xc16-gcc",
            "cStandard": "c99",
            "intelliSenseMode": "linux-gcc-x86",
            "compilerArgs": [
                "-c",
                "-include ${workspaceFolder}/ApplicationFW/Microchip/packs/dsPIC33E-GM-GP-MC-GU-MU_DFP/1.3.85/xc16/support/dsPIC33E/h/p33EP128MC502.h",
                "-mcpu=33EP128MC502",
                "-MP",
                "-MMD",
                "-mno-eds-warn",
                "-g",
                "-omf=elf",
                "-legacy-libc",
                "-O0",
                "-msmart-io=1",
                "-Wall",
                "-msfr-warn=off",
                "-mdfp=\"${workspaceFolder}/ApplicationFW/Microchip/packs/dsPIC33E-GM-GP-MC-GU-MU_DFP/1.3.85/xc16\""
            ]

        }
    ],
    "version": 4

Screenshots

Additional context

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

報告された c_cpp_properties.json の設定、特に compilerPath、compilerArgs、intelliSenseMode から始め、XC16 プロジェクトで uint16_t の診断を再現してください。コンパイラー固有の IntelliSense モードに対応する C/C++ 言語サービスのエントリポイントを確認してください。XC8、XC16、XC32 の設定で、報告された誤ったエラーなしにコンパイラーが提供する型を認識できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c, vscode
領域
tooling
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。