Skip to content

era180000/selinuxhelper

Repository files navigation

SElinuxhelper README

SELinux Penguin

SElinuxhelper is a VS Code extension that allows code completion, intellisense of definitions, and syntax highlighting for various types of SELinux files.

The following are the supported file types: .te, .if, .fc, and .spt.

Features

Definition Hover and Go-To

To see the definition hovering over a term. Use Ctrl + Click to open the file location containing the definition Use F12 while cursor is in a word or it is highlighted to jump to the file location of the definition

Example:

SELinux Peek

Comment Highlighting

Comments in all files are colored green.

Example:

SELinux Comments

.te Syntax Highlighting

For .te files, the following are the colors for each file specific blocks of code:

  • gen_require, type, and alias are colored blue.
  • dev_node is colored purple.
  • Parenthesis for gen_require and dev_node are colored yellow.

Example:

SELinux te

.if Syntax Highlighting

For .if files, the following are the colors for each file specific blocks of code:

  • interface, gen_require, type, and allow are colored blue.

Example:

SELinux if

.fc Syntax Highlighting

For .fc files, the following are the colors for each file specific blocks of code:

  • gen_context is colored blue.
  • Parenthesis for gen_context are colored yellow.

Example:

SELinux fc

.spt Syntax Highlighting

For .spt files, the following are the colors for each file specific blocks of code:

  • define is colored blue.
  • Parenthesis for define and backticks not surrounding brackets are colored yellow.
  • Brackets and backticks surrounding those brackets are colored pink.

Example:

SELinux spt

Requirements

No additional requirements for this extension.

Extension Settings

Path Inclusion

Users are able to specify the include in intellisense definition parsing. The default is /user/share/selinux/devel/include/.

This setting can be edited under File > Preferences > Settings and searching SELinux. To add several paths, separate them with a comma.

The settings.json appears as follows:

SELinux Settings

Release Notes

Releases

1.0.0

[2023-04-27]

Added

- Initial release of SELinuxHelper
- Updated ReadME to include all features in 1.0.0

Initial Prereleases

0.2.3

[2023-04-21]

Fixed

-Fixed f12 goto functionality

0.2.2

[2023-04-21]

Added

-Added f12 goto functionality. Known Issue: Goes to top of file instead of correct in-file location
-Changed hover to hover in place

Fixed

-Fixed file read error with proper handling. Will just skip unreadable files now

0.2.1

[2023-04-21]

Added

-Added definitionType to parser for dynamic code completion
-Added dynamic code completion with file location
-Removed optional_policy from default keyword list (it's a defined macro not a default function)

Fixed

-Fixed file size error when parsing 2GB+ file
-Fixed symbolic link parsing error (Linux)

0.2.0

[2023-04-21]

Added

-Finished if and spt parsing for go to, hover, and code completion
-Added Go To functionality (LS)
-Added Hover functionality (LS)
-Added handlers for onOpen, onSave, onDidChangeWatchedFile for reparsing
-Added automatic parsing of all workspace folders and include paths

0.1.0

[2023-03-31]

Added

-Finished Syntax Highlighting
-Implemented base language server
-Finished default keyword code completion (LS)
-Added include path setting for future parser (LS)

0.0.2

[2023-03-08]

Added

-Add syntax highlighting for .spt 
-Updated Readme
-Updated Changelog

0.0.1

[2023-03-08]

Added

-Syntax Highlighting Initial

Credits

Developed by Sophia Boisvert, Easton Anderlik, Pranav Pradeep, Matt McCoy, Trevor Tomer, and Zeal Bhatt.

SELinux Logo used under the Creative Commons ShareAlike 2.5 license. Credit to Máirín Duffy.

Link to License: https://creativecommons.org/licenses/by-sa/2.5/

Link to Artist: https://www.deviantart.com/pookstar/gallery

Link to Selinux page: https://selinuxproject.org/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7