BigBahss / vscode-cmantic

C/C++ code generation for VS Code: Generate Definitions, Getters, Setters, and much more.
https://bigbahss.github.io/vscode-cmantic/
MIT License
83 stars 9 forks source link

Pragma block for selected statements #10

Closed benny-edlund closed 1 week ago

benny-edlund commented 3 years ago

How about the ability to add a suppression pragmas around selected rows?

  1. Select some rows
  2. Hit the suppress shortcut
  3. Tool generates the correct #pragma for compiler leaving the user with the cursor where to write the warning to suppress
  4. User enters the warning

If current row is already in a block a new suppression is added and we go to point 4

BigBahss commented 3 years ago

Thank you for submitting! I'll be honest, I don't have much experience with #pragma directives, so I would have to look into that. From what I do understand they're fairly compiler-specific. In the short-term, I want to steer away from features that are dependent on certain compilers/systems/configurations. I only added the #pragma once header guard option because it's simple and most major compilers support it. In the future, if I decide to do anything that involves reading from compile_commands.json or .vscode/c_cpp_properties.json then I could implement this. I'll leave this open in order to gauge how many people would want this.