Replies: 2 comments 4 replies
-
Since there is no real context, I will assume you run your pyright language server on a server and connect to it via WebSocket The pyrightconfig.json should probably be at the root directory of your project, on the server |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply. I am trying to build an online editor. Yes, my pyright language server is on the server and connected to it via WebSocket. I referred to the example of monaco-languageclient and successfully built the project. It is a great project and saved me a lot of time. I am a python newbie and don't know much about python, pyright or even lsp. But I want to achieve the following effect⬇️.... This editor can provide type hints but does not require explicit import of types. Like this 😂 Through the documentation of chatgpt and pright, I learned that Finally, I used a strange way to achieve this effect <MonacoEditorReactComp
// ...
onLoad={(wrapper) => {
setTimeout(() => {
wrapper.editorApp.editor.setValue(`${builtins}\n${code}`);
const hiddenRange = new monaco.Range(1, 1, 18, 1);
wrapper.editorApp.editor.setHiddenAreas([hiddenRange])
}, 0)
}}
/> Specifically, I hid the context. . Because the editor has a complete context, it can prompt for input normally. . But I don't want to show this bunch of contextual tips to the user, so I hid the code, but hiding the code will cause some problems with the line number .. so I hid the line number in the UI 🤭 .... To sum up. . I want to implement such an editor, but I don't have any ideas. . . Thank you again for reading such a long question 🙏 Can anyone tell me the correct way to do it? ... 🙏 🙏 🙏 |
Beta Was this translation helpful? Give feedback.
-
I've been researching for a long time but haven't found a solution. I’ve tried placing the file in many different locations, but it still doesn’t work ... 😭
Beta Was this translation helpful? Give feedback.
All reactions