CYFLEX Developer Tools ExtensionThis extension's purpose is to assist in troubleshooting cyflex spec files. Some of the features of this extension include syntax highlighting, listing the detected problem in a message, and file color formatting. Currently, only limit spec files have syntax highlighting and file color formatting. More spec files will be added in the future. The other spec files can be opened but there will not be any syntax highlighting or color formatting at this time. Important NoteAt this moment, the extension is NOT able to verify if the limit specs variable or any referenced cyflex variable(s) are currently active. Due to units.dat files being interchangeable, this extension only checks if the unit is in a correct format at this time. Syntax Highlighting OverviewWhen a supported spec file is opened, the extension will read through the opened file and determine if there are any syntax errors or data in the wrong order. When an error has been identified, a squiggly line starting at the beginning of the line will be drawn to the problem character. This will help the user find an error in the file more quickly and easily. When the error is corrected, the squiggly line will disappear. When hovering the mouse over the squiggly line, an error message with what the extension found wrong along with expected data options for that position. There may be times where the syntax highlighter might not give a helpful message. This is where the user needs to assist and look at the data around the error or even the line above where the error is located. It is recommended to fix the errors from the beginning of the file to the end since some syntax errors may cause multiple errors due to the parser trying to recover from the unexpected error within the file. Color FormatIf the supported shebang is found at the first line when opening a spec file, VS Code will change the coloring of the spec file to make it easier to tell the difference between a variable, units, comments, and keywords. This is to make it easier for the user to know what parts of the file is commented out vs parts of the file that will be read into the spec file application. The colors of the comments, variables, units, and keywords change with the theme that is applied to vs code. NOTE: Not all themes will change the colors of the spec file. The color format is tied to the file type for the opened file. If the file type is 'plaintext' then all of the text within the file will be the same color. If the file type is detected to be a supported spec file, for example limit_specs, then vs code will start the color formatting for the file. Implementation NotesFor the best results of the extension working, add: Example for limit specs:
Otherwise, the text in the limit specs file will be one color as a plaintext file. NOTE: The extension will still do syntax highlighting for limit specs files without the shebang if the file name contains limit_specs. For vs code to detect the newly added shebang automatically:
After the changes are made vs code will automatically use the specs file type when that file is opened in vs code. This change only needs to happen once at first, then update the version number when newer versions are released for the spec file that contain desired changes. Change File TypeTo manually change the file type to a limit_specs file type:
Running this extension
|