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

bug: [IntelliJ IDEA] "Open selection in sourcegraph web" opens the wrong file if the editor is split with multiple files open #3037

Open
samwill opened this issue Jan 28, 2025 · 1 comment
Labels
bug Something isn't working repo/jetbrains

Comments

@samwill
Copy link

samwill commented Jan 28, 2025

IDE Information

IntelliJ IDEA 2024.3.2.1 (Ultimate Edition)
Build #IU-243.23654.153, built on January 23, 2025
Licensed to Indeed

Runtime version: 21.0.5+8-b631.30 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.X11.XToolkit
Linux 6.8.0-51-generic
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 4096M
Cores: 20
Registry:
ide.experimental.ui=true
jvm.dfa.analysis.ui.security.analysis.window.was.shown=true
Non-Bundled Plugins:
org.intellij.plugins.hcl (243.23654.44)
org.jetbrains.settingsRepository (243.23654.19)
google-java-format (1.25.2.0)
Key Promoter X (2024.2.2)
net.sf.opk.avro-schema-support (232.0.2)
com.intellij.ml.llm (243.23654.267.7)
com.intellij.lang.jsgraphql (243.22562.13)
com.nbadal.ktlint (0.26.0)
org.sonarlint.idea (10.15.0.80347)
com.sourcegraph.jetbrains (7.11.2)
Kotlin: 243.23654.153-IJ
Current Desktop: ubuntu:GNOME

Bug Description

Sourcegraph plugin doesn't correctly detect which editor window/file is in focus when the editor is split with different files open in each window.

Reproduction:

  1. Open at least 2 files, FileA and FileB, within a single editor window
  2. Right-click on FileB's editor tab and choose "Split right" (FileB should be opened in both windows at this point)
  3. Close FileB on the left-hand window (FileA should still be open in the left pane, and FileB on the right)
  4. Focus on the FileA editor window, maybe even select some code, and then use the "Open Selection in Sourcegraph Web) option
  5. FileB will open in SG Web instead of FileA

The only workaround I've found to get out of this state is to split FileA into a new window, but then FileA will always be the file opened on SG Web even if I focus on FileB or any other file that is open in the editor.

Usually, if I just try to move FileA from the left window to the right window, and there are other files remaining in the left window, then the file in the left window will open in SG Web, but sometimes it will get into a state where only the files in the right window will open, no matter what I do.

Additional context

https://www.jetbrains.com/help/idea/using-code-editor.html#split_screen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working repo/jetbrains
Projects
None yet
Development

No branches or pull requests

1 participant