IntelliSense
RDT provides full IntelliSense support for SAMO model elements — autocompletion suggestions as you type and go-to-definition navigation with Ctrl+Click.
How It Works
When the extension activates, it scans all model.xml files in your workspace and builds an in-memory index using a Trie data structure for fast prefix-based lookups. This index is automatically updated whenever a model.xml file changes.
Autocompletion
Autocompletion activates when you type a SAMO identifier prefix — ft_, cl_, cf_, or at_ — and when you type a dot (.) after a feature type or code list ID to access its attributes or columns. You can also invoke it manually with Ctrl+Space.
Feature Types (ft_)
Type ft_ followed by any characters to see matching feature types.
Each suggestion shows:
- Label:
ft_identifier - Human Readable Name - Detail: The feature type name
- Documentation: Number of attributes defined
GIF needed
Ft_ autocompletion — typing ft_fa and seeing ft_farm, ft_facility etc.
Example:
ft_fa| ← cursor here
Suggestions:
ft_farm - Farm
ft_facility - Facility
ft_factory - Factory
Results are sorted alphabetically and limited to 100 suggestions per query. Narrow down with more characters if your model is large.
Feature Type Attributes (ft_xxx.at_)
After typing a complete feature type ID followed by a dot (.), RDT suggests all attributes belonging to that feature type — including inherited attributes from parent feature types.
Each suggestion shows:
- Label:
at_identifier - Attribute Name - Detail: Attribute name
- Documentation: Data type and description (if available)
GIF needed
Dot-triggered attribute completion — typing ft_farm. and seeing at_name, at_area etc.
Example:
ft_farm.| ← cursor here
Suggestions:
at_name - Name (inherited from ft_base)
at_area - Area in Hectares
at_owner - Owner Reference
When you type ft_farm., you see at_name, at_description, at_created_date (inherited) plus at_area, at_owner (own attributes).
Code Lists (cl_)
Type cl_ to see available code lists.
Each suggestion shows:
- Label:
cl_identifier - Code List Name - Detail: Code list name
- Documentation: Number of columns and values
GIF needed
Cl_ autocompletion
Code List Columns (cl_xxx.col_)
After a complete code list ID and a dot, RDT suggests columns of that code list.
GIF needed
Cl_xxx. column completion
Example:
cl_country_codes.| ← cursor here
Suggestions:
col_iso - ISO Code
col_name - Country Name
col_region - Region
Filtered Code Lists (cf_)
Filtered code lists reference a base code list with additional filtering. Type cf_ to see available filtered code lists.
When you type cf_xxx., RDT resolves the underlying base code list and shows its columns.
GIF needed
Cf_ completion and dot-column access
Attributes (at_)
Type at_ to search across all attributes in the entire model, regardless of which feature type they belong to.
Each suggestion shows:
- Label:
at_identifier - Attribute Name - Detail: Attribute name
- Documentation: Owning feature type and description
GIF needed
At_ global attribute search
Summary Table
| Trigger | What It Completes | Includes Inherited? | Max Results |
|---|---|---|---|
ft_ + chars | Feature types by prefix | N/A | 100 |
ft_xxx. | Attributes of ft_xxx | Yes | All |
cl_ + chars | Code lists by prefix | N/A | 100 |
cl_xxx. | Columns of cl_xxx | N/A | All |
cf_ + chars | Filtered code lists by prefix | N/A | 100 |
cf_xxx. | Columns of base code list | N/A | All |
at_ + chars | All attributes by prefix | N/A | 100 |
Go-to-Definition
Hold Ctrl and click (or press F12) on any SAMO identifier to jump to its definition in the corresponding model.xml file. Use Alt+Left Arrow to navigate back to your previous position.
Supported Elements
| Pattern | Element | XML Tag |
|---|---|---|
ft_* | Feature Type | <ber:featureType id="..."> |
cl_* | Code List | <ber:codeList id="..."> |
at_* | Attribute | <ber:attribute>, <ber:derivedAttribute>, <ber:systemAttribute> |
ca_* | Code List Column | <ber:column>, <ber:codeListColumn> |
GIF needed
Ctrl+Click on different element types — ft_, cl_, at_, ca_ — each jumping to the correct model.xml location
How It Works
When you trigger go-to-definition:
- The word under the cursor is matched against a regex pattern (e.g.,
ft_[\p{L}0-9_]+for feature types) - All
model.xmlfiles in the workspace are searched for the matching XML element - The editor opens the file and scrolls to the exact line
Performance
The definition search engine uses an optimized strategy with:
- Content caching — file contents are cached with mtime-based invalidation
- Large file chunking — files over 10,000 lines are processed in 65KB chunks to prevent memory issues
- Streaming processing — files over 100,000 lines use a streaming approach
If a definition is not found in any model.xml file, RDT shows an informational message: "Element not found in any model.xml files".
Special Cases
- Root Feature Type (
ft_5000002): Shows an information message instead of navigating, as this is a built-in system type without a user-editable definition.
Model Scanning
Initial Scan
When the extension activates, it performs a full workspace scan:
- Finds all
model.xmlfiles using glob pattern**/model.xml - Parses each file using
fast-xml-parser - Extracts: feature types (with attributes), code lists (with columns/values), filtered code lists
- Builds Trie indices for prefix-based search
Live Updates
A file watcher monitors all model.xml files. When you save changes to a model file:
- The watcher detects the change
- The affected file is re-parsed
- The index is rebuilt with updated data
If IntelliSense feels stale (e.g., after a Git branch switch), you can reload the window (Ctrl+Shift+P → "Developer: Reload Window") to force a full rescan.