Git Product home page Git Product logo

yang-lsp's Introduction

yang-lsp

GH Build Status Build status

A language server for YANG (see Language Server Protocol).

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)

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

Build

  git clone https://github.com/TypeFox/yang-lsp.git
  cd yang-lsp/yang-lsp
  ./gradlew build

Release Engineering

The yang-lsp is the base of multiple binaries

Repository Client Binary Bin Repo CI Trigger
yang-lsp LSP JAR + script GH Action Artifacts GH Action GH Commit / PR
yangster Theia Browser Docker image Docker Hub Docker Hub GitHub hook / Jenkins pipeline
Theia Theia extension npm Jenkins yarn run publish
yangster-electron Theia Electron executables ? ? ?
yang-eclipse Eclipse p2 update site Eclipse Marketplace Jenkins GitHub hook / Jenkins pipeline
yang-vscode VSCode VSCode extension VSCode Marketplace - vsce

yang-lsp's People

Contributors

alextugarev avatar dhuebner avatar esmasth avatar huyuwen avatar jankoehnlein avatar jbicker avatar kaisalmen avatar kittaakos avatar meysholdt avatar spoenemann avatar svenefftinge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

yang-lsp's Issues

Color scheme

I hate the color scheme. I like black on white. Is it configurable?

Basic workspace and editor features

Basic workspace and editor features are missed:

  • Copy-paste
  • Import-export of files
  • Tab handling (close all, close all to the right etc)
  • Name of tab too long to fit does not show as tooltip
  • Git integration

Plug-Ins

A plug-in system shall allow third parties to contribute validation rules.
It shall be possible to add, remove and update plug-ins at runtime, by changing the yang-lsp setting file or the plug-in artifact.

Add validation constraint that checks the `config` value of a schema node

  • All key leafs in a list must have the same value for their "config" as the list itself.
  • If "config" is not specified, the default is the same as the parent schema node's "config" value.
  • If the parent node is a case node, the value is the same as the case node's parent choice node.
  • If the top node does not specify a "config" statement, the default is "true".
  • If a node has "config" set to "false", no node underneath it can have "config" set to "true".

Spec: https://tools.ietf.org/html/rfc7950#section-7.21.1

Implement parser for special values

Many statements in yang have a value that actually is an expression. We need to implement parser rules for them. I already tunes the lexer to go into a different mode on certain statements, now the emitted tokens need to consumed to build expression trees.

In the spec I saw the following value variants:

  • strings (just a quoted/unquoted string) - > nothing to do here
  • identifiers (elements with a name)
  • identifier-ref (prefix?:ID)
  • range (e.g. 1 .. 23)
  • date (e.g. 2017-06-07)
  • length
  • schema node identifier (subset of xpath)
  • instance node identifier (subset of xpath)
  • xpath

ABNF definitions of some of the rules can be found at the end of the spec (https://tools.ietf.org/html/rfc7950#section-14)
An xpath grammar can be found here (https://github.com/antlr/grammars-v4/blob/master/xpath/xpath.g4) (spec is here https://www.w3.org/TR/1999/REC-xpath-19991116/)

Formatter

We need to implement a formatter for yang.

NPE in scope context provider

Possibly related to #33.

YANG:

module moduleName {
  // yang-version 1.1;
  
 //yan
  
 
  namespace "urn:someUri";
  prefix "foo";



description "bar";

organization "org";

grouping foo {
        list feuillage {
            description "Local feuillage docstring";
            uses bar {
                refine blatt {
                    default "beech";
                }
            }
            uses baz {
                refine "leaves" {
                    default cz;
                }
                refine "leaves/cz/lupen" {
                    min-elements 0;
                }
                refine "leaves/dustbin/dustbin/hoja" {
                    description "Refined description of hoja";
                }
            }
            key "feuille";
        }
        anyxml rubbish;
    }
  
}

Exception:


java.lang.NullPointerException
	at io.typefox.yang.scoping.ScopeContextProvider.lambda$15(ScopeContextProvider.java:514)
	at io.typefox.yang.scoping.Linker.link(Linker.java:36)
	at io.typefox.yang.scoping.ScopeContextProvider.lambda$14(ScopeContextProvider.java:521)
	at io.typefox.yang.scoping.ScopeContext.lambda$12(ScopeContext.java:426)
	at java.util.ArrayList.forEach(ArrayList.java:1249)
	at io.typefox.yang.scoping.ScopeContext.resolveAll(ScopeContext.java:428)
	at io.typefox.yang.resource.YangResource.getEObject(YangResource.java:39)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:222)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doResolveLazyCrossReference(LazyLinkingResource.java:189)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReference(LazyLinkingResource.java:148)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReferences(LazyLinkingResource.java:134)
	at org.eclipse.xtext.EcoreUtil2.resolveLazyCrossReferences(EcoreUtil2.java:498)
	at org.eclipse.xtext.build.IncrementalBuilder$InternalStatefulIncrementalBuilder.lambda$launch$6(IncrementalBuilder.java:236)
	at org.eclipse.xtext.build.ClusteringStorageAwareResourceLoader.lambda$executeClustered$1(ClusteringStorageAwareResourceLoader.java:77)
	at org.eclipse.xtext.xbase.lib.internal.FunctionDelegate.apply(FunctionDelegate.java:42)
	at com.google.common.collect.Lists$TransformingRandomAccessList$1.transform(Lists.java:640)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
	at java.util.AbstractCollection.toArray(AbstractCollection.java:141)
	at java.util.ArrayList.addAll(ArrayList.java:577)
	at com.google.common.collect.Iterables.addAll(Iterables.java:350)
	at org.eclipse.xtext.build.ClusteringStorageAwareResourceLoader.executeClustered(ClusteringStorageAwareResourceLoader.java:80)
	at org.eclipse.xtext.build.BuildContext.executeClustered(BuildContext.java:55)
	at org.eclipse.xtext.build.IncrementalBuilder$InternalStatefulIncrementalBuilder.launch(IncrementalBuilder.java:251)
	at org.eclipse.xtext.build.IncrementalBuilder.build(IncrementalBuilder.java:399)
	at org.eclipse.xtext.build.IncrementalBuilder.build(IncrementalBuilder.java:384)
	at org.eclipse.xtext.ide.server.ProjectManager.doBuild(ProjectManager.java:115)
	at org.eclipse.xtext.ide.server.ProjectManager.doInitialBuild(ProjectManager.java:107)
	at org.eclipse.xtext.ide.server.BuildManager.doInitialBuild(BuildManager.java:149)
	at org.eclipse.xtext.ide.server.WorkspaceManager.refreshWorkspaceConfig(WorkspaceManager.java:148)
	at org.eclipse.xtext.ide.server.WorkspaceManager.initialize(WorkspaceManager.java:117)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$initialize$7(LanguageServerImpl.java:247)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.lock(RequestManager.java:146)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.lockWrite(RequestManager.java:80)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.initialize(LanguageServerImpl.java:250)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:51)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:105)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:203)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:139)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:149)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:77)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:84)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Jul 20, 2017 11:54:35 AM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint lambda$static$0
SEVERE: Internal error: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:53)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:105)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:203)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:139)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:149)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:77)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:84)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:51)
	... 11 more
Caused by: org.eclipse.emf.common.util.WrappedException: java.lang.NullPointerException
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:230)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doResolveLazyCrossReference(LazyLinkingResource.java:189)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReference(LazyLinkingResource.java:148)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReferences(LazyLinkingResource.java:134)
	at org.eclipse.xtext.EcoreUtil2.resolveLazyCrossReferences(EcoreUtil2.java:498)
	at org.eclipse.xtext.build.IncrementalBuilder$InternalStatefulIncrementalBuilder.lambda$launch$6(IncrementalBuilder.java:236)
	at org.eclipse.xtext.build.ClusteringStorageAwareResourceLoader.lambda$executeClustered$1(ClusteringStorageAwareResourceLoader.java:77)
	at org.eclipse.xtext.xbase.lib.internal.FunctionDelegate.apply(FunctionDelegate.java:42)
	at com.google.common.collect.Lists$TransformingRandomAccessList$1.transform(Lists.java:640)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
	at java.util.AbstractCollection.toArray(AbstractCollection.java:141)
	at java.util.ArrayList.addAll(ArrayList.java:577)
	at com.google.common.collect.Iterables.addAll(Iterables.java:350)
	at org.eclipse.xtext.build.ClusteringStorageAwareResourceLoader.executeClustered(ClusteringStorageAwareResourceLoader.java:80)
	at org.eclipse.xtext.build.BuildContext.executeClustered(BuildContext.java:55)
	at org.eclipse.xtext.build.IncrementalBuilder$InternalStatefulIncrementalBuilder.launch(IncrementalBuilder.java:251)
	at org.eclipse.xtext.build.IncrementalBuilder.build(IncrementalBuilder.java:399)
	at org.eclipse.xtext.build.IncrementalBuilder.build(IncrementalBuilder.java:384)
	at org.eclipse.xtext.ide.server.ProjectManager.doBuild(ProjectManager.java:115)
	at org.eclipse.xtext.ide.server.ProjectManager.doInitialBuild(ProjectManager.java:107)
	at org.eclipse.xtext.ide.server.BuildManager.doInitialBuild(BuildManager.java:149)
	at org.eclipse.xtext.ide.server.WorkspaceManager.refreshWorkspaceConfig(WorkspaceManager.java:148)
	at org.eclipse.xtext.ide.server.WorkspaceManager.initialize(WorkspaceManager.java:117)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$initialize$7(LanguageServerImpl.java:247)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.lock(RequestManager.java:146)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.lockWrite(RequestManager.java:80)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.initialize(LanguageServerImpl.java:250)
	... 16 more
Caused by: java.lang.NullPointerException
	at io.typefox.yang.scoping.ScopeContextProvider.lambda$15(ScopeContextProvider.java:514)
	at io.typefox.yang.scoping.Linker.link(Linker.java:36)
	at io.typefox.yang.scoping.ScopeContextProvider.lambda$14(ScopeContextProvider.java:521)
	at io.typefox.yang.scoping.ScopeContext.lambda$12(ScopeContext.java:426)
	at java.util.ArrayList.forEach(ArrayList.java:1249)
	at io.typefox.yang.scoping.ScopeContext.resolveAll(ScopeContext.java:428)
	at io.typefox.yang.resource.YangResource.getEObject(YangResource.java:39)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:222)
	... 42 more


Eclipse plugin

The current set of projects do not have an eclipse plugin included, because I did not want to go with the wizard's maven recommendation.

We should add an eclipse plug-in and create a build similar to the one we have for Xtext. I.e. the core bits are built with gradle and the eclipse plugin is built with Tycho consuming the gradle artifacts.

Substatement definition

I decided to make the parser relaxed about the the statement's substatements, order, arity of them, to allow to provide better messages and not to break the parsing process because of a violation.

In the spec there is a list of substatements for each statement. First one would be module (https://tools.ietf.org/html/rfc7950#section-7.1.1).

We need to

  • put those definitions in code
  • use them in validation
  • use them in content assist

Running latest docker image fails

docker@default:~$ docker run typefox/yangster yangster
container_linux.go:262: starting container process caused "exec: "yangster": executable file not found in $PATH"
docker: Error response from daemon: oci runtime error: container_linux.go:262: starting container process caused "exec: "yangster": executable file not found in $PATH".

Formatter revision

Continuation of #19.

  • Check indentation. #49
  • Align indentation configuration. #45
  • Do not use serializer in formatter test, cf. #49.
  • Throw formatter exceptions.
  • Handle HIDDEN regions, e.g. ", '
  • Fix formatting of XpathExpression, Expression, and SchemaNodeIdentifier
  • Create LSP integration test.

CI Build

We should have a public CI build

NPE in scoping when opening up a file while the workspace is being built right after LS startup

YANG:

module example-3-b {

  yang-version "1.1";

  namespace "http://example.com/example-3/b";

  prefix "ex3b";

  import example-3-b {
    prefix "oin";
    revision-date 2010-09-24;
  }

  import example-3-a {
    prefix "ex3a";
  }

  revision 2016-08-22;

  identity idY;

  identity idZ {
    base ex3a:idX;
    base idY;
  }

  augment "/ex3a:top" {
    if-feature "ex3a:fea1 or ex3a:fea2";
    uses ex3a:gbar;
    leaf baz {
      type oin:port-number;
    }
  }
}

Exception:

70024 [pool-1-thread-1] ERROR xt.linking.lazy.LazyLinkingResource  - resolution of uriFragment '|0' failed.
java.lang.NullPointerException
	at io.typefox.yang.scoping.ScopeContext$CompositeScope.lambda$3(ScopeContext.java:109)
	at org.eclipse.xtext.xbase.lib.internal.FunctionDelegate.apply(FunctionDelegate.java:42)
	at com.google.common.collect.Iterators$8.transform(Iterators.java:817)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
	at com.google.common.collect.Iterators$7.computeNext(Iterators.java:674)
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
	at org.eclipse.xtext.xbase.lib.IteratorExtensions.head(IteratorExtensions.java:145)
	at org.eclipse.xtext.xbase.lib.IterableExtensions.head(IterableExtensions.java:119)
	at io.typefox.yang.scoping.ScopeContext$CompositeScope.getSingleElement(ScopeContext.java:111)
	at io.typefox.yang.scoping.ScopeContext$MapScope.tryAddLocal(ScopeContext.java:65)
	at io.typefox.yang.scoping.ScopeContextProvider.lambda$17(ScopeContextProvider.java:605)
	at io.typefox.yang.scoping.ScopeContext.onComputeNodeScope(ScopeContext.java:506)
	at io.typefox.yang.scoping.GroupingInliningScopeContext.onComputeNodeScope(GroupingInliningScopeContext.java:121)
	at io.typefox.yang.scoping.ScopeContextProvider.addToNodeScope(ScopeContextProvider.java:615)
	at io.typefox.yang.scoping.ScopeContextProvider._inlineGrouping(ScopeContextProvider.java:438)
	at io.typefox.yang.scoping.ScopeContextProvider.inlineGrouping(ScopeContextProvider.java:906)
	at io.typefox.yang.scoping.ScopeContextProvider.lambda$5(ScopeContextProvider.java:388)
	at io.typefox.yang.scoping.ScopeContext.lambda$11(ScopeContext.java:412)
	at java.util.ArrayList.forEach(ArrayList.java:1249)
	at io.typefox.yang.scoping.ScopeContext.resolveDefinitionPhase(ScopeContext.java:414)
	at io.typefox.yang.resource.YangResource.getEObject(YangResource.java:42)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:222)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doResolveLazyCrossReference(LazyLinkingResource.java:189)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReference(LazyLinkingResource.java:148)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReferences(LazyLinkingResource.java:134)
	at org.eclipse.xtext.EcoreUtil2.resolveLazyCrossReferences(EcoreUtil2.java:498)
	at org.eclipse.xtext.build.IncrementalBuilder$InternalStatefulIncrementalBuilder.lambda$launch$6(IncrementalBuilder.java:236)
	at org.eclipse.xtext.build.ClusteringStorageAwareResourceLoader.lambda$executeClustered$1(ClusteringStorageAwareResourceLoader.java:77)
	at org.eclipse.xtext.xbase.lib.internal.FunctionDelegate.apply(FunctionDelegate.java:42)
	at com.google.common.collect.Lists$TransformingRandomAccessList$1.transform(Lists.java:640)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
	at java.util.AbstractCollection.toArray(AbstractCollection.java:141)
	at java.util.ArrayList.addAll(ArrayList.java:577)
	at com.google.common.collect.Iterables.addAll(Iterables.java:350)
	at org.eclipse.xtext.build.ClusteringStorageAwareResourceLoader.executeClustered(ClusteringStorageAwareResourceLoader.java:80)
	at org.eclipse.xtext.build.BuildContext.executeClustered(BuildContext.java:55)
	at org.eclipse.xtext.build.IncrementalBuilder$InternalStatefulIncrementalBuilder.launch(IncrementalBuilder.java:251)
	at org.eclipse.xtext.build.IncrementalBuilder.build(IncrementalBuilder.java:399)
	at org.eclipse.xtext.build.IncrementalBuilder.build(IncrementalBuilder.java:384)
	at org.eclipse.xtext.ide.server.ProjectManager.doBuild(ProjectManager.java:115)
	at org.eclipse.xtext.ide.server.ProjectManager.doInitialBuild(ProjectManager.java:107)
	at org.eclipse.xtext.ide.server.BuildManager.doInitialBuild(BuildManager.java:149)
	at org.eclipse.xtext.ide.server.WorkspaceManager.refreshWorkspaceConfig(WorkspaceManager.java:148)
	at org.eclipse.xtext.ide.server.WorkspaceManager.initialize(WorkspaceManager.java:117)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$initialize$8(LanguageServerImpl.java:253)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.lock(RequestManager.java:146)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.lockWrite(RequestManager.java:80)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.initialize(LanguageServerImpl.java:256)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:51)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:105)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:203)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:139)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:149)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:77)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:84)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Aug 02, 2017 1:42:23 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint lambda$static$0
SEVERE: Internal error: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:53)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:105)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:203)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:139)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:149)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:77)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:84)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:51)
	... 11 more
Caused by: org.eclipse.emf.common.util.WrappedException: java.lang.NullPointerException
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:230)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doResolveLazyCrossReference(LazyLinkingResource.java:189)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReference(LazyLinkingResource.java:148)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReferences(LazyLinkingResource.java:134)
	at org.eclipse.xtext.EcoreUtil2.resolveLazyCrossReferences(EcoreUtil2.java:498)
	at org.eclipse.xtext.build.IncrementalBuilder$InternalStatefulIncrementalBuilder.lambda$launch$6(IncrementalBuilder.java:236)
	at org.eclipse.xtext.build.ClusteringStorageAwareResourceLoader.lambda$executeClustered$1(ClusteringStorageAwareResourceLoader.java:77)
	at org.eclipse.xtext.xbase.lib.internal.FunctionDelegate.apply(FunctionDelegate.java:42)
	at com.google.common.collect.Lists$TransformingRandomAccessList$1.transform(Lists.java:640)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
	at java.util.AbstractCollection.toArray(AbstractCollection.java:141)
	at java.util.ArrayList.addAll(ArrayList.java:577)
	at com.google.common.collect.Iterables.addAll(Iterables.java:350)
	at org.eclipse.xtext.build.ClusteringStorageAwareResourceLoader.executeClustered(ClusteringStorageAwareResourceLoader.java:80)
	at org.eclipse.xtext.build.BuildContext.executeClustered(BuildContext.java:55)
	at org.eclipse.xtext.build.IncrementalBuilder$InternalStatefulIncrementalBuilder.launch(IncrementalBuilder.java:251)
	at org.eclipse.xtext.build.IncrementalBuilder.build(IncrementalBuilder.java:399)
	at org.eclipse.xtext.build.IncrementalBuilder.build(IncrementalBuilder.java:384)
	at org.eclipse.xtext.ide.server.ProjectManager.doBuild(ProjectManager.java:115)
	at org.eclipse.xtext.ide.server.ProjectManager.doInitialBuild(ProjectManager.java:107)
	at org.eclipse.xtext.ide.server.BuildManager.doInitialBuild(BuildManager.java:149)
	at org.eclipse.xtext.ide.server.WorkspaceManager.refreshWorkspaceConfig(WorkspaceManager.java:148)
	at org.eclipse.xtext.ide.server.WorkspaceManager.initialize(WorkspaceManager.java:117)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$initialize$8(LanguageServerImpl.java:253)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.lock(RequestManager.java:146)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.lockWrite(RequestManager.java:80)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.initialize(LanguageServerImpl.java:256)
	... 16 more
Caused by: java.lang.NullPointerException
	at io.typefox.yang.scoping.ScopeContext$CompositeScope.lambda$3(ScopeContext.java:109)
	at org.eclipse.xtext.xbase.lib.internal.FunctionDelegate.apply(FunctionDelegate.java:42)
	at com.google.common.collect.Iterators$8.transform(Iterators.java:817)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
	at com.google.common.collect.Iterators$7.computeNext(Iterators.java:674)
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
	at org.eclipse.xtext.xbase.lib.IteratorExtensions.head(IteratorExtensions.java:145)
	at org.eclipse.xtext.xbase.lib.IterableExtensions.head(IterableExtensions.java:119)
	at io.typefox.yang.scoping.ScopeContext$CompositeScope.getSingleElement(ScopeContext.java:111)
	at io.typefox.yang.scoping.ScopeContext$MapScope.tryAddLocal(ScopeContext.java:65)
	at io.typefox.yang.scoping.ScopeContextProvider.lambda$17(ScopeContextProvider.java:605)
	at io.typefox.yang.scoping.ScopeContext.onComputeNodeScope(ScopeContext.java:506)
	at io.typefox.yang.scoping.GroupingInliningScopeContext.onComputeNodeScope(GroupingInliningScopeContext.java:121)
	at io.typefox.yang.scoping.ScopeContextProvider.addToNodeScope(ScopeContextProvider.java:615)
	at io.typefox.yang.scoping.ScopeContextProvider._inlineGrouping(ScopeContextProvider.java:438)
	at io.typefox.yang.scoping.ScopeContextProvider.inlineGrouping(ScopeContextProvider.java:906)
	at io.typefox.yang.scoping.ScopeContextProvider.lambda$5(ScopeContextProvider.java:388)
	at io.typefox.yang.scoping.ScopeContext.lambda$11(ScopeContext.java:412)
	at java.util.ArrayList.forEach(ArrayList.java:1249)
	at io.typefox.yang.scoping.ScopeContext.resolveDefinitionPhase(ScopeContext.java:414)
	at io.typefox.yang.resource.YangResource.getEObject(YangResource.java:42)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:222)
	... 42 more


Theia Application

In a separate repository (any suggestions for a cool name?) we should start working on a Theia-based YANG tool. First step would be setup and integration of this language server.

Open Symbol

Open symbol should show top level definitions, with simple name and proper kind.

[formatter] Multiline strings

Continuation of #19.

Leading whitespaces should be preserved:

    contact
     "WG Web:   <http://tools.ietf.org/wg/netmod/>
      WG List:  <mailto:[email protected]>
     
      WG Chair: David Kessens
                <mailto:[email protected]>
     
      WG Chair: Juergen Schoenwaelder
                <mailto:[email protected]>
     
      Editor:   Juergen Schoenwaelder
                <mailto:[email protected]>
     ";

Indentation should be fixed:

        "This revision adds the following new data types:
         - yang-identifier
         - hex-string
         - uuid
         - dotted-quad
        ";

Indentation of concatenations should be fixed:

      pattern
        '$0$.*'
        // comment
      + '|$1$[a-zA-Z0-9./]{1,8}$[a-zA-Z0-9./]{22}'
      + '|$5$(rounds=\d+$)?[a-zA-Z0-9./]{1,16}$[a-zA-Z0-9./]{43}'
      + /* comment */ '|$6$(rounds=\d+$)?[a-zA-Z0-9./]{1,16}$[a-zA-Z0-9./]{86}';

[formatter] Indentation broken

The following document doesn't format properly

submodule augment-sub1 {
  belongs-to augment-super {
    prefix "as";
  }

  include augment-sub0;

  augment "/interfaces" {
    list ifEntry {
    key "ifIndex";

    leaf ifIndex {
      type int32;
    }
  }
    leaf llm1 {
    type string;
    mandatory true;
  }
  }
} 

Settings

Yang-lsp should look for a .yang-settings.json in the root directory (and possibly later user home).

The settings object should allow the user to change:

  • severities of issues
  • configure editing features (e.g. enable/disable code lens)
  • list plugins

This ticket is only about the infrastructure, to provide an object to any clients that contains the information and provides change events. Could possibly done generically and moved up to Xtext.

[template] Allow multiple templates per keyword

I need to provide multliple templates per keyword, not only one.
Seems like it is currently not possible, since the names of the fields in io.typefox.yang.ide.completion.YangTemplateProvider.YangTemplates are used.

Support for YANG 1 and 1.1

Seems like most people still use yang-version 1.
We should support both.

This ticket is about having the cardinality constraints supporting both and enforcing one or the other depending on the specified yang-version(none yang-version specified means 1)

LS throws exception when the AST is broken

YANG:

module moduleName {
  // yang-version 1.1;
  
 //yan
  y
 
  namespace "urn:someUri";
  prefix "foo";



description "bar";

organization "org";

grouping foo {
        list feuillage {
            description "Local feuillage docstring";
            uses bar {
                refine blatt {
                    default "beech";
                }
            }
            uses baz {
                refine "leaves" {
                    default cz;
                }
                refine "leaves/cz/lupen" {
                    min-elements 0;
                }
                refine "leaves/dustbin/dustbin/hoja" {
                    description "Refined description of hoja";
                }
            }
            key "feuille";
        }
        anyxml rubbish;
    }
  
}

Exception:


