vls
vls copied to clipboard
Navigate to definition is not working correctly
If I cmd+click on walk in
os.walk("<some-path>", walker)
it does nothing. (it works for builtins like println)
Using latest v and vls on OSX 11.5 and VSCode.
@rasa-silva is there a minimal code that I can use to reproduce the behavior?
module main
import os
fn walker(elem string) {
println('visiting $elem')
}
fn main() {
os.walk('<some-dir>', walker)
}
cmd+click works for println but does not for walk
I'm sorry, I was pointing to an old build of vls. The current problem is actually bigger...I point to the vls binary in vscode along with "Enables the language server" and "enable debug". Vscode instantiates VLS and the log file is created with
[Trace - 09:19:55] Sending notification 'window/showMessage'.
Params: {"jsonrpc":"2.0","method":"window/showMessage","params":{"type":2,"message":"VLS is a work-in-progress, pre-alpha language server. It may not be guaranteed to work reliably due to memory issues and other related factors. We encourage you to submit an issue if you encounter any problems."}}
[Trace - 09:19:55] Received request 'initialize - (0)'.
Params: {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":79709,"clientInfo":{"name":"Visual Studio Code","version":"1.60.1"},"locale":"en-us","rootPath":"/Users/ricardo.silva/code/vex","rootUri":"file:///Users/ricardo.silva/code/vex","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional","normalizesLineEndings":true,"changeAnnotationSupport":{"groupsOnLabel":true}},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]}},"codeLens":{"refreshSupport":true},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true,"semanticTokens":{"refreshSupport":true},"fileOperations":{"dynamicRegistration":true,"didCreate":true,"didRename":true,"didDelete":true,"willCreate":true,"willRename":true,"willDelete":true}},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]},"codeDescriptionSupport":true,"dataSupport":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]},"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"insertTextModeSupport":{"valueSet":[1,2]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true},"activeParameterSupport":true},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]},"labelSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"disabledSupport":true,"dataSupport":true,"resolveSupport":{"properties":["edit"]},"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"honorsChangeAnnotations":false},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true,"prepareSupportDefaultBehavior":1,"honorsChangeAnnotations":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true},"callHiera
but no functionality of the language server is available and no output "tab" is created for VLS. Also, the message "VLS is a work in progress..." does not show up... Maybe this should be an error for the VSCode extension and not VLS...
It can work for me on Windows.
Ok, sorry for the confusion. I think I found the issue...
- If I use the custom path to VLS it has the behavior of my last comment. It runs the server but somehow it doesn't seem to connect with VSCode
- If I use the fetched version of VLS, it has the behavior of my original comment.
The first case seems an issue with the extension. The second seems a problem with the server itself...
@rasa-silva I just tried it just now and is indeed not jumping to the file. This is something I'm clueless about as to what the actual cause for this (even on the VSCode side, it does not show any error logs) but it is something must be investigated and fixed.
(NOTE: The logs on the right side are just enabled on the custom built I made to verify if there is returned data)
https://user-images.githubusercontent.com/7358345/134320188-479963cf-af20-440c-b94c-78b06c9b003e.mov
Well, at least it's reproducible 😅 and thanks for the quick update!
Try https://blog.vosca.dev/meet-v-analyzer/ instead, now that it is released.