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

RFC: do not use _serverProcess in leanclient. #487

Open
joneugster opened this issue Jun 26, 2024 · 1 comment
Open

RFC: do not use _serverProcess in leanclient. #487

joneugster opened this issue Jun 26, 2024 · 1 comment

Comments

@joneugster
Copy link
Contributor

Consider the following lines of code:

https://github.com/leanprover/vscode-lean4/blob/cee53169b58d31a03a60c4769ee827a3cabffd7c/vscode-lean4/src/leanclient.ts#L264C1-L274C11

;(this.client as any)._serverProcess.stderr.on('data', async (chunk: Buffer) => {
  ...
})

When adapting the extension to monaco, we are replacing vscode's LanguageClient (link to source) with the MonacoLanguageClient (link to source) which does not have _serverProcess, so we basically delete the marked code snippet.

As (this.client as any)._serverProcess seems like quite a hack already (i.e. _serverProcess is marked private), I thought I'd mark this here. Maybe there is a better way to do this that would work in both cases?

@abentkamp
Copy link
Contributor

I don't think this is easy to change since the Lean server would need to be modified for this, too.

How about just adding a few question marks?

;(this.client as any)._serverProcess?.stderr?.on('data', async (chunk: Buffer) => {
  ...
})

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

No branches or pull requests

2 participants