Skip to content

namelist support: highlighting; folding; outline#1302

Open
MuellerSeb wants to merge 1 commit intofortran-lang:mainfrom
MuellerSeb:nml_support
Open

namelist support: highlighting; folding; outline#1302
MuellerSeb wants to merge 1 commit intofortran-lang:mainfrom
MuellerSeb:nml_support

Conversation

@MuellerSeb
Copy link

@MuellerSeb MuellerSeb commented Jan 21, 2026

Closes: #1296

This pull request adds comprehensive support for Fortran Namelist files (.nml, .namelist) to the extension. It introduces syntax highlighting, folding, outline (symbol) support, and proper language registration for these files. The changes include a new language configuration, a TextMate grammar, symbol provider logic, and updates to the extension's activation and manifest files.

Fortran Namelist Language Support

  • Added a new language definition for Fortran Namelist in package.json, including file extensions, configuration, and icon. (package.jsonR120-R135)
  • Registered the new language for activation and associated it with a TextMate grammar for syntax highlighting. ([1], [2])
  • Introduced a language configuration file (language-configuration.namelist.json) to provide comment styles, bracket/quote pairs, and folding markers for Namelist files. (language-configuration.namelist.jsonR1-R30)
  • Added a TextMate grammar (syntaxes/fortran_namelist.tmLanguage.json) for Namelist syntax highlighting, including keywords, assignments, numbers, strings, booleans, and comments. (syntaxes/fortran_namelist.tmLanguage.jsonR1-R58)

Namelist Outline/Symbol Support

  • Implemented a NamelistDocumentSymbolProvider to provide outline support for Namelist files, enabling navigation of blocks and variables in the editor. Registered this provider in the extension activation logic. ([1], [2], [3])

Documentation

  • Updated the README.md to advertise Namelist syntax highlighting, folding, and outline support. (README.mdR35)

@MuellerSeb MuellerSeb marked this pull request as draft January 21, 2026 14:11
@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.65%. Comparing base (1c8b212) to head (986c618).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1302   +/-   ##
=======================================
  Coverage   81.65%   81.65%           
=======================================
  Files          13       13           
  Lines        2436     2436           
  Branches      203      203           
=======================================
  Hits         1989     1989           
  Misses        442      442           
  Partials        5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MuellerSeb MuellerSeb marked this pull request as ready for review January 22, 2026 09:28
@MuellerSeb
Copy link
Author

@gnikit ping. 🙃

Copy link
Member

@gnikit gnikit left a comment

Choose a reason for hiding this comment

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

I don't think this should be its own language id, see my comment

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if namelist should be its own language id. From a language perspective it is a Fortran feature. For how this extension is wired it should be defined in FreeForm injected like the other scopes, and then inherited via FixedForm without any need to modify.

The fact that it has dedicated extensions make it a bit annoying, but the above approach is reasonable and would work. As a side note an LSP would not consider them different entities so symbols will be parsed as normal sources and symbols will be displayed respectively, hence no need for the explicit fallback.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Namelist support from Fortran-Namelist extension

2 participants