This an extension for Visual Studio Code that provides a separate toggleable TOC view in the sidebar.
This extension provides a separate toggleable TOC view in the sidebar. The TOC view is automatically populated with the contents of the ORCA output file that is currently open in the editor. The TOC view is generated by parsing the ORCA output file using regular expressions and setting up a tree view based on the results. The generated TOC view is a tree view with the titles of the headings in the ORCA output file and the corresponding line numbers. Clicking on a TOC entry will jump to the corresponding line in the ORCA output file.
The TOC view can be toggled on and off by clicking on the
ORCA FILE OUTLINE icon in the sidebar. The TOC view can also be toggled on by running the command
Show ORCA Outline from the command palette. On Windows, the command palette can be opened with
Ctrl+Shift+P, on Mac it is
Cmd+Shift+P. The TOC view is automatically updated when navigating to a different ORCA output file.
The current version (0.3.1) enables changing the default status of the toggleable TOC view. The default collapsed status of the TOC view can be changed in the settings of the extension. The default value is
true, which means that the TOC view is collapsed by default. The TOC view can be expanded by clicking on the
ORCA FILE OUTLINE icon in the sidebar.
The current version (0.3.1) also provide syntax highlighting for the ORCA output file, including the headings, separation lines, numbers, and keywords, etc. The syntax highlighting is enabled by default. The disablling of the syntax highlighting will be added in a future release. The display of the syntax highlighting varies with different themes. Dark themes are recommended for better display of the syntax highlighting.
Issues and Important Notes
Due to the memory limit of VS Code for large files, could not process files larger than 50MB automatically. This is because the VS Code restricts the size of the
activeEditor to 50MB, which prevents the extension from getting the contents of the opened ORCA output file. For more details, check the current open issue on Github #31078.
If you have very large ORCA output files, please first consider splitting them into smaller chunks or remove the parts that are not needed (for example full print of the MOs).
:warning: For large ORCA output files, The current solution is using the
FileSystemProvider API to read the contents of the ORCA output file directly from the file system. This will allow the extension to parse ORCA output files that are larger than 50MB. please use the command
Show ORCA Outline External from the command palette and load the large ORCA output file manually from your file system. The loaded ORCA output file will be displayed in a new tab in the editor of the current VS Code window, with a :lock: symbol at the end of the file name. This is because the file is read-only and cannot be modified. The TOC view will be automatically populated with the contents of this ORCA output file.
:construction: A known issue is that clicking the heading titles in the
ORCA FILE OUTLINE view for large ORCA output files will not navigate to the corresponding line in the opened tab. Instead a new tab with the same name file name will pop up, showing identical contents and TOC view at the respective line. This bug will be fixed in a future release.
:warning: (Not Recommended!) Another solution for large ORCA output files is by patching the
workbench.desktop.main.js file to increase the limit. The default value of
50 * 1024 * 1024, which is 50MB. You could change it to a value that is larger than the size of your ORCA output file. This will cause VS Code to display a warining message that the installation is corrupted. Please use this solution at your own risk.
If you don's see the
ORCA FILE OUTLINE in the sidebar of
EXPLORER, please make sure that the
OPEN EDITORS drop down menu is expanded. This is a known issue and will be fixed in a future release.
For detailed release notes, please see CHANGELOG.md.
- Added grammar syntax highlighting for the ORCA output file (syntax definition is saved in
- [ ] Highlight the corresponding TOC entry when the user is navigating through the ORCA output file based on the current line number.
- [ ] Foldings feature for the ORCA output file based on the TOC entries.
- [ ] Add support for the
ORCA FILE OUTLINE view to automatically scroll to the current line in the ORCA output file.
- [x] Syntax highliting for the ORCA output file based on the TOC entries.
- [ ] Add settings for enabling/disabling the syntax highlighting for the ORCA output file.
The current version represents an early release of this extension.
An important feature that will be added in the next major release is to enable the scrolling of the
ORCA FILE OUTLINE view to the current line in the ORCA output file. This will be useful when the ORCA output file is very long and the user is navigating through the file. The
ORCA FILE OUTLINE view will automatically scroll to the current line in the ORCA output file.
The list of regular expressions is saved in
patterns.json file. The file contains a list of regular expressions that are used to parse the ORCA output file. Each regular expression is a JSON object with the following properties:
regex: The regular expression string
level: The level of the TOC entry (1, 2, 3, etc.)
Please submit a pull request if you would like to add a new regular expression to the list. Please also submit a pull request if you would like to modify an existing regular expression.
A list of keywords that are used to format the headings in the TOC view is saved in
keywords.json file. The matched strings will be formatted using the corresponding keywords. This list is currently not complete and will be updated in a future release.
The syntax definition for the ORCA output file is saved in
orca.tmLanguage.json. The syntax definition is based on the TextMate grammar and VS Code TextMate grammars. The syntax definition is currently not complete and will be updated in a future release.
Please submit a pull request if you would like to add/modify syntax definitions to the ORCA output file.
For more information
ORCA Input Library