Skip to content

Extract method / functiom must give feedback when a selection is not extractable and why #33501

@dbaeumer

Description

@dbaeumer

Testing #33282

function foo() {
	for (let i = 0; i < 10; i++) {
		if (i === 5)
			return;
	}
	console.log('Should not be printed');
}
  • select
	for (let i = 0; i < 10; i++) {
		if (i === 5)
			return;
	}
  • try to extract
  • nothing happens. No UI feedback why
  • change code to:
	for (let i = 0; i < 10; i++) {
		return;
	}
  • try extract again.

Observe: now it works.

Unclear if TS server provides info on why this is not possible in the first example.

Metadata

Metadata

Assignees

Labels

*out-of-scopePosted issue is not in scope of VS Codefeature-requestRequest for new features or functionalitytypescriptTypescript support issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions