Skip to content

Not always able to rename extension type E using "rename symbol" #55495

@matanlurey

Description

@matanlurey

I am not sure if this is specific to VSCode, I'd imagine it's an LSP/Analysis server thing.

Workspace Environment
Dart Code extension: 3.86.0

App: Visual Studio Code
App Host: desktop
Version: mac 1.88.1

Workspace type: Dart (LSP)

Dart (3.3.1): /opt/homebrew/Caskroom/flutter/3.19.3/flutter/bin/cache/dart-sdk
Flutter (3.19.3): /opt/homebrew/Caskroom/flutter/3.19.3/flutter (No device)

extension type Foo(int v) {
  Foo.bar() : this(0);

  Foo get baz => Foo(0);
}

Imagine I want to rename this from Foo to Bar, so I right-click Foo and hit "rename symbol".

It works sometimes, but not other times - here is what I see:

  1. ✅ Right-click Foo in extension type Foo(int v) { ... }:

  2. ❌ Select Foo first, and then right-click/rename:

    Note that foo is selected, unlike in (1) where I've highlighted/selected nothing:

    v is accidentally selected as what I intended to rename, instead of Foo:

  3. ❌ Right-click Foo in Foo.bar() : this(0):

    bar is accidentally selected as what I intended to rename, instead of Foo:

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work ondevexp-refactoringIssues with analysis server refactoringslegacy-area-analyzerUse area-devexp instead.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions