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 token omitting record field in {-# LANGUAGE DuplicateRecordFields #-} #3950

Closed
soulomoon opened this issue Jan 13, 2024 · 1 comment · Fixed by #3951
Closed

Semantic token omitting record field in {-# LANGUAGE DuplicateRecordFields #-} #3950

soulomoon opened this issue Jan 13, 2024 · 1 comment · Fixed by #3951
Assignees
Labels
component: semantic-tokens type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@soulomoon
Copy link
Collaborator

soulomoon commented Jan 13, 2024

recordField name in instance decl sometimes considered as generated OccName by hieAst even if it is written out by user. Like in $sel:plcGlobalOn:PluginConfig. in hls code base:

instance Default PluginConfig where
  def = PluginConfig
      { plcGlobalOn         = True
      , plcCallHierarchyOn  = True
      , plcCodeActionsOn    = True
      , plcCodeLensOn       = True
      , plcDiagnosticsOn    = True
      , plcHoverOn          = True
      , plcSymbolsOn        = True
      , plcCompletionOn     = True
      , plcRenameOn         = True
      , plcSelectionRangeOn = True
      , plcFoldingRangeOn   = True
      , plcSemanticTokensOn = True
      , plcConfig           = mempty
      }

Stop omit generated OccName could fix this.

@soulomoon soulomoon added type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. component: semantic-tokens labels Jan 13, 2024
@soulomoon soulomoon self-assigned this Jan 13, 2024
soulomoon added a commit that referenced this issue Jan 13, 2024
@soulomoon
Copy link
Collaborator Author

soulomoon commented Jan 13, 2024

But I do not really understand the cause, could not repro in a single file. and hence could not write out test for it.


The cause is the {-# LANGUAGE DuplicateRecordFields #-}, it regenerate the recordfield

@soulomoon soulomoon changed the title Semantic token omitting record field in class instance. Semantic token omitting record field in {-# LANGUAGE DuplicateRecordFields #-} Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: semantic-tokens type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
1 participant