Skip to content

Add attls language support#380

Open
1000TurquoisePogs wants to merge 6 commits intov3.x/stagingfrom
feature/v3/lang-attls
Open

Add attls language support#380
1000TurquoisePogs wants to merge 6 commits intov3.x/stagingfrom
feature/v3/lang-attls

Conversation

@1000TurquoisePogs
Copy link
Copy Markdown
Member

Proposed changes

This PR adds a Monaco/Monarch language mode for IBM z/OS AT-TLS (Application Transparent
Transport Layer Security) Policy Agent files. When a plaintext file contains a TTLSRule
declaration at the start of a line, the editor automatically detects and activates the
attls language mode.

Key user-facing improvements:

  • Syntax highlighting for declaration types, item names, property keys, reference keys/values, braces, and comments using a distinct dark theme (attls-dark).
  • Hover help on cross-references: hovering over any reference value (e.g. the name after TTLSConnectionActionRef) shows the full declaration block of the referenced item inline, eliminating the need to scroll or search manually.
  • Hover help on keywords: hovering over any AT-TLS keyword (e.g. TTLSConnectionAction, RemotePortRangeRef, HandshakeRole, TLSv1.2) shows a brief description of that keyword's purpose and valid values.
  • Automatic language detection via content scanning: files whose first non-comment line contains TTLSRule are detected regardless of filename or extension, making the feature work for unnamed datasets and files with arbitrary names.

Type of change

  • New feature (non-breaking change which adds functionality)

PR Checklist

  • If the changes in this PR are meant for the next release / mainline, this PR targets the "staging" branch.
  • My code follows the style guidelines of this project (see: Contributing guideline)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • New and existing unit tests pass locally with my changes
  • Relevant update to CHANGELOG.md
  • My changes generate no new warnings

Files changed

File Change
webClient/src/app/editor/code-editor/monaco/hiliters/attls.ts New file. Monarch tokenizer, declaration parser, ref-value hover utility, keyword hover utility, and ATTLS_KEYWORD_DOCS map (64 keywords).
webClient/src/app/editor/code-editor/monaco/monaco.config.ts Registers attls language, attls-dark theme, Monarch provider, and hover provider.
webClient/src/app/shared/editor-control/editor-control.service.ts Adds attls-dark theme case to setThemeForLanguage; adds content-based language detection pass in getRecommendedHighlightingModesForBuffer.
CHANGELOG.md Entry added under new version 3.5.0.

Testing

  1. Open a AT-TLS policy file
  2. Verify the language is automatically detected as attls in the editor status bar (no extension or filename pattern should be required).
  3. Verify syntax highlighting applies: declaration keywords are teal, item names are orange, property keys are light blue, *Ref keys are purple, reference values are underlined gold, comments are green, braces are blue.
  4. Hover over a reference value on any TTLSGroupActionRef, TTLSEnvironmentActionRef, TTLSConnectionActionRef, LocalPortRangeRef, etc. line — the full declaration block for the referenced item should appear in the hover popup.
  5. Hover over well-known literals (ALL, On, Off, bare numbers) — no popup should appear.
  6. Hover over any AT-TLS keyword (e.g. HandshakeRole, TLSv1.2, CertificateLabel) — a brief description should appear.
  7. Confirm that opening a non-AT-TLS plaintext file does not trigger AT-TLS mode.

Further comments

The content-based detection mechanism introduced in getRecommendedHighlightingModesForBuffer
is generic: any future language can opt in by setting contentDetect: true alongside a
firstLine regex in its language registration object. This avoids the need for changes to
the detection service for each new language that cannot be identified by filename alone.

The hover provider is structured with two priority levels so that ref-value popups (which
show live file content) always take precedence over generic keyword descriptions. If a
referenced item is not declared in the current file the keyword description is shown as a
fallback, which is still more useful than silence.

Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
@github-project-automation github-project-automation Bot moved this to Ready for Review in WebUI planning board Apr 15, 2026
@1000TurquoisePogs 1000TurquoisePogs marked this pull request as ready for review April 15, 2026 18:42
Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
@struga0258 struga0258 self-requested a review April 16, 2026 00:18
Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
@sonarqubecloud
Copy link
Copy Markdown

// --- Ref-value hover ---
const refName = getHoveredRefName(lineText, position.column);
if (refName) {
const allLines = model.getValue().split('\n');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

model.getValue().split('\n') is called for every hover, ctrl+click, and AT-TLS auto completion which might be a performance concern of someone has a giant monolithic AT-TLS policy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

2 participants