bazelbuild / intellij

IntelliJ plugin for Bazel projects
https://ij.bazel.build/
Apache License 2.0
757 stars 298 forks source link

Add 'View project root' flag #6422

Closed tpasternak closed 2 months ago

tpasternak commented 2 months ago

Checklist

Please note that the maintainers will not be reviewing this change until all checkboxes are ticked. See the Contributions section in the README for more details.

Discussion thread for this change

Issue number: <please reference the issue number or url here>

Description of this change

https://github.com/bazelbuild/intellij/assets/1066003/29720ae3-bc31-4b05-b9d6-da26d2e9b760

tpasternak commented 2 months ago

Oh, I can't just test it properly with the current test framework, because it converts TestFileSystem's files to NIO files via paths without hestitation, so as a result the tests would crash because it's impossible to call listFiles on it. I removed the comment (as it's already commented in string) and I'll try to think about fixing the test framework later

https://github.com/bazelbuild/intellij/blob/master/base/tests/utils/integration/com/google/idea/blaze/base/BlazeIntegrationTestCase.java#L110

blorente commented 2 months ago

That's fair, it's fine to leave the proper tests as a follow up. Do you think it would be hard to add a test that asserts that the section parses correctly? So a test that takes the string:

view_project_root: true

And asserts that the right Section is created.

tpasternak commented 2 months ago

Ok, that's easy, could you take a look again?

blorente commented 2 months ago

Yeah, looks good to me! Thanks for this change.