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

gopls/internal/lsp/source: show both the original declaration and the value of constants in hover #432

Closed

Commits on Mar 30, 2023

  1. gopls/internal/lsp/source: show both the original declaration and the…

    … value of constants in hover
    
    This change improves the hover information for constants by showing both
    the original declaration and the value. The value is displayed as
    an inline comment. If the original declaration and the value are the same,
    there will be no inline comment.
    
    Examples:
    
    ```go
    const duration time.Duration = 15*time.Minute + 10*time.Second // 15m10s
    
    const octal untyped int = 0o777 // 511
    
    const expr untyped int = 2 << (0b111&0b101 - 2) // 16
    
    const boolean untyped bool = (55 - 3) == (26 * 2) // true
    
    const dec untyped int = 500
    ```
    
    Other changes:
    
    * Calls to `objectString` that format methods or variables have been
      replaced with `types.ObjectString`.
    * The logic of inferred signature formatting has been extracted from
      `objectString` to a new function `inferredSignatureString`.
    * Remove unused function `extractFieldList`.
    
    Fixes golang/go#47453
    ShoshinNikita committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    a7fbd1e View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2023

  1. fixes after code review

    ShoshinNikita committed Mar 31, 2023
    Configuration menu
    Copy the full SHA
    8cc75a7 View commit details
    Browse the repository at this point in the history