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

Semantic highlighting isn't working with CreateWindow macros #11416

Closed
sean-mcmanus opened this issue Sep 8, 2023 · 5 comments
Closed

Semantic highlighting isn't working with CreateWindow macros #11416

sean-mcmanus opened this issue Sep 8, 2023 · 5 comments
Labels
bug Feature: Colorization fixed Check the Milestone for the release in which the fix is or will be available. Language Service Visual Studio Inherited from Visual Studio
Projects
Milestone

Comments

@sean-mcmanus
Copy link
Collaborator

          I also have a macro-related issue; not sure if this is intended.

When using macros defined in other files, sometimes the tokens/scopes are incorrect for macros inside the macro call.

For example:
image
CW_USEDEFAULT is a windows macro but for some reason it is white instead of blue since it doesn't have entity.name.function.preprocessor.cpp as the foreground.

However, when I define my own macros, the macros are now blue which seems to be correct:
image

So this highlighting is inconsistent.

Originally posted by @billgan1024 in #11248 (comment)

@sean-mcmanus
Copy link
Collaborator Author

You appear to not be getting semantic highlighting for those macros in the CreateWindow call. Is IntelliSense working at that point or has it crashed? Do you see a "semantic token type" when viewing the token/scopes for the CreateWindow call?

Are you able to provide a simple repro? We could also try to see if can repro it ourselves based on the screenshot info...

@sean-mcmanus sean-mcmanus added bug Language Service investigate: repro This issue's repro steps needs to be investigated/confirmed Feature: Colorization labels Sep 8, 2023
@billgan1024
Copy link

billgan1024 commented Sep 18, 2023

Intellisense still seems to be working because I reloaded it:
image

but there's still no semantic highlighting.

Here is a simple repro:

#include <windows.h>
#define TITLE L"Test"
int WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
    HWND window = CreateWindow(
        TITLE,
        TITLE, WS_OVERLAPPEDWINDOW | WS_VISIBLE,
        CW_USEDEFAULT,
        CW_USEDEFAULT,
        800,
        600,
        0,
        0,
        0,
        0);
    
    #define num 3
    #define x(y) num+y
    x(num);
}

@billgan1024
Copy link

billgan1024 commented Jan 31, 2024

@sean-mcmanus any update on this? btw I've seen the exact same issue with Visual Studio, and it was fixed
very recently.

@bobbrow
Copy link
Member

bobbrow commented Jan 31, 2024

@billgan1024 we share this code with Visual Studio, so that fix should flow into our extension the next time we take a merge. It won't be in 1.19 though because we're stabilizing for release. I expect it will be in 1.20.0. We could do a pre-release not long after 1.19 releases to stable.

@Colengms Colengms added Visual Studio Inherited from Visual Studio and removed investigate: repro This issue's repro steps needs to be investigated/confirmed labels Feb 9, 2024
@Colengms Colengms added this to the Tracking milestone Feb 9, 2024
@Colengms Colengms added this to Triage in 1.20 via automation Feb 9, 2024
@bobbrow bobbrow moved this from Triage to To do in 1.20 Feb 13, 2024
@sean-mcmanus sean-mcmanus modified the milestones: Tracking, 1.20.0 Apr 30, 2024
@sean-mcmanus sean-mcmanus moved this from To do to Done in 1.20 Apr 30, 2024
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Apr 30, 2024
@sean-mcmanus
Copy link
Collaborator Author

@billgan1024 This is fixed in our 1.20.x pre-release channel.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Feature: Colorization fixed Check the Milestone for the release in which the fix is or will be available. Language Service Visual Studio Inherited from Visual Studio
Projects
No open projects
1.20
Done
Development

No branches or pull requests

4 participants