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

Code completion not working #80

Open
cxm1997 opened this issue Nov 26, 2023 · 11 comments
Open

Code completion not working #80

cxm1997 opened this issue Nov 26, 2023 · 11 comments

Comments

@cxm1997
Copy link

cxm1997 commented Nov 26, 2023

Code completion not working
I don't know if additional configurations are needed.
I want work like the first GIF image of GitHub's Features.

my env:
os: win10
vscode 1.84.2
java 11.0.19

@dhuebner
Copy link
Member

@cxm1997
No additional configuration is needed.
Are you sure that the language server is running?

Note: You need to have Java 11 correctly installed on your system.

@cxm1997
Copy link
Author

cxm1997 commented Nov 28, 2023

C:\Users\paul>java -version
java version "11.0.19" 2023-04-18 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.19+9-LTS-224)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.19+9-LTS-224, mixed mode)

My Java environment is as above.
I tested both the Win10 system and Ubuntu 20.04 system, but the completion function did not work properly.
But the error prompt, graphics, and other functions are working properly.

@dhuebner
Copy link
Member

@cxm1997
I see. How large is your workspace? Could you please try out with a small yang file example?
Otherwise it would be nice to have a tiny reproducible example, so I can try it out in the dev environment.

@cxm1997
Copy link
Author

cxm1997 commented Nov 28, 2023

Thank you very much for your help
I am learning Huawei Yang,GitHub repository https://github.com/ThorstenHeinze/HuaweiYangs.git
You can try using vscdoe to open and edit any yang file

@cxm1997
Copy link
Author

cxm1997 commented Nov 28, 2023

The book of Network Programming with YANG: The Structure of Network Automation with YANG, NETCONF, RESTCONF, and gNMI.
This book provides a simple example of Yang, GitHub repository https://github.com/janlindblad/bookzone
You can try the 1-intro in this repository

@dhuebner
Copy link
Member

@cxm1997
I just installed Yangster v2.3.2 and opened your book example. A can see the content assist for built-in types. So for me it does work.
Bildschirmfoto 2023-11-28 um 10 28 53

@cxm1997
Copy link
Author

cxm1997 commented Nov 28, 2023

I opened the debug mode of yang_language_server. bat
Then I saw the error log for Extension Host in vscode
error

@dhuebner
Copy link
Member

@cxm1997
Okay, looks like the communication goes over the websocket?
I don't think the extension and the LS is remote usage ready. I will need to setup a test environment for that and see if it easily possible to support this case.

@cxm1997
Copy link
Author

cxm1997 commented Nov 29, 2023

Thank you for your answer.
Could you please let me know your VScode version so that I can give it a try

@dhuebner
Copy link
Member

@cxm1997
I mean, it looks like you are using VS-Code with WSL (Windows-Subsystem für Linux).
It might cause the problem you see.

@cxm1997
Copy link
Author

cxm1997 commented Nov 29, 2023

I disable wsl. Then show error.
2023-11-30 02:12:03.100 [error] [typefox.yang-vscode] provider FAILED
2023-11-30 02:12:03.101 [error] Error: name must not be falsy
at s.validate (e:\software\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:121:17042)
at new s (e:\software\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:121:17337)
at H (c:\Users\paul.vscode\extensions\typefox.yang-vscode-2.3.2\extension\pack\extension.js:1:244674)
at H (c:\Users\paul.vscode\extensions\typefox.yang-vscode-2.3.2\extension\pack\extension.js:1:244849)
at Array.map ()
at Object.asDocumentSymbols (c:\Users\paul.vscode\extensions\typefox.yang-vscode-2.3.2\extension\pack\extension.js:1:250012)
at c:\Users\paul.vscode\extensions\typefox.yang-vscode-2.3.2\extension\pack\extension.js:1:27254
at async s.provideDocumentSymbols (e:\software\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:127:39147)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants