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

Make autocompetion language agnostic #2539

Merged
merged 2 commits into from
Dec 11, 2019

Conversation

mdboom
Copy link
Contributor

@mdboom mdboom commented Dec 10, 2019

This is a follow on to #2535 that makes autocomplete work on any language with a language definition.

The primary change (beyond the obvious) is to send the entire code chunk up to the cursor across the wire to the eval frame and doing any language-specific parsing of it on that side. This is more language generic, since language plugins can't run code on the editor side.

To work with Python, will also require pyodide/pyodide#584 to be merged and released.

Pull Request checklist

  • Documentation: If this feature has or requires documentation, the relevant docs have been updated.
  • Changelog: This PR updates the changelog with any user-visible changes.
  • Tests: This PR includes thorough tests or an explanation of why it does not

@codecov
Copy link

codecov bot commented Dec 10, 2019

Codecov Report

Merging #2539 into autocomplete will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##           autocomplete    #2539   +/-   ##
=============================================
  Coverage         71.17%   71.17%           
=============================================
  Files               239      239           
  Lines              5859     5859           
  Branches            937      937           
=============================================
  Hits               4170     4170           
  Misses             1670     1670           
  Partials             19       19
Impacted Files Coverage Δ
src/editor/state-schemas/state-schema.js 87.5% <ø> (ø) ⬆️
src/editor/state-schemas/language-definitions.js 83.33% <ø> (ø) ⬆️
src/eval-frame/parse-js-completion-scope.js 100% <ø> (ø)

Copy link
Contributor

@bcolloran bcolloran left a comment

Choose a reason for hiding this comment

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

wow that was fast, i thought i'd handle the generalization once you took care of the pyodide side... this is great! :-D

expanded on the doc string a bit, other than that it all looks good!

docs/language_plugins.md Outdated Show resolved Hide resolved
@mdboom mdboom force-pushed the autocomplete branch 2 times, most recently from 6c41af4 to ffbe649 Compare December 10, 2019 19:37
Copy link
Contributor

@bcolloran bcolloran left a comment

Choose a reason for hiding this comment

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

spotted one more small thing

src/eval-frame/index.jsx Outdated Show resolved Hide resolved
@bcolloran
Copy link
Contributor

code looks good @mdboom, thanks! one last thought: add a note in the changelog?

have not tested this with pyodide of course, since that will depend on your deploy schedule, but merge this as soon as you wish! (and ping the channel when the relevant pyodide updates deploy! i'm excited about this one!)

@bcolloran bcolloran merged commit fe86731 into iodide-project:autocomplete Dec 11, 2019
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