java.lang.NullPointerException
	at io.typefox.yang.scoping.ScopeContextProvider.lambda$15(ScopeContextProvider.java:514)
	at io.typefox.yang.scoping.Linker.link(Linker.java:36)
	at io.typefox.yang.scoping.ScopeContextProvider.lambda$14(ScopeContextProvider.java:521)
	at io.typefox.yang.scoping.ScopeContext.lambda$12(ScopeContext.java:426)
	at java.util.ArrayList.forEach(ArrayList.java:1249)
	at io.typefox.yang.scoping.ScopeContext.resolveAll(ScopeContext.java:428)
	at io.typefox.yang.resource.YangResource.getEObject(YangResource.java:39)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:222)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doResolveLazyCrossReference(LazyLinkingResource.java:189)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReference(LazyLinkingResource.java:148)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReferences(LazyLinkingResource.java:134)
	at org.eclipse.xtext.EcoreUtil2.resolveLazyCrossReferences(EcoreUtil2.java:498)
	at org.eclipse.xtext.build.IncrementalBuilder$InternalStatefulIncrementalBuilder.lambda$launch$6(IncrementalBuilder.java:236)
	at org.eclipse.xtext.build.ClusteringStorageAwareResourceLoader.lambda$executeClustered$1(ClusteringStorageAwareResourceLoader.java:77)
	at org.eclipse.xtext.xbase.lib.internal.FunctionDelegate.apply(FunctionDelegate.java:42)
	at com.google.common.collect.Lists$TransformingRandomAccessList$1.transform(Lists.java:640)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
	at java.util.AbstractCollection.toArray(AbstractCollection.java:141)
	at java.util.ArrayList.addAll(ArrayList.java:577)
	at com.google.common.collect.Iterables.addAll(Iterables.java:350)
	at org.eclipse.xtext.build.ClusteringStorageAwareResourceLoader.executeClustered(ClusteringStorageAwareResourceLoader.java:80)
	at org.eclipse.xtext.build.BuildContext.executeClustered(BuildContext.java:55)
	at org.eclipse.xtext.build.IncrementalBuilder$InternalStatefulIncrementalBuilder.launch(IncrementalBuilder.java:251)
	at org.eclipse.xtext.build.IncrementalBuilder.build(IncrementalBuilder.java:399)
	at org.eclipse.xtext.build.IncrementalBuilder.build(IncrementalBuilder.java:384)
	at org.eclipse.xtext.ide.server.ProjectManager.doBuild(ProjectManager.java:115)
	at org.eclipse.xtext.ide.server.BuildManager.internalBuild(BuildManager.java:182)
	at org.eclipse.xtext.ide.server.BuildManager.lambda$submit$0(BuildManager.java:130)
	at org.eclipse.xtext.ide.server.WorkspaceManager.lambda$didChangeFiles$2(WorkspaceManager.java:174)
	at org.eclipse.xtext.ide.server.LanguageServerImpl$2.apply(LanguageServerImpl.java:327)
	at org.eclipse.xtext.ide.server.LanguageServerImpl$2.apply(LanguageServerImpl.java:325)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.lambda$bind$6(RequestManager.java:135)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.lock(RequestManager.java:146)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.lockWrite(RequestManager.java:80)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.lambda$null$0(RequestManager.java:95)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
	at java.util.concurrent.CompletableFuture.postFire(CompletableFuture.java:561)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:580)
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:442)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
74365 [pool-3-thread-1] ERROR Indexer$ResolvedResourceDescription  - java.lang.IllegalStateException: getReferenceDescriptions file:///Users/akos.kitta/Desktop/yangster-app/yang-lsp/yang-lsp/io.typefox.yang.ide/src/test/resources/good/amodule.yang
java.lang.IllegalStateException: getReferenceDescriptions file:///Users/akos.kitta/Desktop/yangster-app/yang-lsp/yang-lsp/io.typefox.yang.ide/src/test/resources/good/amodule.yang
	at org.eclipse.xtext.build.Indexer$ResolvedResourceDescription.getReferenceDescriptions(Indexer.java:182)
	at io.typefox.yang.ide.codelens.CodeLensService.lambda$0(CodeLensService.java:106)
	at org.eclipse.xtext.xbase.lib.internal.FunctionDelegate.apply(FunctionDelegate.java:42)
	at com.google.common.collect.Iterators$8.transform(Iterators.java:817)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
	at java.lang.Iterable.forEach(Iterable.java:74)
	at io.typefox.yang.ide.codelens.CodeLensService.computeCodeLenses(CodeLensService.java:114)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$null$32(LanguageServerImpl.java:688)
	at org.eclipse.xtext.ide.server.WorkspaceManager.doRead(WorkspaceManager.java:284)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$codeLens$33(LanguageServerImpl.java:692)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.lambda$bind$6(RequestManager.java:135)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.lock(RequestManager.java:146)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.lockRead(RequestManager.java:76)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.lambda$null$2(RequestManager.java:105)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:442)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Connection to local file system

How can I and how should I load, save files to my local filesystem?

Can I work in this and still keep the files in my local file system?

Browser stops responding when trying to enter a new line after a line that has a trailing semicolon

Try this script and enter a new line after namespace "urn:test:amodule";.

module amodule {
/*03*/
  namespace "urn:test:amodule";
/*04*/
  prefix "amodule";
/*05*/

  organization "organização güi";
/*06*/
  contact "àéïç¢ô";
/*07*/

  grouping x {
/*08*/
    leaf y { type string; }
/*09*/
  }
/*10*/

  rpc run {
    input { uses x; }
/*11*/
    output { uses x; }
  }
/*12*/
  container amodule {
/*13*/
    choice z;
  }

  augment /amodule/z {
/*14*/
    container foo {
/*15*/
      leaf a {
        type string;
      }
    }
  }

}

Thread dump from the server:

Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.121-b13 mixed mode):

