Skip to content

Project relative path in Open Declaration popup where applicable - #623

Merged
mickaelistria merged 1 commit into
eclipse-lsp4e:masterfrom
BoykoAlex:declaration-label
May 2, 2023
Merged

mickaelistria merged 1 commit into
eclipse-lsp4e:masterfrom
BoykoAlex:declaration-label

Conversation

@BoykoAlex

Copy link
Copy Markdown
Contributor

No description provided.

@mickaelistria

Copy link
Copy Markdown
Contributor

Wouldn't it be better to make it relative to current resource?

@martinlippert

Copy link
Copy Markdown
Contributor

Wouldn't it be better to make it relative to current resource?

I like that idea, since it might make the path even shorter (which is good I think), but on the other hand I am worried about the case where the popup shows multiple resources that are in a different area of the project, so that the path would show up like ../../some/other/application.yml and ../../../../bar/application.properties, which might make it quite difficult to understand each of those locations.

@mickaelistria

Copy link
Copy Markdown
Contributor

So maybe showing resource-relative path for siblings and their children; and maybe even single parent (only one ../), and a project relative path for other cases?

@martinlippert

Copy link
Copy Markdown
Contributor

Maybe it makes even sense to show the name of the file as a first element of the path, then a visual separator (e.g. -), followed by the path from the project root or a resource-relative path for siblings and their children.

My assumption is that the file name is probably the most important part to visualize here, so showing this front and center might make sense, I think.

@BoykoAlex

BoykoAlex commented May 1, 2023 •

Copy link
Copy Markdown
Contributor Author

I wouldn't want to pass the document URI to calculate the path relative to the currently opened file path... It is highly likely that file opened in the editor belongs to the workspace. Therefore showing (locationType) - (file name) - (workspace relative file path) should be okay. Don't think project relative path would be too long. VSCode seems to show workspace relative paths as well. If declaration file is not in the workspace then full absolute file path is okay to show i think... we could in this case show the file name in the middle as well...
Or perhaps just add containing folder at the end (workspace relative) rather than repeat the file name again.

@BoykoAlex
BoykoAlex force-pushed the declaration-label branch from 8858abe to e9cb43f Compare May 1, 2023 22:07
@BoykoAlex
BoykoAlex force-pushed the declaration-label branch from e9cb43f to 6882be5 Compare May 1, 2023 22:39

@mickaelistria mickaelistria left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the current proposal is good enough to be merged.

@mickaelistria
mickaelistria merged commit 71fdc02 into eclipse-lsp4e:master May 2, 2023
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

Successfully merging this pull request may close these issues.

3 participants