YANG Language Support using pyang.
This package can be used on Visual Studio Code, as well as any other Code - OSS and Theia derivatives that are compatible with VS Code Extension API.
Following features are provided directly by this Language Extension
- Syntax highlighting
- Comment toggling
- Brackets definition
- Autoclosing
- Autosurrounding
See: Syntax Highlight, Language Configuration
pyang provides LSP based features for YANG, all of which are supported
by the extension, except pull diagnostics since it is not automatically
triggered.
See pyang documentation corresponding to installation for expected features.
See: Programmatic Language Features, Language Server Extension Guide
The extension requires a pyang version installation that supports LSP. At the
time of writing, only a work in progress pyang supports --lsp --no-env-path
arguments, which are used to execute it as an LSP server.
The WIP pyang fork supporting LSP can be found here, and needs
to be installed instead of official pyang package. Note that all versions of
the fork are not necessarily compatible with every version of this extension,
hence latest versions of both should be used, unless advised otherwise.
This extension contributes the following settings:
pyang.cli.argsExtra
pyangCLI arguments, above--lsp --no-env-path(which are already provided). This allows for tuning of LSP server defaults, providing search paths, and provisioning ofpyangplugins, for example.pyang.trace.serverLSP trace level.
pyang.debug.server.enableLSP is used via TCP socket, instead of stdio.
pyang.debug.server.hostLSP Server Host, when LSP is used via TCP socket.
pyang.debug.server.portLSP Server Port, when LSP is used via TCP socket.
This extension contributes the following commands:
-
pyang.client.restartpyang: Restart Language Serverrestarts the language client and in turn reinstantiates the language server. Whenpyang.debug.server.enableis set, it merely reinitiates the TCP connection and hence TCP server should already be initiated. -
pyang.editor.tree.diagrampyang: Generate YANG Tree Diagramgenerates the YANG Tree diagram source text corresponding to the YANG file in the active editor, and brings the generated file into focus. -
pyang.editor.puml.diagrampyang: Generate PlantUML Diagramgenerates the PlantUML diagram source text corresponding to the YANG file in the active editor, and brings the generated diagram via 'jebbs.plantuml' into focus.
Missing pyang or older installations that do not meet requirements are not
handled gracefully.
Change of some settings e.g., CLI arguments, requires reload of manual reload of
the editor. pyang: Restart Language Server command reuses the settings from
the last startup.
For issues pertaining to the language server, please refer to documentation for
pyang.
- Added YANG file template snippets for module and submodule
- Added Markdown code fenced syntax highlighting for
yangandyangtree - Updated keybinding for
pyang: Generate YANG Tree DiagramtoAlt+Y T - Updated keybinding for
pyang: Generate PlantUML DiagramtoAlt+Y U
- Added menu items in editor context to generate PlantUML and YANG Tree Diagrams
- Improved usability of the PlantUML and YANG Tree Diagram generation. Requires latest version of pyang with LSP support.
- Improved syntax highlighting of YANG Tree Diagrams
- Added status bar item
pyangfor editors which are served by the extension. - Associated
.yang.treeextension with YANG Tree Diagram
- Extension now has an icon
- YANG Tree Diagram has a file icon
- Added command
pyang: Generate PlantUML Diagram - Added command
pyang: Generate YANG Tree Diagram
pyang.cli.argsconfiguration is now empty by defaultpyangstartup arguments now include--verbose, in addition to--lspand--no-env-patharguments earlier- Added support for YANG Tree Diagram syntax highlighting.
.yangtreeand.ytdfile extensions are registered as YANG Tree Diagram by default.
- Added support for pyang's "References" Code Lens command
- Added support for older VS Code >= 1.65.0
- Added command
pyang: Restart Language Server
Initial release of the extension