pjbgf / vscode-apparmor

Extension to add AppArmor support for Visual Studio Code.
MIT License
6 stars 0 forks source link

Auto detect apparmor files based on vim syntax comments #2

Open Caelagor opened 4 years ago

Caelagor commented 4 years ago

Example found on Ubuntu 19.10

head /etc/apparmor.d/abstractions/ubuntu-browsers.d/user-files

# vim:syntax=apparmor

  # Allow read to all files user has DAC access to and write access to all
  # files owned by the user in $HOME.
  @{HOME}/ r,
  @{HOME}/** r,
  owner @{HOME}/** w,

  # Do not allow read and/or write to particularly sensitive/problematic files
  #include <abstractions/private-files>

Reacting to these comments would add some convenience (when often viewing AppArmor profiles), because currently one has to press {Ctrl} + {K}, {M} type 'aa' and press {Enter} to set the language to AppArmor.

pjbgf commented 4 years ago

@Caelagor thanks for the suggestion. I went through the vscode documentation and could not find a way to support this at the moment.

I opened an issue on their repo, as soon as that feature is supported I will implement it.

jgraichen commented 6 months ago

Could this be supported through https://github.com/ctlajoie/vscode-modelines if this extension adds an apparmor language code too?

With the modelines extension, # vim:syntax=aa did work for me, but not yet # vim:syntax=apparmor.