akamud / vscode-theme-onedark

VSCode Theme based on Atom's One Dark theme
MIT License
283 stars 198 forks source link

VS Code January 2024 (1.86.1) update breaks coloring in Go #165

Open brituck opened 5 months ago

brituck commented 5 months ago

Please provide as much information as possible, usually I need these information to actually start working on an issue, so try to fill as much of these as possible

Sample code

package transport

import "net/http"

const (
    success         = "success"
    failure         = "failure"
    badRequest      = "bad_request"
    accessDenied    = "access_denied"
    unexpectedError = "unexpected_error"
)

var ipcStatusMapping = map[int]string{
    401: accessDenied,
    400: badRequest,
}

func StatusToIPCStatus(status int) string {
    if status == http.StatusServiceUnavailable {
        return StatusToIPCStatusDetail(http.StatusTooManyRequests)
    }
    return StatusToIPCStatusDetail(status)
}

func StatusToIPCStatusDetail(statusCode int) string {
    if ipcst, ok := ipcStatusMapping[statusCode]; ok {
        return ipcst
    }

    switch statusCode / 100 {
    case 2, 3:
        return success
    case 4:
        return badRequest
    default:
        return unexpectedError
    }
}

Filename and Language selected

.go and Golang

VSCode 1.85.2

Screenshot 2024-02-08 at 10 29 35 PM

VSCode 1.86.1

Screenshot 2024-02-08 at 10 30 46 PM

Versions used

Extra information

settings.json

"gopls": {

        "ui.semanticTokens": true 
    },
jandono commented 4 months ago

Came here wanting to create the exact same issue :)

zhb127 commented 2 months ago

VSCode change Go syntax highlighting grammar: https://github.com/microsoft/vscode-docs/pull/7012/files

issues:

solution:

There seems to be no better way...😔