STAR*NET Language Support for VSCode
Visual Studio Code extension for STARNET survey adjustment work: syntax highlighting, hover tooltips and validation for STARNET data files (.dat), navigation and a review of flagged items for STARNET adjustment listings (.lst), and support for Trimble DiNi digital level files (M5 .DAT), including conversion to STARNET leveling data.
Features
🎨 Syntax Highlighting
Full syntax highlighting support for STAR*NET data files including:
- Data Line Types: C, E, P, A, D, V, B, M, BM, DV, TB, T, TE, DB, DN, DM, DE, SS, L
- Inline Options: .UNITS, .DELTA, .3D, .SCALE, .REFRACTION, and more
- Comments: Lines starting with
#
- Angles: DMS format (123-45-30.5)
- Bearings: N45-30-15E format
- Fixity Symbols: !, *, &
- Descriptors: Text following single quotes
- Measurements: Coordinates, distances, elevations
Intelligent hover support showing:
- Data Line Formats: Hover over line type codes (C, M, TB, etc.) to see expected format and examples
- Inline Options: Descriptions of what each option does
- Fixity Symbols:
! = Fixed (observation will not be adjusted)
* = Free (observation has no weight/influence)
& = Default (use project default standard error)
- Special Formats: HI/HT (Height of Instrument/Target), angles, bearings
⚡ Code Completion
Auto-completion suggestions for:
- All data line type codes
- Inline options with descriptions
- Quick insertion with proper spacing
📁 Code Folding
Automatic code folding for:
- Traverse blocks (TB...TE)
- Direction sets (DB...DE)
🔍 Validation (Problems panel)
Data files are checked as you type:
| Check |
Severity |
| Unknown data type code |
Error |
| Unknown inline option (see Known Issues) |
Error |
| Inline option missing a required value |
Error |
| Data line with too few fields |
Error |
| TE without TB, DE without DB, or a TB/DB block never closed |
Error |
| Ambiguous inline option abbreviation |
Warning |
| Invalid inline option value |
Warning |
| T outside TB…TE, or DN/DM outside DB…DE |
Warning |
| Possibly malformed angle |
Warning |
| Station defined more than once |
Information |
| Station referenced but never given coordinates |
Hint |
Inline option names and values are case-insensitive and may be abbreviated, as the STAR*NET manual allows (.Sep, .U, .DE). Hints appear as faint dots under the text and are not listed in the Problems panel. Checks run on files on disk and unsaved files, not on the old version shown in a diff view.
STAR*NET Listing Files (.lst)
The listing STARNET writes after an adjustment opens as **STARNET Listing**. Built for 3D adjustments; verified on STAR*NET 13 listings (versions 12 and 14 are expected to work but have not been verified yet).
🧭 Find sections fast
The Outline view, breadcrumbs and folding follow STARNET's own section index, the table of contents STARNET writes at the end of every listing (the same one behind its Listing Index Tree). If the index is missing, or the listing has been edited since STAR*NET wrote it, these features stay off rather than guess at headings.
🚩 What STAR*NET flagged, in the Problems panel
The extension only repeats what STAR*NET itself printed:
| Item |
Severity |
Standardized residuals flagged with * (StdRes over 3.0) |
Information |
STAR*NET Warning: lines, including a failed Chi-Square test (with the manual's explanation of upper- vs lower-bound failures) |
Warning |
Positional Tolerance Check rows marked * |
Warning |
| Positional Tolerance Check summary, "N of M connections failed" |
Warning if any failed, otherwise Information |
A * after an adjusted angle or direction is STARNET's face-2 marker, not a blunder flag, and is never reported. The copy of your input data files that STARNET can include in the listing is never scanned, so comments in your .dat files can't trigger anything.
🔗 Jump to the source observation
Ctrl+click (or F12) the File:Line value at the end of an adjusted observation row. You get the matching line in the listing's copy of the input data (when "Copy of Input Data File(s)" is on) and the line in the input file itself when it can be found: first relative to the listing's folder, then at the full path STAR*NET recorded.
File:Line values appear only when STAR*NET's "File References" listing option is on.
📏 Optional station ellipse limit
Set starnet.lst.maxEllipseSemiMajor (and starnet.lst.maxEllipseUnits) to list every station whose Station Coordinate Error Ellipse semi-major axis exceeds your limit. The limit is converted into the units the listing prints (Meters, FeetUS or FeetInt), and the values are compared exactly as printed. When the Chi-Square test fails, STAR*NET has already enlarged them by the Total Error Factor.
This is a quick sanity check on absolute station ellipses, which depend on what you held fixed. It is not a standards test. STAR*NET's Positional Tolerance Check, which uses relative ellipses between stations, is the standards test (for example, ALTA/NSPS relative positional precision).
How listings are recognised
Many programs use .lst, so this extension does not claim the extension. A file is opened as a STARNET listing when its first line is STARNET's banner (for example MicroSurvey STAR*NET-PRO Version 13...).
- If another installed extension claims
.lst, it wins over first-line detection. To force STARNET listings, add a files.associations entry such as "**/STARNET/**/*.lst": "starnet-lst" (adjust the pattern to your folders), or pick **STARNET Listing** from the language picker in the status bar.
- STAR*NET writes listings in a Windows code page. VS Code opens files as UTF-8 by default, so a
© in the echoed input shows as �. It is harmless. If it bothers you, click the encoding in the status bar and choose Reopen with Encoding → Western (Windows 1252). A "[starnet-lst]" files.encoding setting does not help here, because VS Code picks the encoding before it reads the first line.
- VS Code turns off syntax highlighting for files over 20 MB or 300,000 lines, and does not pass files over 50 MB to extensions at all, so very large listings open as plain text with no outline or Problems entries.
Trimble DiNi M5 Files (.DAT)
Trimble DiNi digital levels also write .DAT files, in M5 format. A file whose first line starts with For M5| is switched automatically to the Trimble DiNi M5 language, so the STAR*NET highlighting, hovers and checks never run on it.
For M5|Adr 1|TO synthetic-m5.dat | | | |
For M5|Adr 2|TO Start-Line BF 1| | | |
For M5|Adr 3|KD1 BMA BM 1| | |Z 100.0000 ft |
For M5|Adr 4|KD1 BMA BM 09:00:371 1|Rb 5.1234 ft |HD 98.40 ft | |
For M5|Adr 5|KD1 1 09:01:141 1|Rf 3.0021 ft |HD 97.85 ft | |
For M5|Adr 6|KD1 1 1| | |Z 102.1213 ft |
(Invented data.)
Highlighting by the fixed M5 columns from the DiNi user guide: record type, point ID, code, time, line number, type identifiers, values and units. Lines marked ##### (a repeated measurement's original reading, "not used for computing") stand out.
Folding of each line leveling run, Start-Line to End-Line.
Hovers on For M5, Adr, TO/KD1/KD2, the type identifiers (Rb, Rf, Z, HD, Sh, dz, Db, Df, …), units and #####, worded from the guide's tables.
Backsight check (Problems panel, Information). Within each line, every backsight (Rb) should be on the point the previous setup foresighted (Rf), and the first backsight on the line's starting point. A mismatch almost always means a typo'd point ID. ##### readings are skipped as the guide specifies. Only lines measured with the BF method are checked.
Rename a point ID (F2). Put the cursor on a point ID and press F2. The ID changes in the point-ID field of every record in the file, right-justified in its 8 columns, and nothing else is touched. IDs longer than 8 characters, or with spaces or |, are refused.
Convert to STAR*NET leveling data. Run STAR*NET: Convert DiNi M5 to Leveling Data from the Command Palette. Each line is split into sections between stations, with turning points collapsed, and every section becomes L From-To ElevDiff Distance:
- ElevDiff = Σ(Rb − Rf) over the section's setups.
- Distance = total distance traversed, backsight plus foresight HD. No standard error is written, so STAR*NET weights by distance from your project defaults.
- DiNi
ft is the US survey foot, so the block is wrapped in .UNITS FeetUS … .UNITS.
- The result opens as a new unsaved STAR*NET document; nothing is written to disk.
- Self-check: every section's ElevDiff must equal the difference of the heights (Z) the level recorded, within rounding. If any section fails, you get a list of the failing sections and no output.
- Only BF lines are converted; lines measured with other methods, or continued after an interruption (
Cont-Line), are skipped and listed.
How stations are told from turning points is set by starnet.dini.stationMode. The first and last point of every line are always stations.
| Mode |
Stations |
Turning points |
alpha (default) |
IDs containing a letter |
numeric-only IDs |
prefix |
everything else |
IDs starting with starnet.dini.turningPointPrefix (default TP, any case) |
numericRange |
IDs with letters, and numeric IDs from starnet.dini.stationRangeMin to stationRangeMax |
other numeric-only IDs |
Keep the original. The file downloaded from the level is your field record. Make your fixes (renamed points, corrected IDs) in a copy and leave the original untouched.
Installation
From the Marketplace
Search for STAR*NET Data File Support in the Extensions view (Ctrl+Shift+X).
From VSIX Package
- Get the latest
.vsix file
- Open VSCode
- Go to Extensions (Ctrl+Shift+X)
- Click the
... menu at the top
- Select "Install from VSIX..."
- Choose the downloaded
.vsix file
From Command Line
code --install-extension starnet-dat-1.0.0.vsix
Usage
- Open a STARNET data file (
.dat), a STARNET listing (.lst) or a Trimble DiNi M5 file (.DAT). The extension activates and picks the right language automatically.
- Hover over codes, options and type identifiers to see documentation
- In data files, use
Ctrl+Space for auto-completion suggestions
- Open the Problems panel (
Ctrl+Shift+M) for validation results
Example Data File
# Sample STAR*NET Project
.UNITS FeetUS
.3D
# Fixed coordinates
C 1 1000.00 2000.00 100.00 ! ! ! 'Control Point A
# Traverse
TB N45-30-40W 'Starting bearing
T 1 123-40-28 537.52 90-00-00 5.1/5.2
T 2 217-11-37 719.56 89-30-15 5.2/5.1
TE 5
# Measurements
M 2-1-3 134-45-12 2244.35 91-22-54 5.1/5.2 'Iron Pipe
A 3-2-4 102-34-12.5 2.5
D Roger-Frank 1034.23 0.05
B tower-flagpole N34-23-45.7E !
# Leveling
L 101-105 -7.476 12634 'BM to BM
Supported Data Types
| Code |
Description |
| C/CH |
Coordinates (with optional ellipsoid height) |
| E/EH |
Elevation (with optional ellipsoid height) |
| P/PH |
Geodetic Position |
| A |
Horizontal Angle |
| D |
Distance |
| V |
Vertical Observation (Zenith/Elevation Diff) |
| B |
Bearing or Azimuth |
| M |
Measure (all observations to a point) |
| BM |
Bearing and Measurements |
| DV |
Distance and Vertical |
| TB/T/TE |
Traverse Begin/Point/End |
| DB/DN/DM/DE |
Direction Set Begin/Direction/Direction+Measure/End |
| SS |
Sideshot |
| L |
Differential Leveling |
| G0-G3 |
GPS Vector data |
Inline Options Supported
.UNITS - Change units (FeetUS, Meters, etc.)
.DELTA - Toggle slope/zenith or horiz/elev diff mode
.ORDER - Change coordinate (NE/EN) or angle (AtFromTo/FromAtTo) order
.3D / .2D / .3REDUCE - Change data format mode
.SCALE - Apply scale factor
.REFRACTION - Set refraction coefficient
.PELEVATION - Set project elevation
.INSTRUMENT - Change weighting scheme
.ELLIPSE - Specify error ellipse output
.RELATIVE - Specify relative error ellipse connections
.PTOLERANCE - Specify positional tolerance checking
.MAPMODE - Use bearings/azimuths in traverses
.COPYINPUT - Control input data copying to listing
.LWEIGHT - Change leveling observation weighting
.DATA - Enable/disable data reading (debugging)
.CURVE - Enable/disable earth curvature corrections
.ADDCENTERING - Apply centering errors to explicit standard errors
.EDM - Set EDM error calculation method
.LOSTSTATIONS - Mark stations as lost (not shown on plot)
.ALIAS - Define point name aliases
.PRISM - Apply prism offset corrections
.NORMALIZE - Control normalization of reverse face observations
.INCLUDE - Include another data file
.SEPARATOR - Change station name separator
.LONGITUDE - Set longitude sign convention
.ELEVATION - Specify elevation type (orthometric/ellipsoidal)
.MULTIPLIER - Apply unit conversion multiplier
.VLEVEL - Convert STAR*LEV format data
.MEASURED / .GRID - Define observation types in grid projects
Requirements
- Visual Studio Code version 1.75.0 or higher
Extension Settings
This extension works out of the box. It activates when you open a .dat file or a STAR*NET listing.
| Setting |
Default |
Description |
starnet.lst.maxEllipseSemiMajor |
empty (off) |
Maximum station error ellipse semi-major axis to allow in listings (see above) |
starnet.lst.maxEllipseUnits |
FeetUS |
Units of that limit: Meters, FeetUS or FeetInt |
starnet.dini.stationMode |
alpha |
How the DiNi converter tells stations from turning points: alpha, prefix or numericRange |
starnet.dini.turningPointPrefix |
TP |
Turning-point prefix for mode prefix |
starnet.dini.stationRangeMin / stationRangeMax |
empty |
Numeric station range for mode numericRange |
Language Features
Syntax Highlighting Colors
The extension uses standard TextMate scopes that work with all VSCode themes:
- Keywords (data codes): Theme's keyword color
- Comments: Theme's comment color
- Strings (descriptors): Theme's string color
- Numbers: Theme's number color
- Constants (angles, bearings): Theme's constant color
- Operators (fixity symbols): Theme's operator color
Code Intelligence
- Hover Information: Detailed format specifications and examples
- IntelliSense: Context-aware code completion
- Code Folding: Collapse traverse and direction set blocks
Known Issues
- STARNET-PRO inline options such as
.GPS are reported as "Unknown inline option" errors, although STARNET accepts them.
- A station given coordinates twice is reported as Information, although STAR*NET simply uses the first set (a normal way to supply provisional coordinates).
- Listing support has been verified on STAR*NET 13 listings (3D adjustments). Versions 12 and 14 are expected to work but have not been verified yet.
- For DiNi files, only lines measured with the BF method are checked and converted. Lines measured with other methods, or continued after an interruption (
Cont-Line), are skipped or refused with a message.
Please report problems to support@rooksurveysoftware.com.
Release Notes
See CHANGELOG.md (shown on the Marketplace Changelog tab).
Contributing
Bug reports and feature suggestions are welcome at support@rooksurveysoftware.com.
Credits
Based on the STAR*NET adjustment software by MicroSurvey Software Inc.
Documentation references:
- STAR*NET Reference Manual (v10), including Chapter 5 "Preparing Input Data"
- Trimble DiNi Digital Level User Guide, ver. 4.0
Resources
Support
Published by Rook Survey Software.
Questions or issues: support@rooksurveysoftware.com
License
MIT License - See LICENSE file for details
Enjoy using STAR*NET Language Support!
If you find this extension helpful, please consider:
Product and file-format names mentioned here are trademarks of their respective owners. This extension is an independent project by Rook Survey Software and is not affiliated with or endorsed by them.