Closed gorshkov-leonid closed 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?
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
It is another isuue :) but I think excluded pathes should relate to root folder and should not depend on clients
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.
I agree.. any way to pass settings (cli arguments, settings file) it is acceptable to us.
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 /
Thank you!!!
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.
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?