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

Intellisense on split panes returns information about the currently active project, not the currently moused-over pane. #3452

Closed
JarrettR opened this issue Apr 11, 2019 · 2 comments
Labels
bug Feature: Multi-root fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix
Milestone

Comments

@JarrettR
Copy link

Type: LanguageService

Describe the bug

  • OS and Version: Windows 10
  • VS Code Version: 1.33.0
  • C/C++ Extension Version: 0.22.1
  • A clear and concise description of what the bug is:

Intellisense on split panes returns information about the currently active project, not the currently moused-over pane.

To Reproduce

  1. Set up a c++ project, copy the entire folder and name the two project_left and project_right
  2. Open a new, empty workspace in VSCode
  3. Add both folders to the workspace
  4. Open up main.cpp for both projects in the left and right panes respectively, using the Open to the side or split right or whatever your preferred method is.
  5. In another file (eg. main.h), #define VAR 1 in the left project, and #define VAR 2 on the right.
  6. Use it in main() / compile, etc. Anything to get Intellisense to start reading the define. Might need to close and open VSCode.
  7. While the left pane is active, mousing over the VAR define will display "1" on both sides.
  8. When the right pane is active (ie. click somewhere in the right pane's code window), VAR will display "2" on both sides

Expected behavior

The mouseover info for VAR should always display "1" on the left, and "2" on the right

Screenshots

#defines in the .h file of left and right projects:

image

Test function of left and right projects:
image

Left pane is active, mouseover of left #define (This is proper and expected:
image

Left pane active, mouseover on right (This is wrong):

image

For completion, right pane is active, and mouseover on right is correct:

image

And left is incorrect:

image

Additional context

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Apr 12, 2019

We have a fix at #3455, but it requires that the workspace client of the hovered file be activated first, i.e. any file in the target workspace needs to be opened or given focus in the current session (the fact that all the clients don't activate on startup or on hover is a different issue, somewhat "by design").

FYI, your repro requires a #include <> and doesn't repro with a #include "", because it was using the includePath for the active file (and the "" version pulls in the current file's include path).

@sean-mcmanus sean-mcmanus added bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service Feature: Multi-root quick fix labels Apr 12, 2019
@sean-mcmanus sean-mcmanus added this to the April 2019 milestone Apr 12, 2019
@sean-mcmanus
Copy link
Contributor

Fixed with 0.23.0-insiders.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Feature: Multi-root fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix
Projects
None yet
Development

No branches or pull requests

2 participants