-
Notifications
You must be signed in to change notification settings - Fork 21
(GH-56) OutLineView #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a0d5ce0 to
4068ce8
Compare
|
@glennsarti Initial commits squashed, tests fixed. First pass attempt at making rubocop happy. Still todo: determine symbol icons and remove debug list of symbols |
51f5e8e to
ed00d82
Compare
|
puppetlabs/puppet-vscode#395 has been merged so this PR can be used by the client now. |
| describe 'PuppetLanguageServer::PuppetParserHelper' do | ||
| let(:subject) { PuppetLanguageServer::PuppetParserHelper } | ||
| describe 'PuppetLanguageServer::Manifest::DocumentSymbolProvider', | ||
| :if => Gem::Version.new(Puppet.version) >= Gem::Version.new('5.0.0') do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens on Puppet 4? Curious why we aren't testing on it?
|
@jpogran I've update your branch with tests for Puppet 4 and some minor fixes. |
7f5de7d to
ab661e6
Compare
|
Squashed commits and updated changelog |
|
@glennsarti @michaeltlombardi I think we're good to merge this in today |
| begin | ||
| case documents.document_type(file_uri) | ||
| when :manifest | ||
| r = PuppetLanguageServer::PuppetParserHelper.extract_document_symbols(content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm suprised rubocop didn't complain about the single letter variable.
| graph | ||
| end | ||
|
|
||
| def self.extract_document_symbols(content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be here
| begin | ||
| case documents.document_type(file_uri) | ||
| when :manifest | ||
| r = PuppetLanguageServer::PuppetParserHelper.extract_document_symbols(content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be using PuppetLanguageServer::Manifest::DocumentSymbolProvider
glennsarti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pending changes.
This commit adds the DocumentSymbolProvider and supporting code to the LanguageServer. It uses a procedural implementation to parse the output of the Puppet AST to generate symbols that VSCode understands. This lights up OutlineView, Breadcrumbs, and symbol search using the command pallete.
This commit builds on the procedural DocumentSymbolProvider and makes it a recursive one. This does not support the Puppet 4 AST, and returns an empty array.
ab661e6 to
bd64c96
Compare
|
@glennsarti please review...again |
This PR implements a DocumentSymbolProvider for the LanguageServer. It parses Puppet manifests and produce symbols for classes, types, parameters and variables.