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

Wierd output of helptext command #35

Closed
Krzysztof-Cieslak opened this issue Jun 30, 2015 · 6 comments
Closed

Wierd output of helptext command #35

Krzysztof-Cieslak opened this issue Jun 30, 2015 · 6 comments

Comments

@Krzysztof-Cieslak
Copy link
Member

Right now helptext command returns (example from tests) something like:

{
  "Kind": "helptext",
  "Data": {
    "funky": "val funky : x:int -> int"
  }
}

I'm not sure if format of returned JSON is right - I would suggest something like

{
  "Kind": "helptext",
  "Data": {
    "Name": "funky"
    "Text": "val funky : x:int -> int"
  }
}

I think such solution would be more consistent with results of others commands and would make it easier to parse result back in clients ( at least from F# in Atom point of view, no idea about rest editors and how "breaking" is that change).

@7sharp9
Copy link
Contributor

7sharp9 commented Jun 30, 2015

Possibly the right solution would be to start using the symbol API which can then supply the independent parts of the help text and indeed other API calls that use tips etc. I think there reason for this format is the textual output from the DataTipText parts of FSC which is just simple strings.

@Krzysztof-Cieslak
Copy link
Member Author

I don't think I'm competent enough to give any opinions on which FSC API should be used. What bothers me right now is just serialization format which is inconsistent with other responses

@rneatherway
Copy link
Contributor

Dave is correct, this is an artifact of the preformatted tips. I'm
definitely open to using more of the FSharpSymbol API and returning more
strongly typed data rather than just a string.
On 30 Jun 2015 15:40, "Dave Thomas" notifications@github.com wrote:

Possibly the right solution would be to start using the symbol API which
can then supply the independent parts of the help text and indeed other API
calls that use tips etc. I think there reason for this format is the
textual output from the DataTipText parts of FSC which is just simple
strings.


Reply to this email directly or view it on GitHub
#35 (comment)
.

@rneatherway
Copy link
Contributor

At the moment, we just call this method to convert the FSharpToolTipElement to a string: https://github.com/fsharp/FsAutoComplete/blob/master/FSharp.AutoComplete/TipFormatter.fs#L52

@7sharp9: are you suggesting to just serialize the F# type, or use something different from FSharpSymbol? Could you show me the place in the XS addin where you use that?

@7sharp9
Copy link
Contributor

7sharp9 commented Jun 30, 2015

Im suggesting returning the name, signature and helptext which is either the textual form of xmldoc in the case of local xmldoc references or the sigId/file for non local refs. Im a bit busy finishing something off but If you leave it with me I can take a look later in the week.

@rneatherway
Copy link
Contributor

That would be great, thanks.

rneatherway added a commit to rneatherway/FsAutoComplete that referenced this issue Jul 27, 2015
* FSharp.CompilerBinding removed, and used parts absorbed. Fixes ionide#17.
* ScriptCheckerOptions fetched with no timeout, and also stores them.
  Fixes ionide#18, ionide#28.
* If a .fs file is not in a loaded project, produce an incomplete
  typecheck environment for it to give basic results.
* Update helptext command to return { Name = ""; Text = "" }. Fixes ionide#35.
* Update parsing of project options to include ProjectReferences. Fixes ionide#39.
* Separate parsing of commands, main command loop, and formatting of
  response message into separate modules.
rneatherway added a commit to rneatherway/FsAutoComplete that referenced this issue Jul 27, 2015
Backwards-incompatible changes:

* Update helptext command to return { Name = ""; Text = "" }. Fixes ionide#35.
* `project` command response now has 'null' for OutputFile and
  TargetFramework if a value cannot be determined.

Other changes:

* FSharp.CompilerBinding removed, and used parts absorbed. Fixes ionide#17.
* ScriptCheckerOptions fetched with no timeout, and also stores them.
  Fixes ionide#18, ionide#28.
* If a .fs file is not in a loaded project, produce an incomplete
  typecheck environment for it to give basic results.
* Update parsing of project options to include ProjectReferences. Fixes ionide#39.
* Separate parsing of commands, main command loop, and formatting of
  response message into separate modules.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants