Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Fix bare unit type applications ([#225](https://github.com/JustusAdam/language-haskell/issue/225)), thanks to [@mixphix](https://github.com/mixphix)
- Fix qualified type operators in export lists ([#191](https://github.com/JustusAdam/language-haskell/issue/191)), thanks to [@mixphix]
- Add support for `elif` in Cabal files (`cabal-version` >= 2.2) ([#236](https://github.com/JustusAdam/language-haskell/pull/236))
- Add support for cabal.project files ([#237] (https://github.com/JustusAdam/language-haskell/issues/237)), thanks to [@rm41339]

## 3.6.0 - 15.03.2022

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CONVERT=npx js-yaml
VSCE=npx vsce
SYNTAXES=haskell cabal literateHaskell alex happy
SYNTAXES=haskell cabal cabalProject literateHaskell alex happy
JSON_TARGETS=$(addsuffix .json,$(addprefix syntaxes/,$(SYNTAXES)))
SCOPE_LISTS=$(addsuffix .md,$(addprefix scope-lists/,$(SYNTAXES)))

Expand Down Expand Up @@ -31,4 +31,4 @@ package: all
$(VSCE) package

clean:
rm $(JSON_TARGETS)
rm $(JSON_TARGETS)
20 changes: 19 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,19 @@
],
"configuration": "./cabal-configuration.json"
},
{
"id": "cabal project",
"aliases": [
"CabalProject",
"cabal-project",
"cabal project"
],
"extensions": [
".project",
".project.local"
],
"configuration": "./cabal-configuration.json"
},
{
"id": "C2Hs",
"aliases": [
Expand Down Expand Up @@ -168,6 +181,11 @@
"scopeName": "source.cabal",
"path": "./syntaxes/cabal.json"
},
{
"language": "cabal project",
"scopeName": "cabal.source.project",
"path": "./syntaxes/cabalProject.json"
},
{
"language": "C2Hs",
"scopeName": "source.c2hs",
Expand Down Expand Up @@ -242,4 +260,4 @@
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1"
}
}
}
10 changes: 10 additions & 0 deletions scope-lists/cabalProject.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Scope Name | Description | Example |
|-|-|-|
| comment.line.double-dash | | |
| constant.numeric.cabal | | |
| entity.name.function.cabal | | |
| entity.name.section.cabal | | |
| keyword.control.cabal | | |
| keyword.operator.cabal | | |
| keyword.other.cabal | | |
| markup.underline.link.cabal | | |
10 changes: 10 additions & 0 deletions scope-lists/cabalProject.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- scope: CabalProject
hide: true
- scope: comment.line.double-dash
- scope: constant.numeric.cabal
- scope: entity.name.function.cabal
- scope: entity.name.section.cabal
- scope: keyword.control.cabal
- scope: keyword.operator.cabal
- scope: keyword.other.cabal
- scope: markup.underline.link.cabal
25 changes: 25 additions & 0 deletions syntax-examples/cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-- A comment

packages: test-name
import: file
verbose: 0
allow-older: False
haddock-keep-temp-files: False

package example
flags: +flags
tests: False
benchmarks: False
extra-lib-dirs: test

source-repository repo
type: git
location: test
tag: test
subdir: test

program-options
shared: False
ghc-options: -test


149 changes: 149 additions & 0 deletions syntaxes/cabalProject.YAML-tmLanguage
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
fileTypes:
- project
- project.local
name: CabalProject
patterns:
- name: keyword.other.cabal
match: |
(?ix)(\n|^)
( tests
| import
| (optional-|extra-)?packages
| benchmarks
| verbose
| build-(summary|log)
| remote-build-reporting
| report-planning-failure
| symlink-bindir
| jobs
| semaphore
| keep-going
| offline
| haddock-keep-temp-files
| http-transport
| ignore-(expiry|project)
| remote-repo-cache
| (logs-|project-|build|store-)dir
| (doc-index|project)-file
| (with-)?compiler
| with-hc-pkg
| package-dbs
| active-repositories
| index-state
| constraints
| preferences
| cabal-lib-version
| solver
| allow-(older|newer|boot-library-installs)
| write-ghc-environment-files
| max-backjumps
| reorder-goals
| (count|fine-grained)-conflicts
| minimize-conflict-set
| (strong-)?flags
| reject-unconstrained-dependencies
| per-component
| independent-goals
| prefer-oldest
| extra-prog-path-shared-only
| multi-repl
| test-((machine-)?log|show-details|keep-tix-files
|wrapper|fail-when-no-test-suites|options)
):
- name: keyword.other.cabal
match: |
(?ix)^[ \t]+
( haddock-(all|hoogle|html|foreign-libraries|executables
|tests|benchmarks|internal|(hscolour-)?css
|hyperlink-source|quickjump|(contents|index|html)-location
|base-url|(resources|output)-dir|use-unicode|for-hackage
|keep-temp-files)
| extra-prog-path
| (strong-)?flags
| library-(vanilla|for-ghci|stripping)
| shared
| static
| executable-(dynamic|static|stripping)
| ((library|executable)-)?profiling(-(shared|detail))?
| optimization
| program-(prefix|suffix)
| extra-(lib|framework|include)-dirs(-static)?
| split-(sections|objs)
| (run-)?tests
| benchmarks
| relocatable
| (debug|build)-info
| documentation
| test-((machine-)?log|show-details|keep-tix-files
|wrapper|fail-when-no-test-suites|options)
| coverage
| (benchmark|ghc|test|configure)-options
| type
| location
| tag
| subdir
| import
| (optional-|extra-)?packages
| verbose
| build-(summary|log)
| remote-build-reporting
| report-planning-failure
| symlink-bindir
| jobs
| semaphore
| keep-going
| offline
| http-transport
| ignore-(expiry|project)
| remote-repo-cache
| (logs-|project-|build|store-)dir
| (with-)?compiler
| with-hc-pkg
| (doc-index|project)-file
| package-dbs
| active-repositories
| index-state
| constraints
| preferences
| cabal-lib-version
| solver
| allow-(older|newer|boot-library-installs)
| write-ghc-environment-files
| max-backjumps
| reorder-goals
| (count|fine-grained)-conflicts
| minimize-conflict-set
| reject-unconstrained-dependencies
| per-component
| independent-goals
| prefer-oldest
| extra-prog-path-shared-only
| multi-repl
| x-\w[1-9\w_-]*
):
- name: keyword.operator.cabal
match: '(==|>=|<=|<|>|^>=|\|\||&&|!)'
- name: constant.numeric.cabal
match: '(?<=[^\w])\d+(.\d+)*(.*)?|[0-9]{4}-[0-9]{2}-[0-9]{2}(T[0-9]{2}(:[0-9]{2}){2}Z)?'
- name: markup.underline.link.cabal
match: '\w+:/(/[\w._\-\d%])+(\?[\w.+_\-\d%]+)(&[\w._+\-\d%]+)*'
- name: entity.name.section.cabal
match: |
^(?ix:
( program-options )
)$
- match: |
^(?ix:
( package
| source-repository
)
)( |\t)+([\w\-_]+)$
captures:
'1': {name: entity.name.section.cabal}
'3': {name: entity.name.function.cabal}
- name: keyword.control.cabal
match: '^[ \t]*(if|elif|else)'
- name: comment.line.double-dash
match: '^\s*--.*$'
scopeName: cabal.source.project
uuid: 5eb56f02-df11-40b2-b6d5-fa444522416c
54 changes: 54 additions & 0 deletions syntaxes/cabalProject.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"fileTypes": [
"project",
"project.local"
],
"name": "CabalProject",
"patterns": [
{
"name": "keyword.other.cabal",
"match": "(?ix)(\\n|^)\n ( tests\n | import\n | (optional-|extra-)?packages\n | benchmarks\n | verbose\n | build-(summary|log)\n | remote-build-reporting\n | report-planning-failure\n | symlink-bindir\n | jobs\n | semaphore\n | keep-going\n | offline\n | haddock-keep-temp-files \n | http-transport\n | ignore-(expiry|project)\n | remote-repo-cache\n | (logs-|project-|build|store-)dir \n | (doc-index|project)-file \n | (with-)?compiler\n | with-hc-pkg \n | package-dbs\n | active-repositories \n | index-state\n | constraints\n | preferences\n | cabal-lib-version\n | solver \n | allow-(older|newer|boot-library-installs)\n | write-ghc-environment-files \n | max-backjumps\n | reorder-goals \n | (count|fine-grained)-conflicts\n | minimize-conflict-set \n | (strong-)?flags\n | reject-unconstrained-dependencies\n | per-component\n | independent-goals \n | prefer-oldest\n | extra-prog-path-shared-only\n | multi-repl \n | test-((machine-)?log|show-details|keep-tix-files\n |wrapper|fail-when-no-test-suites|options)\n ):\n"
},
{
"name": "keyword.other.cabal",
"match": "(?ix)^[ \\t]+\n ( haddock-(all|hoogle|html|foreign-libraries|executables\n |tests|benchmarks|internal|(hscolour-)?css|hyperlink-source\n |quickjump|(contents|index|html)-location|base-url\n |(resources|output)-dir|use-unicode|for-hackage\n |keep-temp-files)\n | extra-prog-path \n | (strong-)?flags \n | library-(vanilla|for-ghci|stripping)\n | shared \n | static \n | executable-(dynamic|static|stripping)\n | ((library|executable)-)?profiling(-(shared|detail))?\n | optimization \n | program-(prefix|suffix)\n | extra-(lib|framework|include)-dirs(-static)?\n | split-(sections|objs)\n | (run-)?tests \n | benchmarks \n | relocatable\n | (debug|build)-info\n | documentation\n | test-((machine-)?log|show-details|keep-tix-files\n |wrapper|fail-when-no-test-suites|options)\n | coverage \n | (benchmark|ghc|test|configure)-options\n | type \n | location \n | tag \n | subdir\n | tests\n | import\n | (optional-|extra-)?packages\n | benchmarks\n | verbose\n | build-(summary|log)\n | remote-build-reporting\n | report-planning-failure\n | symlink-bindir\n | jobs\n | semaphore\n | keep-going\n | offline \n | http-transport\n | ignore-(expiry|project)\n | remote-repo-cache\n | (logs-|project-|build|store-)dir \n | (with-)?compiler\n | with-hc-pkg \n | (doc-index|project)-file \n | package-dbs\n | active-repositories \n | index-state\n | constraints\n | preferences\n | cabal-lib-version\n | solver \n | allow-(older|newer|boot-library-installs)\n | write-ghc-environment-files \n | max-backjumps\n | reorder-goals \n | (count|fine-grained)-conflicts\n | minimize-conflict-set \n | reject-unconstrained-dependencies\n | per-component\n | independent-goals \n | prefer-oldest\n | extra-prog-path-shared-only\n | multi-repl \n | x-\\w[1-9\\w_-]*\n ):\n"
},
{
"name": "keyword.operator.cabal",
"match": "(==|>=|<=|<|>|^>=|\\|\\||&&|!)"
},
{
"name": "constant.numeric.cabal",
"match": "(?<=[^\\w])\\d+(.\\d+)*(.*)?|[0-9]{4}-[0-9]{2}-[0-9]{2}(T[0-9]{2}(:[0-9]{2}){2}Z)?"
},
{
"name": "markup.underline.link.cabal",
"match": "\\w+:/(/[\\w._\\-\\d%])+(\\?[\\w.+_\\-\\d%]+)(&[\\w._+\\-\\d%]+)*"
},
{
"name": "entity.name.section.cabal",
"match": "^(?ix:\n ( program-options )\n)$\n"
},
{
"match": "^(?ix:\n ( package\n | source-repository\n )\n)( |\\t)+([\\w\\-_]+)$\n",
"captures": {
"1": {
"name": "entity.name.section.cabal"
},
"3": {
"name": "entity.name.function.cabal"
}
}
},
{
"name": "keyword.control.cabal",
"match": "^[ \\t]*(if|elif|else)"
},
{
"name": "comment.line.double-dash",
"match": "^\\s*--.*$"
}
],
"scopeName": "cabal.source.project",
"uuid": "5eb56f02-df11-40b2-b6d5-fa444522416c"
}