Skip to content

Commit

Permalink
Add yangPathIgnore setting
Browse files Browse the repository at this point in the history
This allows for exclusion of specific subdirs or files under the dirs
specified via `yangPath`.

Also added github ci checks markdown files to fix markdownlint issues.

This addresses TypeFox#232

Signed-off-by: Siddharth Sharma <[email protected]>
  • Loading branch information
esmasth committed Apr 12, 2024
1 parent 25593e8 commit 56543b0
Show file tree
Hide file tree
Showing 12 changed files with 206 additions and 76 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ end_of_line = crlf
[*.yml]
indent_style = space
indent_size = 2

[{*.xtext,*.xtend,*.java}]
indent_style = tab
indent_size = 4
10 changes: 10 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ on:
- master

jobs:
mdlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@v15
with:
globs: |
**/*.md
!build/**/*.md
!bin/**/*.md
build:
runs-on: ubuntu-latest
steps:
Expand Down
7 changes: 7 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"MD013": {
"line_length": 80,
"code_block_line_length": 120,
"tables": false
}
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
],
"url": "./schema/yang-lsp-settings-schema.json"
}
]
],
"markdownlint.ignore": ".gitignore"
}
45 changes: 31 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@
[![GH Build Status](https://github.com/TypeFox/yang-lsp/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/TypeFox/yang-lsp/actions/workflows/main.yml)
[![Build status](https://ci.appveyor.com/api/projects/status/96eo9k5yo0wtpj50/branch/master?svg=true)](https://ci.appveyor.com/project/kittaakos/yang-lsp/branch/master)

A language server for YANG (see [Language Server Protocol](https://github.com/Microsoft/language-server-protocol)).
A language server for YANG (see [Language Server Protocol][lsp]).

## Usage

The language server application is available in two distributions:

- `yang-language-server_<version>.zip` (plain language server)
- `yang-language-server_diagram-extension_<version>.zip` (language server with diagram extension for [sprotty](https://github.com/theia-ide/sprotty))
- `yang-language-server_diagram-extension_<version>.zip` (language server with
diagram extension for [sprotty][sprotty])

Both variants include start scripts to launch the background process. Connect its input/output streams to your host application in order to communicate with the language server.
Both variants include start scripts to launch the background process. Connect
its input/output streams to your host application in order to communicate with
the language server.

The YANG Language Server is currently being used in

- [YANGSTER](https://github.com/theia-ide/yangster) based on [Theia](https://github.com/theia-ide/theia) (incl. diagram extension)
- [Yang VS Code](https://github.com/TypeFox/yang-vscode) available on the [VS Marketplace](https://marketplace.visualstudio.com/items?itemName=typefox.yang-vscode)
- [Yang Eclipse](https://github.com/theia-ide/yang-eclipse)
- [YANGSTER][yangster] based on [Theia][theia] (incl. diagram extension)
- [YANG VS Code][yang-vscode] available on the [VS Marketplace][yang-vscode-vsm]
- [YANG Eclipse][yang-eclipse]

## Build

Expand All @@ -32,11 +35,25 @@ The YANG Language Server is currently being used in

The yang-lsp is the base of multiple binaries

| Repository | Client | Binary | Bin Repo | CI | Trigger |
| ---------- | ------ | ------ | -------- | --- | ------- |
| [yang-lsp](https://github.com/TypeFox/yangs-lsp) | LSP | JAR + script | GH Action Artifacts | [GH Action](https://github.com/TypeFox/yang-lsp/actions/workflows/main.yml) | GH Commit / PR |
| [yangster](https://github.com/theia-ide/yangster) | Theia Browser | Docker image | Docker Hub | [Docker Hub](https://hub.docker.com/r/typefox/yangster/builds) | GitHub hook / Jenkins pipeline|
| | Theia | Theia extension| npm | [Jenkins](http://services.typefox.io/open-source/jenkins/job/yangster/) | `yarn run publish` |
| [yangster-electron](https://github.com/theia-ide/yangster-electron) | Theia Electron | executables | ? | ? | ? |
| [yang-eclipse](https://github.com/theia-ide/yang-eclipse) | Eclipse | p2 update site | Eclipse Marketplace | [Jenkins](http://services.typefox.io/open-source/jenkins/job/yang-eclipse/) | GitHub hook / Jenkins pipeline |
| [yang-vscode](https://github.com/TypeFox/yang-vscode) | VSCode | VSCode extension | VSCode Marketplace | - | `vsce` |
| Repository | Client | Binary | Bin Repo | CI | Trigger |
| -------------------------------------- | -------------- | ---------------- | ------------------- | -------------------------- | ------- |
| [yang-lsp][yang-lsp] | LSP | JAR + script | GH Action Artifacts | [GH Action][yang-lsp-ci] | GH Commit / PR |
| [yangster][yangster] | Theia Browser | Docker image | Docker Hub | [Docker Hub][yangster-ci] | GitHub hook / Jenkins pipeline|
| | Theia | Theia extension | npm | [Jenkins][yangster-ci2] | `yarn run publish` |
| [yangster-electron][yangster-electron] | Theia Electron | executables | ? | ? | ? |
| [yang-eclipse][yang-eclipse] | Eclipse | p2 update site | Eclipse Marketplace | [Jenkins][yang-eclipse-ci] | GitHub hook / Jenkins pipeline |
| [yang-vscode][yang-vscode] | VSCode | VSCode extension | VSCode Marketplace | - | `vsce` |

[lsp]: https://github.com/Microsoft/language-server-protocol
[sprotty]: https://github.com/theia-ide/sprotty
[yang-lsp]: https://github.com/TypeFox/yang-lsp
[yang-lsp-ci]: https://github.com/TypeFox/yang-lsp/actions/workflows/main.yml
[theia]: https://github.com/theia-ide/theia
[yangster]: https://github.com/theia-ide/yangster
[yangster-ci]: https://hub.docker.com/r/typefox/yangster/builds
[yangster-ci2]: http://services.typefox.io/open-source/jenkins/job/yangster/
[yangster-electron]: https://github.com/theia-ide/yangster-electron
[yang-vscode]: https://github.com/TypeFox/yang-vscode
[yang-vscode-vsm]: https://marketplace.visualstudio.com/items?itemName=typefox.yang-vscode
[yang-eclipse]: https://github.com/theia-ide/yang-eclipse
[yang-eclipse-ci]: http://services.typefox.io/open-source/jenkins/job/yang-eclipse/
11 changes: 7 additions & 4 deletions docs/Extensions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Extensions

The yang-lsp allows to have additional third party extensions, configured through `yang.settings`.
For details on file format and schema see [Settings.md](./Settings.md).
The yang-lsp allows to have additional third party extensions, configured
through `yang.settings`. For details on file format and schema see
[Settings.md](./Settings.md).

So far two different kinds of extensions are supported :

Expand All @@ -10,7 +11,9 @@ So far two different kinds of extensions are supported :

## Create a Validator

A validator extension is a Java class that implements the interface `io.typefox.yang.validation.IValidatorExtension`.
A validator extension is a Java class that implements the interface
`io.typefox.yang.validation.IValidatorExtension`.

Here is a small example:

```java
Expand Down Expand Up @@ -50,7 +53,7 @@ class MyCommand implements ICommandExtension {
* return a list of commands. A command string is used as ID internally and as a label in the UI.
*/
override getCommands() {
#[COMMAND]
#[COMMAND]
}

/**
Expand Down
13 changes: 10 additions & 3 deletions docs/Processing_Files.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Processing YANG files

As yang-lsp contains all the tools to parse, link and validate YANG models. If you want to further process the YANG files you authored with yang-lsp it makes sense to make reuse of the existing functionality.
As yang-lsp contains all the tools to parse, link and validate YANG models. If
you want to further process the YANG files you authored with yang-lsp it makes
sense to make reuse of the existing functionality.

Here is some example code in Xtend for an application that reads in all YANG files from a given directory. The files are parsed into our YANG EMF model, all cross-references are resolved and all files are validated. If there are no errors, the method `generate()` is called for all resources:
Here is some example code in Xtend for an application that reads in all YANG
files from a given directory. The files are parsed into our YANG EMF model, all
cross-references are resolved and all files are validated. If there are no
errors, the method `generate()` is called for all resources:

```xtend
package io.typefox.yang.example
Expand Down Expand Up @@ -66,7 +71,7 @@ class StandaloneExample {
}
```

A number of useful helper methods can be found in the [utils package](https://github.com/TypeFox/yang-lsp/tree/master/yang-lsp/io.typefox.yang/src/main/java/io/typefox/yang/utils)
A number of useful helper methods can be found in the [utils package][1]

Here is sample `build.gradle` to build the above class:

Expand Down Expand Up @@ -98,3 +103,5 @@ dependencies {
compile 'com.google.inject:guice:3.0'
}
```

[1]: https://github.com/TypeFox/yang-lsp/tree/master/yang-lsp/io.typefox.yang/src/main/java/io/typefox/yang/utils
Loading

0 comments on commit 56543b0

Please sign in to comment.