Skip to content

Commit

Permalink
[Haskell] Tweak Cabal Symbol List
Browse files Browse the repository at this point in the history
Use `meta.toc-list` to add section headers to local symbol lists and
make both the section kind and name available for Goto Symbol.
  • Loading branch information
deathaxe committed Jan 2, 2021
1 parent 0aedb3a commit f06be56
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
14 changes: 0 additions & 14 deletions Haskell/Cabal Symbol List - Sections.tmPreferences

This file was deleted.

File renamed without changes.
7 changes: 4 additions & 3 deletions Haskell/Cabal.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,11 @@ contexts:
###[ KEYWORDS AND OPERATORS ]##################################################

keywords:
- match: ^({{section_tags}})(?:\s+([^\s,]+))?\s*$
- match: ^(({{section_tags}})(?:\s+([^\s,]+))?)\s*$
captures:
1: keyword.declaration.section.cabal
2: entity.name.section.cabal
1: meta.toc-list.sections.cabal
2: keyword.declaration.section.cabal
3: entity.name.section.cabal
- match: (if|else)\b
scope: keyword.control.conditional.cabal

Expand Down
7 changes: 4 additions & 3 deletions Haskell/syntax_test_cabal.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,12 @@ build-depends: pandoc,
-- ^ punctuation.separator.sequence.cabal

executable
-- <- keyword.declaration.section.cabal
-- ^^^^^^^ keyword.declaration.section.cabal
-- <- meta.toc-list.sections.cabal keyword.declaration.section.cabal
-- ^^^^^^^ meta.toc-list.sections.cabal keyword.declaration.section.cabal

executable pandoc
-- <- keyword.declaration.section.cabal
-- <- meta.toc-list.sections.cabal keyword.declaration.section.cabal
-- ^^^^^^^^^^^^^^^ meta.toc-list.sections.cabal
-- ^^^^^^^ keyword.declaration.section.cabal
-- ^^^^^^ entity.name.section.cabal

Expand Down

0 comments on commit f06be56

Please sign in to comment.