puppetlabs / puppet-editor-services

Puppet Language Server for editors
Apache License 2.0
45 stars 21 forks source link

[1.0] Fix Workspace Symbol Provider #269

Closed glennsarti closed 4 years ago

glennsarti commented 4 years ago

Looks like the document symbol provider may need some work.

**"jsonrpc":"2.0","id":29,"method":"workspace/symbol","params":{"query":""}}
---
W, [2020-07-11T20:31:57.838792 #7976]  WARN -- : [Manifest::DocumentSymbolProvider] Unknown object type PuppetLanguageServer::Sidecar::Protocol::PuppetDataType
W, [2020-07-11T20:31:57.839161 #7976]  WARN -- : [Manifest::DocumentSymbolProvider] Unknown object type PuppetLanguageServer::Sidecar::Protocol::PuppetDataType
W, [2020-07-11T20:31:57.839468 #7976]  WARN -- : [Manifest::DocumentSymbolProvider] Unknown object type PuppetLanguageServer::Sidecar::Protocol::PuppetDataType
W, [2020-07-11T20:31:57.839725 #7976]  WARN -- : [Manifest::DocumentSymbolProvider] Unknown object type PuppetLanguageServer::Sidecar::Protocol::PuppetDataType
W, [2020-07-11T20:31:57.840034 #7976]  WARN -- : [Manifest::DocumentSymbolProvider] Unknown object type PuppetLanguageServer::Sidecar::Protocol::PuppetDataType
W, [2020-07-11T20:31:57.840303 #7976]  WARN -- : [Manifest::DocumentSymbolProvider] Unknown object type PuppetLanguageServer::Sidecar::Protocol::PuppetDataType
E, [2020-07-11T20:31:57.841884 #7976] ERROR -- : (workspace/symbol) undefined method `start_with?' for nil:NilClass
D, [2020-07-11T20:31:57.842149 #7976] DEBUG -- : --- OUTBOUND
{"jsonrpc":"2.0","id":29,"result":[]}
glennsarti commented 4 years ago

Found it (and a few other bugs too)

Some items in the object cache have nil as their file source (e.g. Bolt static data) which then blows up the build_file_uri helper

glennsarti commented 4 years ago

Making some nice work on this. Bunch more bug fixes I found.