Skip to content

remove prefix and update symbol#1198

Open
thomasp85 wants to merge 5 commits into
posit-dev:mainfrom
thomasp85:issue-995-test-prefix
Open

remove prefix and update symbol#1198
thomasp85 wants to merge 5 commits into
posit-dev:mainfrom
thomasp85:issue-995-test-prefix

Conversation

@thomasp85
Copy link
Copy Markdown
Collaborator

@thomasp85 thomasp85 commented May 5, 2026

Fix #995

This is just to get my feet wet with the smallest of issues, even though the issue asked for some discussion around it.

This PR removes the "Test: " prefix in the outline and instead uses a different icon to differentiate. There is no perfect symbol kind for tests but the Type Parameter visually maps well as it is a T in angle brackets. If we don't like this conflation of symbols we can revert

image

Copy link
Copy Markdown
Contributor

@lionel- lionel- left a comment

Choose a reason for hiding this comment

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

Looks good!

Just need to discuss/revert this before merging:

the Type Parameter visually maps well as it is a T in angle brackets.

I would revert back to Function or maybe Method because:

  • That's what most LSPs do. Although arguably most languages use decorated functions for tests, which isn't the case for testthat.

  • It would interfere with symbol discovery when filtering symbols. If you're looking for a type, it would be surprising to find test_that() calls. Less so if you're looking for a function.

@thomasp85
Copy link
Copy Markdown
Collaborator Author

Fair, I was going more after visual queues than semantics of the symbol. If we are going for semantics I feel that function/method is not right either as this is really a call/expression. However, nothing in that vein is available to us.

So, I'm fine reverting to using the old function though I do feel it would be nice if the tests were visually separated from helper functions etc now that the prefix is gone. Your call

@lionel-
Copy link
Copy Markdown
Contributor

lionel- commented May 5, 2026

Maybe Method would convey that separation?

@thomasp85
Copy link
Copy Markdown
Collaborator Author

Well, sadly they use the same icon 🫠

Still, it's not a blocker for me so I'll update to use that... Unless you are ok with something like Object which is visually distinct and sorta correct in that an expression is an object of sorts..

@lionel-
Copy link
Copy Markdown
Contributor

lionel- commented May 6, 2026

Let's just use Function I think. Semantically, test_that() blocks are like immediately invoked functions since they create a nested scope. It's not perfect but it's not awful either.

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.

Don't preface each test with "Test:" in the outline

2 participants