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

Provide FSharpParameter with its correct list of FSharpAttributes #15925

Closed
baronfel opened this issue Sep 4, 2023 · 1 comment
Closed

Provide FSharpParameter with its correct list of FSharpAttributes #15925

baronfel opened this issue Sep 4, 2023 · 1 comment

Comments

@baronfel
Copy link
Member

baronfel commented Sep 4, 2023

Is your feature request related to a problem? Please describe.

I was implementing nested-language support in FSAC by checking if parameters of methods are decorated with System.Diagnostics.CodeAnalysis.StringSyntaxAttribute, and I was doing this by

  • getting the ident for the method being called
  • getting the symbol use for that ident
  • getting the member, function, or value for that symbol use
  • investigating the parameter list for that MFV
  • checking the attributes on the parameter in the correct position

However, FSharpParameter seems to always have an empty .Attributes member, as shown in

// INCOMPLETENESS: Attribs is empty here, so we can't look at attributes for
// either .NET or F# parameters
let argInfo: ArgReprInfo = { Name=nmOpt; Attribs=[]; OtherRange=None }
and a few lines below.

Describe the solution you'd like

I'd like .Attributes to have the list of attributes for that parameter, or have a method that could be called to lazily-calculate the list if that would increase memory usage too much.

Describe alternatives you've considered

Some horrific hacking to use reflection-only loads to try and load and investigate the matching parameter.

Additional context

Here's the tracking issue in Ionide for adding this nested-language feature: ionide/ionide-vscode-fsharp#1912

@github-actions github-actions bot added this to the Backlog milestone Sep 4, 2023
baronfel added a commit to baronfel/FsAutoComplete that referenced this issue Sep 4, 2023
this is blocked by dotnet/fsharp#15925 because FCS APIs don't provide us with attribute lists
@baronfel
Copy link
Member Author

baronfel commented Sep 6, 2023

Closing as duplicate of #13786

@baronfel baronfel closed this as not planned Won't fix, can't repro, duplicate, stale Sep 6, 2023
@github-project-automation github-project-automation bot moved this from Not Planned to Done in F# Compiler and Tooling Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

1 participant