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.
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:
Comments in all files are colored green.
Example:
For .te files, the following are the colors for each file specific blocks of code:
gen_require,type, andaliasare colored blue.dev_nodeis colored purple.- Parenthesis for
gen_requireanddev_nodeare colored yellow.
Example:
For .if files, the following are the colors for each file specific blocks of code:
interface,gen_require,type, andalloware colored blue.
Example:
For .fc files, the following are the colors for each file specific blocks of code:
gen_contextis colored blue.- Parenthesis for
gen_contextare colored yellow.
Example:
For .spt files, the following are the colors for each file specific blocks of code:
defineis colored blue.- Parenthesis for
defineand backticks not surrounding brackets are colored yellow. - Brackets and backticks surrounding those brackets are colored pink.
Example:
No additional requirements for this extension.
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:
[2023-04-27]
- Initial release of SELinuxHelper
- Updated ReadME to include all features in 1.0.0
[2023-04-21]
-Fixed f12 goto functionality
[2023-04-21]
-Added f12 goto functionality. Known Issue: Goes to top of file instead of correct in-file location
-Changed hover to hover in place
-Fixed file read error with proper handling. Will just skip unreadable files now
[2023-04-21]
-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 file size error when parsing 2GB+ file
-Fixed symbolic link parsing error (Linux)
[2023-04-21]
-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
[2023-03-31]
-Finished Syntax Highlighting
-Implemented base language server
-Finished default keyword code completion (LS)
-Added include path setting for future parser (LS)
[2023-03-08]
-Add syntax highlighting for .spt
-Updated Readme
-Updated Changelog
[2023-03-08]
-Syntax Highlighting Initial
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/