"pool-6-thread-2" #28 prio=5 os_prio=31 tid=0x00007fee7ed60800 nid=0x7503 runnable [0x00007000027c5000]
   java.lang.Thread.State: RUNNABLE
	at java.lang.Thread.isInterrupted(Native Method)
	at java.lang.Thread.isInterrupted(Thread.java:961)
	at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:441)
	at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
	at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:941)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"pool-6-thread-1" #27 prio=5 os_prio=31 tid=0x00007fee7c5ef000 nid=0x7303 runnable [0x00007000026c2000]
   java.lang.Thread.State: RUNNABLE
	at java.lang.Thread.isInterrupted(Native Method)
	at java.lang.Thread.isInterrupted(Thread.java:961)
	at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:441)
	at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
	at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:941)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"pool-3-thread-1" #26 prio=5 os_prio=31 tid=0x00007fee82446000 nid=0x7103 runnable [0x00007000025bf000]
   java.lang.Thread.State: RUNNABLE
	at java.lang.Thread.isInterrupted(Native Method)
	at java.lang.Thread.isInterrupted(Thread.java:961)
	at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:441)
	at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
	at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:941)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"RequestManager-Queue-0" #25 daemon prio=5 os_prio=31 tid=0x00007fee7cd5f800 nid=0x1007 waiting on condition [0x00007000024bc000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x000000077c9b6560> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
	at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"pool-1-thread-1" #24 prio=5 os_prio=31 tid=0x00007fee8087d800 nid=0x1407 waiting on condition [0x00007000023b9000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x000000076f74b800> (a java.util.concurrent.CountDownLatch$Sync)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:997)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1304)
	at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:231)
	at sun.nio.ch.PendingFuture.get(PendingFuture.java:180)
	at java.nio.channels.Channels$2.read(Channels.java:239)
	- locked <0x000000077c923df0> (a java.nio.channels.Channels$2)
	at java.io.InputStream.read(InputStream.java:101)
	at java.nio.channels.Channels$2.read(Channels.java:211)
	- locked <0x000000077c923df0> (a java.nio.channels.Channels$2)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:61)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:84)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"Thread-10" #23 daemon prio=5 os_prio=31 tid=0x00007fee7d0d1000 nid=0x6f03 waiting on condition [0x00007000022b6000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x000000077b85ee50> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
	at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
	at sun.nio.ch.KQueuePort$EventHandlerTask.run(KQueuePort.java:270)
	at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"Thread-9" #22 daemon prio=5 os_prio=31 tid=0x00007fee7c81b800 nid=0x6d03 waiting on condition [0x00007000021b3000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x000000077b85ee50> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
	at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
	at sun.nio.ch.KQueuePort$EventHandlerTask.run(KQueuePort.java:270)
	at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"Thread-8" #21 daemon prio=5 os_prio=31 tid=0x00007fee7d1f0800 nid=0x6b03 runnable [0x00007000020b0000]
   java.lang.Thread.State: RUNNABLE
	at sun.nio.ch.KQueue.keventPoll(Native Method)
	at sun.nio.ch.KQueuePort$EventHandlerTask.poll(KQueuePort.java:196)
	at sun.nio.ch.KQueuePort$EventHandlerTask.run(KQueuePort.java:276)
	at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"Thread-7" #20 daemon prio=5 os_prio=31 tid=0x00007fee7bd70000 nid=0x6903 waiting on condition [0x0000700001fad000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x000000077b85ee50> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
	at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
	at sun.nio.ch.KQueuePort$EventHandlerTask.run(KQueuePort.java:270)
	at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"Thread-6" #19 daemon prio=5 os_prio=31 tid=0x00007fee7d8a3800 nid=0x6703 waiting on condition [0x0000700001eaa000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x000000077b85ee50> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
	at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
	at sun.nio.ch.KQueuePort$EventHandlerTask.run(KQueuePort.java:270)
	at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"Thread-5" #18 daemon prio=5 os_prio=31 tid=0x00007fee7bd6f000 nid=0x6503 waiting on condition [0x0000700001da7000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x000000077b85ee50> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
	at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
	at sun.nio.ch.KQueuePort$EventHandlerTask.run(KQueuePort.java:270)
	at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"Thread-4" #17 daemon prio=5 os_prio=31 tid=0x00007fee7be03000 nid=0x6303 waiting on condition [0x0000700001ca4000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x000000077b85ee50> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
	at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
	at sun.nio.ch.KQueuePort$EventHandlerTask.run(KQueuePort.java:270)
	at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"Thread-3" #16 daemon prio=5 os_prio=31 tid=0x00007fee7d8a3000 nid=0x6103 waiting on condition [0x0000700001ba1000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x000000077b85ee50> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
	at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
	at sun.nio.ch.KQueuePort$EventHandlerTask.run(KQueuePort.java:270)
	at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"Thread-2" #15 daemon prio=5 os_prio=31 tid=0x00007fee79c9c000 nid=0x5f03 waiting on condition [0x0000700001a9e000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x000000077b85ee50> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
	at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
	at sun.nio.ch.KQueuePort$EventHandlerTask.run(KQueuePort.java:270)
	at java.lang.Thread.run(Thread.java:745)

"EMF Reference Cleaner" #13 daemon prio=5 os_prio=31 tid=0x00007fee7b1bf000 nid=0x5d03 in Object.wait() [0x000070000199b000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
	- locked <0x00000006c000ee98> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
	at org.eclipse.emf.common.util.CommonUtil$1ReferenceClearingQueuePollingThread.run(CommonUtil.java:70)

"Service Thread" #12 daemon prio=9 os_prio=31 tid=0x00007fee7b82a800 nid=0x5903 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C1 CompilerThread3" #11 daemon prio=9 os_prio=31 tid=0x00007fee7b00e800 nid=0x5703 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread2" #10 daemon prio=9 os_prio=31 tid=0x00007fee7b036000 nid=0x5503 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" #9 daemon prio=9 os_prio=31 tid=0x00007fee7b82e000 nid=0x5303 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" #8 daemon prio=9 os_prio=31 tid=0x00007fee7a014800 nid=0x5103 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"JDWP Command Reader" #7 daemon prio=10 os_prio=31 tid=0x00007fee7c800000 nid=0x4f03 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"JDWP Event Helper Thread" #6 daemon prio=10 os_prio=31 tid=0x00007fee7b82d000 nid=0x4d03 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"JDWP Transport Listener: dt_socket" #5 daemon prio=10 os_prio=31 tid=0x00007fee7b82c800 nid=0x4b03 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" #4 daemon prio=9 os_prio=31 tid=0x00007fee79876000 nid=0x4903 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" #3 daemon prio=8 os_prio=31 tid=0x00007fee7b826800 nid=0x3903 in Object.wait() [0x0000700000e7a000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
	- locked <0x00000006c0026820> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)

"Reference Handler" #2 daemon prio=10 os_prio=31 tid=0x00007fee7b007000 nid=0x3703 in Object.wait() [0x0000700000d77000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	at java.lang.Object.wait(Object.java:502)
	at java.lang.ref.Reference.tryHandlePending(Reference.java:191)
	- locked <0x00000006c000f6d8> (a java.lang.ref.Reference$Lock)
	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153)

