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

[IMP] Client side code cleaning and Python extension integration #85

Closed
wants to merge 7 commits into from

Conversation

delvsola
Copy link
Contributor

This PR aims to provide a first fix to many errors in the client code and acts as an intermediate patch until the client side is properly refactored.

The extension also now integrates VSCode's Python extension, which means the Language Server will now be launched with the Interpreter selected for that workspace.

Changes

  • VSCode Python extension integration
  • Removal of the Python Path field in the Configuration webview.
  • Better logging in the Odoo channel.

Fixes

  • The Language Client is now properly stored and referenced through a correctly defined global variable.
  • Server stops are now properly awaited, which should hopefully fix Odoo-ls not killed automatically when I kill VS Code #78 .
  • Configuration changes are now queued during server stops.
  • LanguageClient is not disposed between Configuration changes anymore, only between interpreter changes.

@delvsola delvsola added the enhancement New feature or request label Nov 22, 2023
@delvsola delvsola changed the title Client side overhaul [IMP] Client side code cleaning and Python extension integration Nov 22, 2023
@delvsola delvsola force-pushed the master-migrate-to-python-extension-loha branch from 6845182 to 960903f Compare November 22, 2023 13:55
@delvsola delvsola marked this pull request as draft November 22, 2023 15:59
@fda-odoo fda-odoo added this to the 0.2.3 milestone Nov 27, 2023
@Louciole Louciole force-pushed the master-migrate-to-python-extension-loha branch 2 times, most recently from 50ca72b to 67034fc Compare November 30, 2023 13:21
@Louciole Louciole force-pushed the master-migrate-to-python-extension-loha branch 2 times, most recently from 7eeb0a3 to f687c6d Compare December 18, 2023 14:38
@fda-odoo fda-odoo modified the milestones: 0.2.3, 0.2.4 Dec 19, 2023
@Louciole Louciole force-pushed the master-migrate-to-python-extension-loha branch from 842e676 to 2aa0c62 Compare January 4, 2024 09:34
}

//trying to use the VScode python extension
if (interpreter && global.IS_PYTHON_EXTENSION_READY !== false) {
config ? pythonPath = interpreter.path[0] : pythonPath = null;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pythonPath = config ? interpreter.path[0] : null

@delvsola
Copy link
Contributor Author

delvsola commented Jan 8, 2024

@Louciole The extension crashes when starting as Disabled with the Python extension enabled

@Louciole
Copy link
Member

@Louciole The extension crashes when starting as Disabled with the Python extension enabled

I can't reproduce it (either in the debug or packaged version) did you do something special?

@fda-odoo fda-odoo modified the milestones: 0.2.4, 0.2.5 Jan 10, 2024
Changes:
- Remove pythonPath field from Config view
- Integrate Python extension
- Properly use async/await in the code.
- Use of global.d.ts for Global variables.
- Wait for LanguageClient to stop before starting it again
- Queue Configuration change when LanguageClient is still stopping
- Properly hide Crash notification test command in Production
- outputChannel is now stored globally instead of being passed to all
functions
- Logging is now done through LanguageClient
- Add a Bash shebang to build_package.sh

Co-authored by Solan (sode)
… python extension

Changes:
- check if python extension is ready and save it in global
- display python path in config when relevant
- check and prepare the environment without python extension
The main goal of this commit is to be able not to set pythonPath when the extension is disabled
@Louciole Louciole force-pushed the master-migrate-to-python-extension-loha branch from 2aa0c62 to 9401ddd Compare January 16, 2024 13:59
/!\ there's probably still a bug on windows
if (_api) {
return _api;
}
_api = await PythonExtension.api();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we sure it will never become invalid?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only use this Promise right after getting it and getting it each time we need it to be as close to the current configuration as we can be so there's no reason for it to be invalid in the current setup (but maybe I didn't understand the comment)

@Louciole Louciole closed this Jun 20, 2024
@Louciole Louciole deleted the master-migrate-to-python-extension-loha branch June 20, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Odoo-ls not killed automatically when I kill VS Code
3 participants