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 Module Documentation Available #1281

Merged
merged 26 commits into from
Sep 16, 2022
Merged

Make Module Documentation Available #1281

merged 26 commits into from
Sep 16, 2022

Conversation

leeyi45
Copy link
Contributor

@leeyi45 leeyi45 commented Aug 6, 2022

With reference to this PR, there are two changes to js-slang:

  • Added a new loadModuleDocs function. Currently, unlike the other load functions, this function returns null and logs to the console if there are errors loading the documentation instead of throwing that error. This is to prevent a request being made to the modules server every time the user presses a key in the editor, resulting in significant lag.

  • Raw tab files are no longer processed by js-slang. Instead, they are evaluated directly and passed to the frontend. The corresponding tests have been modified.

  • Also made the documentation for some of the name parsing code a bit clearer.

Change how tabs are loaded to allow the passing of the ReactDOM to tabs
Updating tests to fit the tab file syntax
Fixed lodash memoization
eslint formatting
js-slang can now load documentation for modules to display them in the prompts used by the ace editor
Ran eslint
Added support for module variables' documentation
Ran eslint
The generated documentation will now more closely follow the format as given by the builtins
Ran eslint
Built documentations are now formatted appropriately and do not need to be parsed by js-slang
Added failure message for when documentation fails to load
Makes no sense for tabs to be edited every time they are loaded.
If there are errors while loading documentation, the user won't constantly get lagged out by js-slang trying to reach the module server again and again
@coveralls
Copy link

coveralls commented Aug 6, 2022

Pull Request Test Coverage Report for Build 3068335363

  • 1 of 2 (50.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 84.871%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/name-extractor/index.ts 0 1 0.0%
Totals Coverage Status
Change from base Build 3067695829: 0.01%
Covered Lines: 8074
Relevant Lines: 9256

💛 - Coveralls

@lgtm-com
Copy link

lgtm-com bot commented Sep 16, 2022

This pull request introduces 1 alert when merging 3e7c274 into ed3b88d - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

If you try using namespace imports with fullJS it won't lag your editor with errors anymore
Copy link
Member

@martin-henz martin-henz left a comment

Choose a reason for hiding this comment

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

OK

@martin-henz martin-henz merged commit 6f59ffd into master Sep 16, 2022
@RichDom2185 RichDom2185 deleted the enhance_documentation branch March 26, 2024 15:18
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.

3 participants