"main" #1 prio=5 os_prio=31 tid=0x00007fee7a002000 nid=0x1c03 waiting on condition [0x0000700000359000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x000000077b85e518> (a java.util.concurrent.CountDownLatch$Sync)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:997)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1304)
	at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:231)
	at sun.nio.ch.PendingFuture.get(PendingFuture.java:180)
	at io.typefox.yang.diagram.RunSocketServer.main(RunSocketServer.java:66)

"VM Thread" os_prio=31 tid=0x00007fee7b822000 nid=0x3503 runnable 

"GC task thread#0 (ParallelGC)" os_prio=31 tid=0x00007fee7980d800 nid=0x2503 runnable 

"GC task thread#1 (ParallelGC)" os_prio=31 tid=0x00007fee7980e800 nid=0x2703 runnable 

"GC task thread#2 (ParallelGC)" os_prio=31 tid=0x00007fee7980f000 nid=0x2903 runnable 

"GC task thread#3 (ParallelGC)" os_prio=31 tid=0x00007fee7980f800 nid=0x2b03 runnable 

"GC task thread#4 (ParallelGC)" os_prio=31 tid=0x00007fee79810000 nid=0x2d03 runnable 

"GC task thread#5 (ParallelGC)" os_prio=31 tid=0x00007fee79811000 nid=0x2f03 runnable 

"GC task thread#6 (ParallelGC)" os_prio=31 tid=0x00007fee79811800 nid=0x3103 runnable 

"GC task thread#7 (ParallelGC)" os_prio=31 tid=0x00007fee79812000 nid=0x3303 runnable 

"VM Periodic Task Thread" os_prio=31 tid=0x00007fee7c011800 nid=0x5b03 waiting on condition 

JNI global references: 5340

Heap
 PSYoungGen      total 310272K, used 201178K [0x000000076ab00000, 0x0000000788f80000, 0x00000007c0000000)
  eden space 275456K, 62% used [0x000000076ab00000,0x0000000775351820,0x000000077b800000)
  from space 34816K, 82% used [0x000000077b800000,0x000000077d425348,0x000000077da00000)
  to   space 37888K, 0% used [0x0000000786a80000,0x0000000786a80000,0x0000000788f80000)
 ParOldGen       total 109056K, used 40590K [0x00000006c0000000, 0x00000006c6a80000, 0x000000076ab00000)
  object space 109056K, 37% used [0x00000006c0000000,0x00000006c27a3800,0x00000006c6a80000)
 Metaspace       used 29252K, capacity 30218K, committed 30464K, reserved 1075200K
  class space    used 3563K, capacity 3749K, committed 3840K, reserved 1048576K

[validation] missleading error message

In this context

...

  organization "organização güi";
  contact "àéïç¢ô";

  import d {
     prefix "test";
  }
...

I get the error message Substatement 'import' must be declared before 'contact'..
It has to be before organization.

[diagram] Add implicit case node

schema elements (container, list, leaf-list, leaf) that are direct children of a choice node, get an implicit case node using the same name as the schema node.

Contribution of actions that work on Yang files

We dearly need a way to contribute actions in the Yangster GUI provided by Theia, so that we can hook in our own transformations that work on Yang files. There are already a few existing transformations that the user of the Ericsson extended Yangster must have available by (for example) right-clicking on the Yang file(s):

  • A pre-processor that generates a target specific version of the Yang file
  • A generator for database schema for the configuration store back end

The generated result may be any format (yang, xml, ...) and is expected to show up in the Files view.

XpathExpressions are not serializable

For example, instance of when "foo!=42" is not serializable.

Error message is:

java.lang.RuntimeException: Could not serialize XpathBinaryOperation via backtracking.
Constraint: XpathAdditiveExpr_XpathAndExpr_XpathEqualityExpr_XpathMultiplicativeExpr_XpathOrExpr_XpathRelationalExpr_XpathUnionExpr_XpathBinaryOperation returns XpathBinaryOperation: (
    (left=XpathOrExpr_XpathBinaryOperation_1_0 operator='or' right=XpathAndExpr) | 
    (left=XpathAndExpr_XpathBinaryOperation_1_0 operator='and' right=XpathEqualityExpr) | 
    (left=XpathEqualityExpr_XpathBinaryOperation_1_0 (operator='=' | operator='!=') right=XpathRelationalExpr) | 
    (left=XpathRelationalExpr_XpathBinaryOperation_1_0 (operator='<' | operator='>' | operator='<=' | operator='>=') right=XpathAdditiveExpr) | 
    (left=XpathAdditiveExpr_XpathBinaryOperation_1_0 (operator='+' | operator='-') right=XpathMultiplicativeExpr) | 
    (left=XpathMultiplicativeExpr_XpathBinaryOperation_1_0 (operator='*' | operator='div' | operator='mod') right=XpathMultiplicativeExpr) | 
    (left=XpathUnionExpr_XpathBinaryOperation_1_0 operator='|' right=XpathUnionExpr)
);
Values: left(1), operator(1), right(1)
Semantic Object: Module'augtest'.substatements[3]->Rpc'agoj'.substatements[0]->Input.substatements[0]->Uses.substatements[0]->Augment.substatements[0]->When.condition->XpathBinaryOperation
URI: __synthetic0.yang
Context: XpathExpression returns XpathBinaryOperation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.