Free Bidi VS Code Extension Overview The Free Bidi extension for Visual Studio Code simplifies working with COBOL files containing RTL language text. It automatically converts files from a configurable RTL encoding (default: ISO-8859-8) to UTF-8, adding Left-to-Right Override (LRO, \u202D) markers before RTL language text to ensure proper display. The converted files are stored in a .freebidi directory and opened in VS Code with UTF-8 encoding. When typing new RTL language characters in these converted files, the extension automatically inserts LRO markers to maintain consistent text direction. Features Automatic Conversion: Converts COBOLIT files ( Installation Install the Extension: Open VS Code. Go to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X on macOS). Search for Free Bidi by NLTCInc. Click Install. Set Up Dependencies: Ensure Node.js is installed for development (optional). Run npm install in the extension directory (~/free-bidi) to install dependencies like iconv-lite. Configure VS Code Settings: Open VS Code settings (Ctrl+, or Cmd+, on macOS). Add the following to settings.json for the best experience:{ "editor.renderControlCharacters": false, "editor.unicodeHighlight.invisibleCharacters": false, "freeBidi.rtlEncoding": "ISO-8859-8", "freeBidi.outline": true, "freeBidi.enableRtlSearch": true, "freeBidi.normalizeRtlWhileTyping": true, "freeBidi.definitionSearchRoots": [], "freeBidi.definitionSearchRootPrefixes": {} } The settings "editor.renderControlCharacters": false and "editor.unicodeHighlight.invisibleCharacters": false prevent visual glyphs for LRO markers and other invisible Unicode characters, ensuring a clean editing experience.
Git Recommendation If your project uses Git, add the temporary
Usage Open a COBOL File: Open a COBOLIT file ( Automatic Conversion: The extension uses freeBidi.rtlEncoding from settings.json (default: ISO-8859-8) and creates a UTF-8 version with LRO markers in the .freebidi directory (e.g., /path/to/project/src/.freebidi/example.cob). If that directory cannot be created because the source tree is readonly, the extension opens a readonly virtual version of the converted content directly in VS Code instead of creating a temporary fallback file. The converted file opens automatically in VS Code with UTF-8 encoding. Edit RTL language Text: When typing RTL language characters in the .freebidi file, the extension normalizes the active RTL run after the next non-RTL character is typed, adding the needed Save Changes: Saving the .freebidi file updates the original file, removing LRO markers and encoding it back using freeBidi.rtlEncoding (default: ISO-8859-8). Readonly virtual documents opened because the source tree is not writable cannot be edited or saved back to the original source location. Close File: Closing a writable .freebidi file deletes it to keep your workspace clean. Readonly virtual documents do not create temporary fallback files on disk. Manual Conversion Run the command Free Bidi Editor: Convert File (Ctrl+Shift+P ? type ?Free Bidi?) to manually convert the active COBOLIT file ( Find RTL Text Use FreeBidi: Find RTL Text when the visible Hebrew text is readable in the editor but the underlying generated
The command performs a literal search in the active document only. It converts the search value internally, highlights matches with normal VS Code selection/decorations, and does not modify the source file, generated Fix Pasted RTL Text If Hebrew or another RTL language was pasted into VS Code and appears reversed, use the internal command:
COBOL Go to Definition Use VS Code's native Go to Definition actions on COBOLIT
For called programs without an extension, the lookup lowercases the called routine name and tries the configured For copybooks without an extension, lookup remains unchanged and tries Troubleshooting File Not Converting: Ensure the file has the COBOLIT language ID. Check the Output panel (free-bidi) for error messages. Verify the file contains RTL language characters. Encoding Issues: Confirm the .freebidi file opens with UTF-8 (check the status bar). Run the following to inspect the file:xxd -l 3 /path/to/project/src/.freebidi/example.cob Expect: 00000000: efbb bf ... (UTF-8 BOM). LRO Not Inserted: Ensure you're editing the .freebidi file, not the original .cob file. Check the Output panel for Inserted LRO before RTL language text.... Extension Not Activating: Check the Output panel for Free Bidi extension activated on platform: .... Disable conflicting extensions like redhat.java (see settings above). Clear workspace storage:rm -rf ~/Library/Application\ Support/Code/User/workspaceStorage/9eee23559e7c9649f178964da0909a5c Debugging: Open the extension in VS Code (~/free-bidi). Set breakpoints in src/extension.ts. Run ?Run Extension? in the Debug view (F5). Share Debug Console and Output panel logs if issues persist. Development Clone the Repository: git clone https://github.com/Nautilus009/free-bidi.git ~/free-bidi Install Dependencies: cd ~/free-bidi npm install Compile: npm run compile Test: npm test Publish: npx vsce login NLTCInc npx vsce publish Contact For issues, feature requests, or contributions, visit the GitHub repository or file an issue. |