yang-vscode icon indicating copy to clipboard operation
yang-vscode copied to clipboard

Code completion not working

Open cxm1997 opened this issue 2 years ago • 11 comments

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

cxm1997 avatar Nov 26 '23 10:11 cxm1997

@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.

dhuebner avatar Nov 27 '23 11:11 dhuebner

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.

cxm1997 avatar Nov 28 '23 04:11 cxm1997

@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.

dhuebner avatar Nov 28 '23 07:11 dhuebner

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 avatar Nov 28 '23 08:11 cxm1997

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

cxm1997 avatar Nov 28 '23 08:11 cxm1997

@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

dhuebner avatar Nov 28 '23 09:11 dhuebner

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

cxm1997 avatar Nov 28 '23 17:11 cxm1997

@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.

dhuebner avatar Nov 29 '23 08:11 dhuebner

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

cxm1997 avatar Nov 29 '23 15:11 cxm1997

@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.

dhuebner avatar Nov 29 '23 15:11 dhuebner

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)

cxm1997 avatar Nov 29 '23 18:11 cxm1997