Skip to content

Commit c63a212

Browse files
authored
Merge pull request #4 from liqunkang/test
bug fix and dependency update
2 parents f2cb830 + 10886b4 commit c63a212

File tree

5 files changed

+1058
-825
lines changed

5 files changed

+1058
-825
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,11 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
7777
## [0.4.3] - 2024-01-25
7878

7979
- update of `orca.tmLanguage.json` file for better syntax highlighting of the ORCA output file.
80+
81+
## [0.4.4] - 2025-08-13
82+
83+
- Added instruction for expanded Large File Optimizations guidance; emphasized that highlighting on huge files may only work with optimizations disabled.
84+
<!-- - External Reader now displays content verbatim (no line stripping), with normalized line endings. -->
85+
<!-- - Navigation from the outline stays in the same read‑only tab instead of spawning a duplicate tab for large files opened externally. -->
86+
<!-- - Fixes for edge cases that caused some lines to appear blank in the read‑only tab. -->
87+
- Dependency and lockfile updates.

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ N/A
4141

4242
Settings of this extension can be changed in the settings of VS Code (click on the gear icon in the bottom left corner of the VS Code window or press `Ctrl+,` on Windows or `Cmd+,` on Mac). The configuration options are listed under `Extensions` -> `ORCA_TOC`, or could be accessed by searching `ORCA_TOC` in the search bar of the settings window.
4343

44-
The current version (0.4.3) 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 the toggle arrow next to each parent entry.
44+
The current version (0.4.4) 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 the toggle arrow next to each parent entry.
4545

46-
The current version (0.4.3) enables changing the highlight symbols for the TOC entries. The default highlight symbol is 'circle-large-filled'.
46+
The current version (0.4.4) enables changing the highlight symbols for the TOC entries. The default highlight symbol is 'circle-large-filled'.
4747
For a list of available highlight symbols, please see [here](https://code.visualstudio.com/api/references/icons-in-labels#icon-listing).
4848

4949
![Settings Example](images/settings_example.png)
@@ -56,6 +56,22 @@ For a list of available highlight symbols, please see [here](https://code.visual
5656

5757
- :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 `orca_toc: 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.
5858

59+
- **Syntax highlighting on very large files** (Large File Optimizations):
60+
VS Code may reduce features on large files to protect performance. Common effects include disabled tokenization/highlighting and sluggish navigation. If your ORCA output is very big (e.g., >20 MB or >300k lines), this optimization can kick in even though the language is detected correctly. You can try to relax the optimization by adding the following to your user `settings.json`:
61+
```json
62+
"editor.largeFileOptimizations": false
63+
```
64+
**Important performance note:** Disabling Large File Optimizations can significantly increase CPU and memory usage and may make the editor sluggish or unresponsive for huge files. We recommend using the command `orca_toc: Show ORCA Outline External` for very large outputs as the safer default.
65+
**Heads‑up:** On very large files, **syntax highlighting may only work if Large File Optimizations are disabled**.
66+
67+
<!-- - **External Reader behavior updates (0.4.4):**
68+
- The External Reader (`orca_toc: Show ORCA Outline External`) now displays file content **verbatim** (no line stripping), with only line endings normalized.
69+
- Clicking entries in **ORCA FILE OUTLINE** navigates within the same read‑only tab (no duplicate plain `file:` tab).
70+
- The large‑file warning now triggers **only** for regular `file:` tabs; it won’t appear for `orca:` documents. Language mode is explicitly set to `orcaOut` for reliable highlighting when feasible. -->
71+
72+
- **What counts as a “large” file in VS Code?**
73+
VS Code begins applying large-file heuristics around **20 MB** or **~300,000 lines**. Some features may be hard-disabled around **50 MB**. These thresholds are editor-internal safeguards and can change between versions.
74+
5975
- :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.
6076

6177
- :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 `_MODEL_SYNC_LIMIT` is `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.
@@ -66,6 +82,14 @@ For a list of available highlight symbols, please see [here](https://code.visual
6682

6783
For detailed release notes, please see [CHANGELOG.md](CHANGELOG.md).
6884

85+
### 0.4.4
86+
87+
- Added expanded guidance on Large File Optimizations.
88+
<!-- - Content for large files is shown verbatim (only line endings normalized) in the external reader. -->
89+
<!-- - Fixed the bug while duplicate tabs appeared while clicking entry in the TOC for large files opened externally. -->
90+
<!-- - Added warnings and instructions for loading large files. -->
91+
- Dependency updates and general housekeeping.
92+
6993
### 0.4.3
7094

7195
- update of `orca.tmLanguage.json` file for better syntax highlighting of the ORCA output file.

extension.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ class OrcaFileSystemProvider {
189189
for await (const chunk of fileStream) {
190190
buffer += chunk; // Append the chunk to the buffer
191191
// Skip lines as per your requirement
192-
buffer = buffer.replace(/^(\ {0,3}\d+.*\n)/gm, '\n'); // Remove line numbers
192+
buffer = buffer.replace(/^(\ {0,30}-?\d+.*\n)/gm, '\n'); // Remove line numbers
193193
// Process buffer with regex here...
194194
}
195195
return Buffer.from(buffer);

0 commit comments

Comments
 (0)