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

Use proper syntax to open file at line for Visual Studio Code, Intellij and Eclipse #22575

Merged
merged 5 commits into from
Jan 19, 2022

Conversation

gsmet
Copy link
Member

@gsmet gsmet commented Jan 2, 2022

Fixes #22574

@maxandersen can you try with this patch?

@gsmet gsmet requested a review from maxandersen January 2, 2022 11:33
@quarkus-bot quarkus-bot bot added the area/core label Jan 2, 2022
@gsmet
Copy link
Member Author

gsmet commented Jan 5, 2022

@maxandersen I don't really know how to reproduce this in VSCode as I never used this feature so I let you check it's working.

@maxandersen
Copy link
Member

vscode works now.
intellij does not. It launches but opens up "main.java:18" so its not the right syntax somehow.
eclipse does not seem work - nothing happens. no error/warn etc. shown even with trace enabled so not sure what happens.

Also once got this weird (probably unrelated to this PR) error if eclipse is running while I start (just setting quarkus.ide.target=eclipse don't trigger it):

java.lang.NullPointerException: Cannot invoke "io.quarkus.deployment.ide.EffectiveIdeBuildItem.getIde()" because "this.val$ideSupport" is null
	at io.quarkus.deployment.console.ConsoleProcessor$4.run(ConsoleProcessor.java:137)
	at io.quarkus.deployment.console.ConsoleStateManager$1.accept(ConsoleStateManager.java:73)
	at io.quarkus.deployment.console.ConsoleStateManager$1.accept(ConsoleStateManager.java:46)
	at io.quarkus.deployment.console.AeshConsole.lambda$setup$1(AeshConsole.java:247)
	at org.aesh.terminal.EventDecoder.accept(EventDecoder.java:118)
	at org.aesh.terminal.EventDecoder.accept(EventDecoder.java:31)
	at org.aesh.terminal.io.Decoder.write(Decoder.java:133)
	at org.aesh.readline.tty.terminal.TerminalConnection.openBlocking(TerminalConnection.java:216)
	at org.aesh.readline.tty.terminal.TerminalConnection.openBlocking(TerminalConnection.java:203)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

will do same with 2.6.2 to see if these are regressions or old issues.

@maxandersen
Copy link
Member

2.6.2 have the same issue with respect to having eclipse running - opened #23002

in 2.6.2 intellij does not even open so albeit this PR is "better" as vscode at least works but something still quirky.

@gsmet
Copy link
Member Author

gsmet commented Jan 19, 2022

OK, looks like this thing was never tested.

The syntax for Intellij is also completely different: https://www.jetbrains.com/help/idea/opening-files-from-command-line.html. I will fix that.

@quarkus-bot
Copy link

quarkus-bot bot commented Jan 19, 2022

This workflow status is outdated as a new workflow run has been triggered.

🚫 This workflow run has been cancelled.

Failing Jobs - Building 4902dba

Status Name Step Failures Logs Raw logs
Initial JDK 11 Build ⚠️ Check → Logs Raw logs
Attach pull request number ⚠️ Check → Logs Raw logs
CI Sanity Check ⚠️ Check → Logs Raw logs

@gsmet
Copy link
Member Author

gsmet commented Jan 19, 2022

I added fixes for Eclipse and Intellij. It doesn't fix any infra issue you might have had but at least the options should be OK now.

I couldn't figure out how to make things work with Netbeans though.

@gsmet gsmet changed the title Use proper syntax to open file at line for Visual Studio Code Use proper syntax to open file at line for Visual Studio Code, Intellij and Eclipse Jan 19, 2022
@geoand
Copy link
Contributor

geoand commented Jan 19, 2022

OK, looks like this thing was never tested.

it definitely was when I developed it as I use IntelliJ exclusively :)

@maxandersen
Copy link
Member

Yeah it was tested back then - looking a bit deeper what I'm finding is that I believe idea changed their command line so idea --help does not work anymore so detection fails/gets weird.

For eclipse its an OSX thing that fails because the command line to open eclipse on OSX is different ...for stupid eclipse reasons.

so i'll say its better with this PR in; but still some ghosts left to fix.

@gsmet
Copy link
Member Author

gsmet commented Jan 19, 2022

Well, the go to line feature was never tested. Because the file:line number syntax is working for Vim but that's pretty much it :).

@geoand
Copy link
Contributor

geoand commented Jan 19, 2022

Well, the go to line feature was never tested. Because the file:line number syntax is working for Vim but that's pretty much it :).

What makes you think that?
As I said, when I first developed this stuff, it was tested multiple times on IntelliJ and it always moved to proper line.

I actually do recall that my initial code did not attempt to move to a line. So indeed, I can confirm that I personally have never tested the go to line syntax

@gsmet
Copy link
Member Author

gsmet commented Jan 19, 2022

I added a commit to just open the file and not use the file:line syntax if no proper options have been provided for the IDE.

AFAICS, the file:line syntax doesn't work for any of them so the chances it will work magically for other IDEs are very thin.

Looks like all the IDEs have different syntaxes for opening a file to a
given line so let's not suppose it will just be file:line as it works
for none of them so chances it will work for a random one are quite
thin.
@quarkus-bot
Copy link

quarkus-bot bot commented Jan 19, 2022

Failing Jobs - Building 9a29739

Status Name Step Failures Logs Raw logs
Gradle Tests - JDK 11 Windows Build Failures Logs Raw logs

Full information is available in the Build summary check run.

Failures

⚙️ Gradle Tests - JDK 11 Windows #

- Failing: integration-tests/gradle 

📦 integration-tests/gradle

io.quarkus.gradle.devmode.MultiModuleKotlinProjectDevModeTest.main line 22 - More details - Source on GitHub

org.awaitility.core.ConditionTimeoutException: Condition with lambda expression in io.quarkus.test.devmode.util.DevModeTestUtils that uses java.util.function.Supplier, java.util.function.Supplierjava.util.concurrent.atomic.AtomicReference was not fulfilled within 3 minutes.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:164)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:78)

@gsmet gsmet merged commit 05dcb66 into quarkusio:main Jan 19, 2022
@quarkus-bot quarkus-bot bot added this to the 2.8 - main milestone Jan 19, 2022
@gsmet
Copy link
Member Author

gsmet commented Jan 19, 2022

Merging this one. Even if it doesn't fix everything, it's a step in the right direction.

@geoand
Copy link
Contributor

geoand commented Jan 19, 2022

Absolutely

@gsmet gsmet modified the milestones: 2.8 - main, 2.7.0.Final Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

x - open last stacktrace not working with vscode/codium
3 participants