Syntax Highlighting?
When I want to use "tokenColorCustomizations" to define a color for swift, I found the syntax is not supported very well.
E.g.
The class property name and property type be recognoized the same type token?
Property name:
Property type:
the type and the name are both meta.definition.type.body.swift and meta.definition.type.class.swift
There is some other not supported too, as the function param and function call param, and so on.
Can we supported for syntax highlighting for swift?
I tried to reproduce but the only case where CBUUID isn't highlighted is when the type cannot be found. Defining struct CBUUID {} highlights it as expected. Are you able to right click on CBUUID and select Go To Definition?
I tried to reproduce but the only case where CBUUID isn't highlighted is when the type cannot be found. Defining
struct CBUUID {}highlights it as expected. Are you able to right click on CBUUID and select Go To Definition?![]()
Yes it can "Go To Definition", the CBUUID is system library class from CoreBluetooth. @plemarquand
Even the NSNumber is the same effect:
Could you provide some diagnostics information by:
- Closing all files except except one that isn't syntax highlighting correctly
- Close VS Code
- Reopen VS Code
- Run the
> Swift: Capture VS Code Diagnostic Bundlecommand, choosing Full Diagnostics - Zip and attach the resulting files to this GitHub issue.
Could you provide some diagnostics information by:
- Closing all files except except one that isn't syntax highlighting correctly
- Close VS Code
- Reopen VS Code
- Run the
> Swift: Capture VS Code Diagnostic Bundlecommand, choosing Full Diagnostics- Zip and attach the resulting files to this GitHub issue.
@plemarquand diagnoistics.zip
Nothing is jumping out at me in the diagnostics, however the relevant responses from the LSP are redacted to protect privacy. If you're comfortable having source code and file paths included in the diagnostics you can enable extended logging in sourcekit-lsp and run another diagnose.
Regardless, since the VS Code extension has its syntax highlighting provided by sourcekit-lsp I'm going to transfer this issue to that repo.
Looks like we might not have build settings for a file, the logs show Producing syntactic diagnostics from the built-in swift-syntax because we have fallback build settings. If you could enable extended logging, open the file, do a jump-to-definition on CBUUID and then capture another diagnose, that should help us figure out what’s going wrong.
Synced to Apple’s issue tracker as rdar://142560819
Looks like we might not have build settings for a file, the logs show
Producing syntactic diagnostics from the built-in swift-syntax because we have fallback build settings. If you could enable extended logging, open the file, do a jump-to-definition onCBUUIDand then capture another diagnose, that should help us figure out what’s going wrong.
not only the built-in class or struct like CBUUID, but also my custom class is not work nether.
If you could enable extended logging, open the file, do a jump-to-definition on CBUUID and then capture another diagnose, that should help us figure out what’s going wrong.
If you could do those steps, that would really help us determine what’s going wrong.
Not fully sure how the scopes work, but I noticed that it depends on the theme I have selected for what scopes show up in this debug menu.
Here is Dark+ for a variable and its type
@Napoleon-Jm Can you let me know what theme you are using?
Here is the same variable and type for Xcode dark theme (from the marketplace)
Closing because this is likely a project configuration issue (based on the fact that we see Producing syntactic diagnostics from the built-in swift-syntax because we have fallback build settings in the log) and it’s not actionable to investigate what’s going wrong here without extended logging.