TypeFox / yang-lsp

A Language Server for YANG
http://www.yang-central.org
Apache License 2.0
51 stars 13 forks source link

Multiple revisions are available [abc, abc] #127

Closed gorshkov-leonid closed 6 years ago

gorshkov-leonid commented 6 years ago

There is a warning "Multiple revisions are available [abc, abc]" appeared if it is exists in several folders. But in case when file copied to working folder (for example target folder in maven project) it should be skipped. How to exclude folder from file watcher?

JanKoehnlein commented 6 years ago

We currently don't have a config to exclude folders, as it's likely to be different for different clients (Theia, VSCode, Eclipse). We could add something in the yang.settings file.

Which client are you using? Are you using YANG along with Maven?

gorshkov-leonid commented 6 years ago

We use yang-lsp in Eclipse Che with Maven projects. I thought this feature does not depend on client and should use root folder or workspace folders in InitializeParams. How is it working now? Yang lsp uses working directory? If it is not difficult a param 'rootFolder' would be useful

gorshkov-leonid commented 6 years ago

It is another isuue :) but I think excluded pathes should relate to root folder and should not depend on clients

JanKoehnlein commented 6 years ago

I was referring to clients because I've seen this (and have been annoyed by it) in the Eclipse version as well, where JDT automatically copies the YANG files from source folders to the respective binary folders. In your case, it's not the client but Maven. The essence is, it is not caused by the language server but by external tools/clients duplicating files somewhere below the same root/project/workspace folders.

I am not aware of any semantics on paths in YANG but I'd expect users to have YANG files that should be aware of each other in different directories in the same workspace. So just processing YANG files in the rootDir/workspace folder doesn't seem to be an option.

As the location of the duplicates depends on external tools or clients, we cannot solve this generically in the LS, So I'd propose to add an exclusion pattern to the yang.settings, such that every user can adapt it to the remaining tools in their chains.

gorshkov-leonid commented 6 years ago

I agree.. any way to pass settings (cli arguments, settings file) it is acceptable to us.

JanKoehnlein commented 6 years ago

The property excludePath in the yang.settings JSON file can now point to a colon separated list of excluded directories, e.g.

{
   "excludePath": "build/classes:bin/foo" 
}

Path separator is always /

gorshkov-leonid commented 6 years ago

Thank you!!!

JanKoehnlein commented 6 years ago

PS: Are you using yangster or just the yang-lsp in Che? The former is a Theia extension which also provides graphical views on your model. Theia is going to be the new IDE technology of Che, so this will come to you for free sooner or later.