Skip to content

Commit

Permalink
Fix #65 Support multiple directives in symbols
Browse files Browse the repository at this point in the history
Signed-off-by: Remy Suen <[email protected]>
  • Loading branch information
rcjsuen committed Mar 27, 2020
1 parent 0b8986f commit 38fd898
Show file tree
Hide file tree
Showing 3 changed files with 223 additions and 176 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
All notable changes to this project will be documented in this file.

## [Unreleased]
### Added
- support multiple directives when calculating a Dockerfile's symbols ([#65](https://github.com/rcjsuen/dockerfile-language-service/issues/65))

## [0.0.10] - 2020-03-25
### Added
- all tokens are now assigned a semantic meaning for the experimental support of semantic tokens ([#54](https://github.com/rcjsuen/dockerfile-language-service/issues/54))
Expand Down Expand Up @@ -278,6 +282,7 @@ let workspaceEdit = {
- textDocument/rename
- textDocument/hover

[Unreleased]: https://github.com/rcjsuen/dockerfile-language-service/compare/v0.0.10...HEAD
[0.0.10]: https://github.com/rcjsuen/dockerfile-language-service/compare/v0.0.9...v0.0.10
[0.0.9]: https://github.com/rcjsuen/dockerfile-language-service/compare/v0.0.8...v0.0.9
[0.0.8]: https://github.com/rcjsuen/dockerfile-language-service/compare/v0.0.7...v0.0.8
Expand Down
3 changes: 1 addition & 2 deletions src/dockerSymbols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ export class DockerSymbols {

public parseSymbolInformation(textDocument: TextDocumentIdentifier, content: string): SymbolInformation[] {
let dockerfile = DockerfileParser.parse(content);
let directive = dockerfile.getDirective();
let symbols: SymbolInformation[] = [];
if (directive !== null) {
for (const directive of dockerfile.getDirectives()) {
symbols.push(this.createSymbolInformation(directive.getName(), textDocument.uri, directive.getNameRange(), SymbolKind.Property, false));
}
for (let instruction of dockerfile.getInstructions()) {
Expand Down
Loading

0 comments on commit 38fd898

Please sign in to comment.