Skip to content

Add the ability to rename shapes #106

@kubukoz

Description

@kubukoz

Like in the title - the rename ability would be a great addition to the LSP.

My understanding is that a rename of shapes (not namespaces) would be relatively straightforward if we had some sort of "reference map", with locations or preferably ranges. The rename would change the shape name in both the definition and all the usages.

These are some of the edge cases we would have to capture:

  • renaming on a broken model: I think this should be disallowed, for simplicity of implementation
  • renaming a shape whose definition isn't in a document with the file:// schema: disallowed
  • renaming to a shape name that's already present in the namespace: disallowed
  • renaming to a shape name that's already available thanks to a use clause: should result in the use being inlined (or disallowed, for initial implementation simplicity)
  • shape IDs in nodes should be supported, e.g. in the @trait trait we have conflicts: shapeIdRef. I think this could be limited to @idRef String.

If you know of any other cases, let me know please! I may start some work on this in the upcoming weeks, but I'll report back first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions