microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.51k stars 1.55k forks source link

Support SDCC as compiler #7146

Open maxgerhardt opened 3 years ago

maxgerhardt commented 3 years ago

Type: LanguageService

This issue is closely related to #2499 but more general. The linked issue talks requests that VSCode supports some of SDCC compiler's syntax for Intel 8051 projects. This issue requests that SDCC is generally a supported and recognized compiler in VSCode's C/C++ extension, since SDCC can do much more (compile code for STM8, Z80, PIC14, PIC16, etc.).

Describe the bug

Steps to reproduce

  1. (Note: I'm using PlatformIO to generate a project, auto-download SDCC and auto-generate the c_cpp_properties.json that is causing issues)
  2. Install the PlatformIO extension
  3. Create a new project for the STM8Blue board and SPL as framework
  4. Switch to the newly created project
  5. Change the platformio.ini of the project to
    [env:stm8sblue]
    platform = ststm8
    board = stm8sblue
  6. Press Ctrl+Shift+P -> Rebuild IntelliSense
  7. Observe generated .vscode/c_cpp_properties.json containing SDCC in the compilerPath, example:
//
// !!! WARNING !!! AUTO-GENERATED FILE!
// PLEASE DO NOT MODIFY IT AND USE "platformio.ini":
// https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags
//
{
    "configurations": [
        {
            "name": "PlatformIO",
            "includePath": [
                "C:/Users/Max/Documents/PlatformIO/Projects/stm8_testing/include",
                "C:/Users/Max/Documents/PlatformIO/Projects/stm8_testing/src",
                "C:/Users/Max/.platformio/packages/tool-unity",
                ""
            ],
            "browse": {
                "limitSymbolsToIncludedHeaders": true,
                "path": [
                    "C:/Users/Max/Documents/PlatformIO/Projects/stm8_testing/include",
                    "C:/Users/Max/Documents/PlatformIO/Projects/stm8_testing/src",
                    "C:/Users/Max/.platformio/packages/tool-unity",
                    ""
                ]
            },
            "defines": [
                "F_CPU=16000000L",
                "PLATFORMIO=50101",
                "STM8S_BLUE",
                "STM8S103",
                ""
            ],
            "compilerPath": "C:/Users/Max/.platformio/packages/toolchain-sdcc/bin/sdcc.exe",
            "compilerArgs": [
                "-mstm8",
                ""
            ]
        }
    ],
    "version": 4
}

Expected behavior

The SDCC compiler is recongized correctly in VSCode and compiler-specific includes like `#include "mcs51/8051.h" are recongized, and special SDCC syntax for e.g. special function registers (SFRs) and interrupt definitions are recongized.

  1. Logs from the command C/C++: Log Diagnostics: None relevant -- see below
  2. Logs from the language server: None relevant: see below

Actual behavior

Error message in the "C/C++ Configuration warnings" output tab:

[10.3.2021, 20:14:57] Die Konfiguration mit compilerPath "C:/Users/Max/.platformio/packages/toolchain-sdcc/bin/sdcc.exe" kann nicht aufgelöst werden. Stattdessen wird "cl.exe" verwendet.

Translates to

Unable to resolve configuration with compilerPath [..]/sdcc.exe. Using cl.exe instead."

Due to that of course, nothing SDCC specific like the compiler-specific includes or syntaxes are displayed correctly in VSCode.

Screenshots None relevant

sean-mcmanus commented 3 years ago

Related to https://github.com/microsoft/vscode-cpptools/issues/6677 .

github-actions[bot] commented 3 years ago

This feature request has received enough votes to be added to our backlog.

45gfg9 commented 2 years ago

What's going on here? People still use SDCC and VSCode, I really want to see VSCode add support for SDCC.

ArvoGuo commented 1 year ago

any update?

sean-mcmanus commented 1 year ago

@ArvoGuo No update.

jmjoy commented 10 months ago

+1

syx-413 commented 9 months ago

+1

abobija commented 4 months ago

+1

Any update?

rushairer commented 3 months ago

+1

Any update?

mrx23dot commented 2 months ago

There is already an addon for that https://marketplace.visualstudio.com/items?itemName=CL.eide

please close.

Tentou-Reikie commented 1 week ago

+1

Any update?