-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
feat: add LanguageServerRunConfig and groovy example #591
feat: add LanguageServerRunConfig and groovy example #591
Conversation
@adrian2024lsp thank you very much for your contribution. Generalizing the server running is a nice enhancement. I will test this and review the code likely tomorrow. We could also expose the |
i just fixed the CI build https://github.com/adrian2024lsp/monaco-languageclient/actions/runs/7546931119 typically , a package named like "xxx-examples" as a dependencies in others' package.json is not common. for example, you would not publish the https://github.com/TypeFox/monaco-languageclient-ng-example as a package to be included in others' dependencies . instead, we should extract the common reusable into a lib package and publish it to be reused. in a typically mono repo like https://nx.dev/, app depends on lib. Normally, we run an app , while we publish an lib to be included as dependencies to be reusable by other, not the other way around. imo, with that said, if it is too hassle to rename the package name, maybe just leave it for now and just do it as sub-export as you said . thanks, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some minor change requests.
Overall, I really like what you contributed. Thank you.
I agree. So far, the shared code was only used in other examples in https://github.com/TypeFox/monaco-languageclient-ng-example and https://github.com/TypeFox/monaco-components It may make sense to move these things into the client lib itself (as sub-exports). Could a good move as I am thinking about reducing overall maintenance effort. WDYT? |
Whatever I suggested above is after is this PR is in. Otherwise it will get to big. I am planning to update to a new |
@kaisalmen , thanks for the comments. i just pushed a few commits. Please review. in terms of reducing overall maintenance effort, I reckon nx is the way to go in long term. currently i find it is hard to modify something across multiple packages. For example, if I need to make some change in both Nx can help us solve this kind of issue regardless small or big project. Because we have project structure conceptually like this :
(assuming only libs are publishable ) if we manage to make it to a nx monorepo, we do not need to manage lots of new package versions releases for changes to be available in other packages. besides, it is easier to manage the dependency chain as well, for example we have dependency chain like this : when we make changes across different level of the chain, then we trigger the CI build, we immediately find out which code are incompatible. thus it helps us to achieve a fail fast CI . For example , those two interfaces ( https://github.com/CodinGame/languageserver-mutualized/blob/main/example/src/json-server-launcher.ts#L20 with that said , we can adapt it gradually, progressively, incrementally in an non-invasive thanks, |
No, just let
Sorry, I need to investigate. One important thing Please, do not merge Sorry, I made those copyright changes yesterday. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the model sub-folder as the separation is artificial. I am anyway thinking about moving the code out of the example to the client anyway. Let's keep it together.
Otherwise this is ready to be merged. Thanks.
@kaisalmen , ok , just one more thing to confirm before i make change to the /model.
if we put the interface into a separate files, then we can avoid the implementation files depending on each other thus avoid potential circular dependency in the repo. Another benefit is that we can publish those interface into its own package like vsc for other future reuse purposes. WDYT? in terms of the npm workspace, btw, where is the Github repo for https://www.npmjs.com/package/@codingame/monaco-editor-treemended ? thanks, |
8a97dcd
to
8e7ee39
Compare
Thanks, I overlook that in the review. See my suggestion in the respective review comments.
In a npm workspace you perform
https://github.com/CodinGame/monaco-vscode-api it releases 100+ npm packages. 🙂 |
@kaisalmen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your contribution! 🎉 We will make up our minds on how to restructure the common code. Once a proposal/PR is ready, I will ask you for your opinion/review.
@kaisalmen , great to see we want to restructure the common code. #543 (comment) you mentioned "Even with a shared org there will be interdependent npm packages." for example, https://github.com/ls-infra/react-lsp-runner -> https://github.com/ls-infra/monaco-vscode-api then later we notice some code depends on each other: https://github.com/ls-infra/react-lsp-runner -> https://github.com/ls-infra/common-lsp-runner -> https://github.com/ls-infra/monaco-vscode-api or directly sink the code into https://github.com/ls-infra/monaco-vscode-api depending on the context. (assuming https://github.com/ls-infra/monaco-vscode-api is our lowest level. and all the repos in TypeFox and CodinGame will depend on the repos in https://github.com/ls-infra. And whenever they have an interdependent npm packages, we can sink that to the lower level of the dependencies chain. with that said, if we can achieve similar goal without needing to introduce a new org, that is great as well. Moreover, we can leverage the maybe in your RFC PR , you can layout what will be the dependency chain for the overall project folder structure in a file like thx, |
@ls-infra I don't see the need to fundamentally restructure any repository and I am pretty certain that @CGNonofr does not see that need either. I don't see any circular dependency problem with the packages. This is a closed PR. Please create a new issues or discussion and explain the your problem. From what you wrote above it is still unclear what the actual problem is. |
@kaisalmen ok, that is fine , it is not necessary a problem or issue , just some thoughts on trying to avoid potentially circular dependency in the long term. And i just sometimes find it a bit hard to follow when i need to debug something to trace down the dependency chain due to we split the packages across different orgs and different repos. (and sometimes packages name does not match the repo name). since you mentioned you will open a proposal/PR , so maybe let us discuss the thanks, |
@ls-infra Fair point. Here a proper diagram / more useful documentation could be helpful. |
Enhancement
runLanguageServer( )
)runLanguageClient( )
)Use case
some language servers dose not use node cli to run the process https://github.com/TypeFox/monaco-languageclient/blob/main/packages/examples/src/common/server-commons.ts#L24
for example , a groovy language server is likely to be run by java cli cmd.
(see the packages/examples/src/groovy for more details)
Usage
import { runLanguageServer } from 'monaco-languageclient-examples/node';
(it may be better if we can make a new package called
packages/language-server-runner
and move those common code into it. Then thepackages/examples
will callpackages/language-server-runner
. And we publish thepackages/language-server-runner
as a reusable package instead of thepackages/examples
. )thank you very much,
A