OPACC WAS Link Extension
Hi fellow dev! 🙋🏼♀️
Just a small Visual Studio Code extension to creates clickable links in OPACC WAS .lc (Level Component) files, making navigation to configuration files quick and effortless.
Live is hard sometimes but this extension should make our job a tiny bit easier 😊
What does it do?
This little helper automatically turns file references in .lc files and function calls into clickable links. No more copy-pasting filenames or digging through folders!
Supports:
.oc files (Object Component) → config/oc/
.rd files (Request Definition) → config/rd/
.cc files (Controller Component) → config/cc/
.part files (Partial files) → config/oc/partial/
Link Types:
1. Direct Links in .lc files:
File references in pipe-delimited format become clickable:
LC|1|MODULE-Filename.oc||MODULE-Filename.rd||||||||MODULE-Filename.cc
Click on MODULE-Filename.oc and it'll jump straight to the file. 💁🏼♀️
2. gFunction Links in .oc and .part files:
Links are automatically detected and highlighted for the following gFunctions:
{gCreateURL(···LC-file.lc·level...)} → Links to the OC file at the specified LC level
{gIncludeSubpage(LC-file.lc¦level...)} → Links to the OC file at the specified LC level
{gGetPartial(partial-file.part...)} → Links to the partial file in oc/partial/
{gExecuteRd(request-file.rd...)} → Links to the request definition file
3. Navigate Between Linked Files (Ctrl+Shift+L):
Working on a .oc, .rd, or .cc file and want to jump to a linked file? Press Ctrl+Shift+L to quickly jump to sibling files on the same LC level!
Example:
- You're editing
ARTICLE-List.rd
- Press
Ctrl+Shift+L
- See all linked files:
ARTICLE-List-Horizontal.oc, ARTICLE-List-Vertical.oc
- Select one and jump right to it!
When multiple files are found, a quick pick menu shows:
- File name
- Which
.lc file(s) contain the link
- The LC level(s) where they're linked
Setup
- Install the extension
- Open your OPACC WAS project
- That's it! No config needed
Your project should look something like this:
webportal/
├── config/
│ ├── lc/ (Level Component files)
│ ├── oc/ (Object Component files)
│ ├── rd/ (Request Definition files)
│ └── cc/ (Controller Component files)
Further Ideas for this extension
- create links for gFunctions like gCreateURL, gGenerateURL, gGetPartial
Development
This extension is built using:
- TypeScript
- VS Code Extension API
- DocumentLinkProvider interface
- Modular architecture with base classes and services
- GitHub Copilot 🤖
Architecture
The extension follows a clean, modular architecture:
- Base Classes:
DirectLinkProvider and LcLevelLinkProvider for code reuse
- Services:
pathResolver.ts - Path resolution utilities
lcFileService.ts - LC file reading and parsing
- Link providers for each gFunction type
- Tests: Comprehensive test suites for each link provider
Want to contribute?
Found a bug? Got an idea to make this better? Hit me up!
Happy coding! ✨
Made with ☕ and a bit of frustration with manual file navigation