Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to rename shapes #106

Open
kubukoz opened this issue May 12, 2023 · 0 comments
Open

Add the ability to rename shapes #106

kubukoz opened this issue May 12, 2023 · 0 comments

Comments

@kubukoz
Copy link
Contributor

kubukoz commented May 12, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant