-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
How to configure default/additional code? #155
Comments
@dhruvppatel Language servers are initialized with a |
Yes in a way @rcjsuen. I have a code which I want Language server to include before it loads code from current editor instance. |
@dhruvppatel So it sounds like you need to investigate how the Python language server determines what's on its path and then see how you can structure your students' files on the server so that the language server is able to read those. |
@rcjsuen Python Language Server does not contain code as a file on that server. Learner code stays in the database and we load the piece of code in the browser and initiate Monaco editor. We have done POC using Monaco Language Client(by TypeFox) and it's working fine for the editor instance. We would like to use Monaco Language Client to send extra code at the time of initialization which is not present in the current editor instance but should be considered for Language Server Features. Example: Let's say we need to teach python dict data structure and assignment is divided into two tasks. Task1 Instruction: Sample Learner code for Task1:
Task2 Instruction: Sample Learner code for Task2:
We initialize Monaco editor with the code of the current task in the browser. So while the learner is attempting Task2 editor is initially empty(learner can see the code of previous tasks separately which are not editable from current task screen). We would like to enable language server functionality for Task2 which should also include a code of Task1 for providing autocomplete. Is there any provision where I can pass the code of Task1 as initial code(which is not in the current editor) to Monaco Language Client which then communicate to language server and also consider that code for functionalities like autocomplete. Leaner should see methods of dict when they type |
@dhruvppatel I don't think you have much of a choice here. It sounds like you should refer to microsoft/monaco-editor#45 if you want to hide pieces of your code. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Big Thanks to TypeFox, Palantir and Microsoft team for building an ecosystem around Language Server Protocol for Monaco Editor.
We are building a cloud-based interactive learning platform primarily focused on Data Science Technologies. We are using Monaco Editor in our web application for online coding environment.
Currently, we are trying to integrate autocomplete capabilities in Monaco Editor with remote Python Language Server. With the help of opensource projects
monaco-languageclient
andpython-language-server
we were able to achieve the same.Our application is designed for incremental learning through tasks. Learners attempt each task at a time by writing code in a Monaco Editor.
So while the learner is attempting Task2 we would like to support autocomplete for the modules and variables declared in Task1. Code of the previous tasks are not included in the editor of the current task and we have a separate provision to view the code of previous tasks for reference.
Task2 editor doesn't contain code of Task1.
Is there any way to handle such a scenario by providing additional/default code while initializing language client?
We are looking for a solution where we can configure default code which is not visible in editor but should be considered for autocomplete and other features.
Do let us know your thoughts and possibilities to achieve the same.
The text was updated successfully, but these errors were encountered: