-
Notifications
You must be signed in to change notification settings - Fork 20
Closed
Description
Part of go to definition feature is navigating to the source file where the function is defined if it's not in the current file. On platforms with paths that have leading slashes, this does not work.
On ubuntu 18.04, vscode 1.28, and pdk 1.7.1 type a simple file declaration and watch the log:
D, [2018-10-24T16:11:25.404160 #34999] DEBUG -- : --- INBOUND
{"jsonrpc":"2.0","id":9,"method":"textDocument/definition","params":{"textDocument":{"uri":"file:///home/james/Documents/foo.pp"},"position":{"line":0,"character":2}}}
---
D, [2018-10-24T16:11:25.418013 #34999] DEBUG -- : --- OUTBOUND
{"jsonrpc":"2.0","id":9,"result":[{"uri":"file:////opt/puppetlabs/pdk/share/cache/ruby/2.4.0/gems/puppet-6.0.2/lib/puppet/type/file.rb","range":{"start":{"line":14,"character":0},"end":{"line":14,"character":1024}}}]}
---
D, [2018-10-24T16:11:25.554092 #34999] DEBUG -- : --- INBOUND
{"jsonrpc":"2.0","id":10,"method":"textDocument/hover","params":{"textDocument":{"uri":"file:///home/james/Documents/foo.pp"},"position":{"line":0,"character":5}}}
---
Note the file uri differences between the definition request and the hover request. It's not a pathing issue in detecting pdk folders because the file is present at that location.
The lines below are where we are building the file uris:
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working