nextflow-io / nextflow-io/language-server

subMap not recognized as a valid method for record types

Open
#169 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
31
Forks
8
Avg merge
1d 10h
Merged PRs (30d)
2

Description

According to the records documentation, subMap is a valid method for the record type.

When using the Nextflow extension, this is not recognized and the workflow is highlighted as having an error.

Image

The error given is: Unrecognized method subMap for type Record

Code to reproduce:

nextflow.enable.types = true

workflow {
	main:

	def x: Channel<Record> = channel.of(
		record(id: "example", value: "value1"),
		record(id: "example2", value: "value2")
	)

	x.map{r: Record -> 
		def y: Record = r.subMap(["id"])
		println("y: ${y}, type: ${y.getClass()}")
	}

}

This does run through nextflow fine:

 N E X T F L O W   ~  version 26.04.6

Launching `tmp.nf` [fabulous_shannon] revision: 4f7fe37fd8

WARN: Static typing is a preview feature -- syntax and behavior may change in future releases
y: [id:example], type: class nextflow.util.RecordMap
y: [id:example2], type: class nextflow.util.RecordMap

Nextflow version: 26.04.6
Language-server version: 26.04.2
VS Code extension version: 1.7.1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the diagnostic with the provided typed Nextflow workflow using the listed language-server and VS Code extension versions. Trace how the language server recognizes methods for the Record type and compare that behavior with the records documentation and successful Nextflow run. Done means subMap is no longer reported as an unrecognized method.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.