Iteration 2: Getting all simple code listings working#898
Open
Joshua-Lester3 wants to merge 29 commits intoIntelliTect:mainfrom
Open
Iteration 2: Getting all simple code listings working#898Joshua-Lester3 wants to merge 29 commits intoIntelliTect:mainfrom
Joshua-Lester3 wants to merge 29 commits intoIntelliTect:mainfrom
Conversation
- Updated appsettings.json to include TryDotNet origin configuration. - Introduced code-runner.css for styling the interactive code execution panel. - Implemented trydotnet-module.js for managing TryDotNet functionality, including session management, code execution, and error handling. - Enhanced site.js to initialize TryDotNet functionality alongside chat widget.
Co-authored-by: Kevin B <Keboo@users.noreply.github.com>
…roved immutability and simplicity
…ssentialCSharp.Web into jlester/try-net
…ectoryInfo for improved type safety
…ace TestWebHostEnvironment with Moq for IWebHostEnvironment in WebApplicationFactory
…ApplicationFactory
…ssentialCSharp.Web into jlester/try-net
…ding improvements - Load runnable listings from chapter-listings.json and build a Set of valid listings. - Implement functions to check if a listing is runnable and to strip region directives from code. - Update createScaffolding to prepend common using directives and handle user code more effectively. - Modify isCompleteProgram to recognize any class with a static Main method as complete. - Inject Run buttons only for listings present in the curated JSON, improving user experience.
…or chapter listings - Modified the logic in loadRunnableListings to only include listings where both can_compile and can_run are true. - Updated comments to reflect the new requirements for fileObj properties.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the TryDotNet front-end integration to support running a broader set of code listings by (a) curating which listings get “Run” buttons and (b) adjusting how listing code is classified and prepared before execution.
Changes:
- Add support for loading a curated runnable-listings set from
chapter-listings.jsonand only injecting Run buttons for those listings. - Update “complete program” detection logic and change how listing code is pre-processed (region stripping / optional usings).
- Adjust TryDotNet session initialization parameters for the opened document.
Comments suppressed due to low confidence (1)
EssentialCSharp.Web/wwwroot/js/trydotnet-module.js:148
createScaffolding()no longer includes anyusingdirectives, and the current flow does not callprependUsings()for scaffolded code. This will cause scaffolded snippets that rely on SDK implicit/global usings (e.g.,Console,List<T>) to fail to compile under TryDotNet'sconsolepackage. Either put the required usings back into the scaffolding template or ensure the generatedfileContent(both complete and scaffolded) is passed throughprependUsings()when needed.
function createScaffolding(userCode) {
return `
namespace Program
{
class Program
{
static void Main(string[] args)
{
#region controller
${userCode}
#endregion
}
}
}`;
…/EssentialCSharp.Web into jlester/try-net-2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Describe your changes here.
Fixes #Issue_Number (if available)
Ensure that your pull request has followed all the steps below: