Skip to content

[psc-ide] Unify Completion Commands#2305

Merged
paf31 merged 1 commit into
purescript:masterfrom
kritzcreek:psc-ide-ast-information-completion
Sep 13, 2016
Merged

[psc-ide] Unify Completion Commands#2305
paf31 merged 1 commit into
purescript:masterfrom
kritzcreek:psc-ide-ast-information-completion

Conversation

@kritzcreek

@kritzcreek kritzcreek commented Sep 11, 2016

Copy link
Copy Markdown
Member

Follow up on #2303 and #2302.

This PR merges the two different response types for the type and completion command. We now provide all the AST information for both of these.

The format for the returned completions has thus changed from:

{ "module" : "Text"
, "identifier" : "Text"
, "type" : "Text"
}

to:

{ "module" : "Text"
, "identifier" : "Text"
, "type" : "Text"
, "expandedType" : "Text"
, "definedAt" : "Maybe SourceSpan"
, "documentation" : "Maybe Text"
}

The type field now contains the annotated type, if we found it by parsing the sourcefiles. If we didn't find any annotation it still contains the type with fully expanded type synonyms. This should provide a better default for the editors and if they still want to show the expanded types that is now available via the expandedType field.

The documentation field is always Nothing for now, but I intend to fill out that information soon, so I thought I'll change the API just once instead of twice.

Because all the old fields remain we shouldn't break any editor plugins, give better type information for the end users and allow for more features on the editor side through the new fields.

TODO:

  • Document the new API
  • Write a few tests
  • Squash commits

@kritzcreek

Copy link
Copy Markdown
Member Author

Ready for review. Once it's good to go I'll squash things.

@kritzcreek kritzcreek changed the title [WIP][psc-ide] Unify Completion Commands [psc-ide] Unify Completion Commands Sep 12, 2016
@kritzcreek kritzcreek force-pushed the psc-ide-ast-information-completion branch from f5d3aa3 to ab745a0 Compare September 12, 2016 00:59
Comment thread psc-ide-server/PROTOCOL.md Outdated

The following format is returned as the Result:

Bpth the `definedAt` aswell as the `documentation` field might be `null` if they

@paf31 paf31 Sep 12, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo ("Bpth")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@paf31

paf31 commented Sep 12, 2016

Copy link
Copy Markdown
Contributor

Looks great!

* Unifies response formats for the type and complete commands so
  go-to-definition and type annotations now also show up in completions
@kritzcreek kritzcreek force-pushed the psc-ide-ast-information-completion branch from ab745a0 to 8dd3965 Compare September 12, 2016 06:26
@kritzcreek

Copy link
Copy Markdown
Member Author

Thanks! Squashed.

@paf31 paf31 merged commit c993ec2 into purescript:master Sep 13, 2016
@kritzcreek kritzcreek deleted the psc-ide-ast-information-completion branch September 13, 2016 18:21
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

Successfully merging this pull request may close these issues.

2 participants