File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
main/java/nextflow/lsp/services/config
test/groovy/nextflow/lsp/services/config Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,12 @@ public boolean matchesFile(String uri) {
4848
4949 @ Override
5050 public void initialize (LanguageServerConfiguration configuration ) {
51+ initialize (configuration , new PluginSpecCache (configuration .pluginRegistryUrl ()));
52+ }
53+
54+ public void initialize (LanguageServerConfiguration configuration , PluginSpecCache pluginSpecCache ) {
5155 synchronized (this ) {
52- pluginSpecCache = new PluginSpecCache ( configuration . pluginRegistryUrl ()) ;
56+ this . pluginSpecCache = pluginSpecCache ;
5357 astCache .initialize (configuration , pluginSpecCache );
5458 }
5559 super .initialize (configuration );
Original file line number Diff line number Diff line change 1616
1717package nextflow.lsp.services.config
1818
19+ import nextflow.config.spec.SpecNode
20+ import nextflow.lsp.TestLanguageClient
21+ import nextflow.lsp.services.LanguageServerConfiguration
22+ import nextflow.lsp.spec.PluginSpec
23+ import nextflow.lsp.spec.PluginSpecCache
1924import org.eclipse.lsp4j.Hover
2025import org.eclipse.lsp4j.HoverParams
2126import org.eclipse.lsp4j.Position
@@ -55,8 +60,18 @@ class ConfigHoverTest extends Specification {
5560
5661 def ' should get hover hint for a plugin config scope' () {
5762 given :
58- def service = getConfigService()
5963 def uri = getUri(' nextflow.config' )
64+ def service = new ConfigService (workspaceRoot(). toUri(). toString())
65+ def configuration = LanguageServerConfiguration . defaults()
66+ def pluginSpecCache = Spy (new PluginSpecCache (configuration. pluginRegistryUrl()))
67+ pluginSpecCache. get(' nf-prov' , ' 1.6.0' ) >> new PluginSpec (
68+ [
69+ ' prov' : new SpecNode.Scope (' The `prov` scope allows you to configure the `nf-prov` plugin.' , [:])
70+ ],
71+ [], [], []
72+ )
73+ service. connect(new TestLanguageClient ())
74+ service. initialize(configuration, pluginSpecCache)
6075
6176 when :
6277 open(service, uri, ''' \
You can’t perform that action at this time.
0 commit comments