hansec / vscode-fortran-ls

Fortran IntelliSense for Visual Studio Code
MIT License
37 stars 7 forks source link

Hover broken on VSCode version 1.52 #30

Closed gnikit closed 3 years ago

gnikit commented 3 years ago

I am raising this issue proactively in case the behaviour from VS Code Insiders is not a bug and ends up transferring over to the stable VS Code. UPDATE: This behaviour has been ported into the official November release (version 1.52). So I would expect the hovering functionality to not be working in the stable VS Code release also.

UPDATE 5/12/2020: It appears that the official November update, included some changes to the language-server-protocol, which I suspect were the reason for this. The official release appears to have addressed the issue

Version: 1.52.0-insider Commit: 5e350b1b79675cecdff224eb00f7bf62ae8789fc Date: 2020-12-04T10:15:13.654Z Electron: 9.3.5 Chrome: 83.0.4103.122 Node.js: 12.14.1 V8: 8.3.110.13-electron.0 OS: Linux x64 5.4.0-54-generic

Description

Recently in a version of VSCode Insiders at some point after the version listed below, hovering stopped working as expected and started displaying the default message of fortls "fortran90" instead of "INTEGER" for example.

As far as I can tell this has nothing to do with fortls itself but with how fortlsinterfaces with vscode. I say that because the fortls logs between VSCode and VSCode Insiders are identical, yet the feature works on the former and not the latter. All extensions between VSCode and VSCode Insiders are identical; Fortran extension used https://github.com/krvajal/vscode-fortran-support .

The hover feature is broken in all versions after the one posted below i.e. the current compiled binary found at https://code.visualstudio.com/insiders/ should be able to replicate the issue.

Log

DEBUG:fortls.langserver:REQUEST 0 initialize
DEBUG:fortls.jsonrpc:SEND {"jsonrpc":"2.0","id":0,"result":{"capabilities":{"completionProvider":{"resolveProvider":false,"triggerCharacters":["%"]},"definitionProvider":true,"documentSymbolProvider":true,"referencesProvider":true,"hoverProvider":true,"implementationProvider":true,"renameProvider":true,"workspaceSymbolProvider":true,"textDocumentSync":2,"signatureHelpProvider":{"triggerCharacters":["(",","]}}}}
DEBUG:fortls.jsonrpc:SEND {"jsonrpc":"2.0","method":"window/showMessage","params":{"type":3,"message":"FORTLS debugging enabled"}}
DEBUG:fortls.jsonrpc:SEND {"jsonrpc":"2.0","method":"window/showMessage","params":{"type":3,"message":"FORTLS initialization complete"}}
DEBUG:fortls.jsonrpc:RECV {"jsonrpc":"2.0","method":"initialized","params":{}}
DEBUG:fortls.langserver:REQUEST None initialized
DEBUG:fortls.jsonrpc:RECV {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///home/gn/Code/fortran-language-server/test/test_source/test_block.f08","languageId":"FortranFreeForm","version":1,"text":"SUBROUTINE block_sub()\nINTEGER :: res0,i,j,end_var\nres0 = 0\nadd1 : BLOCK\n  INTEGER :: res1\n  res1 = res0 + 1\n  BLOCK\n    INTEGER :: res2,blockVar\n    res2 = res1 + 1\n    blockVar = res0 + 1\n  END BLOCK\nEND BLOCK add1\n!\nouter: DO i=1,10\n  DO j=1,i\n    res0=res0+1\n  END DO\nEND DO outer\n!\nIF(res0>10)THEN\n  i=res0\nEND IF\n!\nASSOCIATE( x=>1 )\n  i=i+x\nEND ASSOCIATE\n! Test variables/labels starting with \"end\"\nend_var= 1\nend_label: DO i=1,3\n  end_var = end_var + i\nEND DO end_label\nEND SUBROUTINE block_sub\n"}}}
DEBUG:fortls.langserver:REQUEST None textDocument/didOpen
DEBUG:fortls.jsonrpc:SEND {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/gn/Code/fortran-language-server/test/test_source/test_block.f08","diagnostics":[]}}
DEBUG:fortls.jsonrpc:RECV {"jsonrpc":"2.0","id":1,"method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///home/gn/Code/fortran-language-server/test/test_source/test_block.f08"}}}
DEBUG:fortls.langserver:REQUEST 1 textDocument/documentSymbol
DEBUG:fortls.jsonrpc:SEND {"jsonrpc":"2.0","id":1,"result":[{"name":"block_sub","kind":12,"location":{"uri":"file:///home/gn/Code/fortran-language-server/test/test_source/test_block.f08","range":{"start":{"line":0,"character":0},"end":{"line":31,"character":0}}}},{"name":"add1","kind":1,"location":{"uri":"file:///home/gn/Code/fortran-language-server/test/test_source/test_block.f08","range":{"start":{"line":3,"character":0},"end":{"line":11,"character":0}}},"containerName":"block_sub"}]}
DEBUG:fortls.jsonrpc:RECV {"jsonrpc":"2.0","id":2,"method":"textDocument/hover","params":{"textDocument":{"uri":"file:///home/gn/Code/fortran-language-server/test/test_source/test_block.f08"},"position":{"line":1,"character":23}}}
DEBUG:fortls.langserver:REQUEST 2 textDocument/hover
DEBUG:fortls.jsonrpc:SEND {"jsonrpc":"2.0","id":2,"result":{"contents":[{"language":"fortran90","value":"INTEGER"}]}}
DEBUG:fortls.jsonrpc:RECV {"jsonrpc":"2.0","method":"textDocument/didClose","params":{"textDocument":{"uri":"file:///home/gn/Code/fortran-language-server/test/test_source/test_block.f08"}}}
DEBUG:fortls.langserver:REQUEST None textDocument/didClose
DEBUG:fortls.jsonrpc:SEND {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/gn/Code/fortran-language-server/test/test_source/test_block.f08","diagnostics":[]}}

Version info

Version: 1.51.0-insider Commit: 2ee8b8c645ec8ab54304bacae7aa979c1d9c647a Date: 2020-10-29T05:47:02.014Z Electron: 9.3.3 Chrome: 83.0.4103.122 Node.js: 12.14.1 V8: 8.3.110.13-electron.0 OS: Linux x64 5.4.0-53-generic