Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ENHANCEMENT] option to use the version of the language server installed in the current environment instead of the one bundled with the vscode extension #422

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

Open
DetachHead opened this issue Apr 3, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@DetachHead
Copy link
Contributor

Is your enhancement request related to a problem? Please describe.
i'm seeing these errors from the robotcode vscode extension:

foo.py(2, 1): Importing test library 'tests.sandpit.foo' failed: ImportError: cannot import name 'TypeForm' from 'typing_extensions' (c:\Users\user\.vscode\extensions\d-biehl.robotcode-1.0.3\bundled\libs\typing_extensions.py)
Traceback (most recent call last):
File "C:\Users\user\no_onedrive\project\tests\sandpit\__init__.py", line 1, in <module>
from tests.sandpit import foo
File "C:\Users\user\no_onedrive\project\tests\sandpit\foo.py", line 2, in <module>
from typing_extensions import TypeForm
PYTHONPATH:
c:\Users\user\.vscode\extensions\d-biehl.robotcode-1.0.3\bundled\libs
c:\Users\user\.vscode\extensions\d-biehl.robotcode-1.0.3\bundled\tool\robotcode
C:\Users\user\AppData\Roaming\uv\python\cpython-3.13.1-windows-x86_64-none\python313.zip
C:\Users\user\AppData\Roaming\uv\python\cpython-3.13.1-windows-x86_64-none\DLLs
C:\Users\user\AppData\Roaming\uv\python\cpython-3.13.1-windows-x86_64-none\Lib
C:\Users\user\AppData\Roaming\uv\python\cpython-3.13.1-windows-x86_64-none
c:\Users\user\no_onedrive\project\.venv
c:\Users\user\no_onedrive\project\.venv\Lib\site-packages
C:\Users\user\no_onedrive\project

this is because i have a keyword with a type annotation that uses the new TypeForm type, which was only recently added to typing_extensions in the latest release (4.13.0):

# ./tests/sandpit/foo.py
from robot.api.deco import keyword
from typing_extensions import TypeForm


@keyword
def foo(value: TypeForm[object]): ...
*** Settings ***
Library     tests.sandpit.foo    # Import definition contains errors. (ImportContainsErrors)


*** Test Cases ***
Asdf
    Foo    None

this error is a false positive though because my project has the latest version of typing_extensions in its dependencies, but it seems that the version of the robotcode language server used by the vscode extension is bundled with the extension.

in my project i have the robotcode[languageserver] pypi package installed, so i would expect it to use that, along with the dependencies in my project's venv instead of the versions bundled with vscode.

since i also use robotcode[analyze] in my CI, having vscode use a different version of robotcode causes vscode to show different errors to the CI.

Describe the solution you'd like
most vscode language server extensions solve this problem with an importStrategy setting. for example ruff. it would be nice if robotcode did the same thing (ideally it would default to "fromEnvironment")

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@DetachHead DetachHead added the enhancement New feature or request label Apr 3, 2025
@DetachHead
Copy link
Contributor Author

fyi it looks like TypeForm causes a runtime error in robot as well, see robotframework/robotframework#5393

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

No branches or pull requests

1 participant