Skip to content

Commit

Permalink
feat: Add dictionaries for Julia (#3037)
Browse files Browse the repository at this point in the history
Co-authored-by: Jason Dent <jason@streetsidesoftware.nl>
  • Loading branch information
theogf and Jason3S committed Mar 11, 2024
1 parent 8586ecc commit bb18baf
Show file tree
Hide file tree
Showing 14 changed files with 2,037 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dictionaries/julia/CHANGELOG.md
@@ -0,0 +1,5 @@
# Change Log

## 1.0.0

- Initial Release
21 changes: 21 additions & 0 deletions dictionaries/julia/LICENSE
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2023 Street Side Software <support@streetsidesoftware.nl>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
61 changes: 61 additions & 0 deletions dictionaries/julia/README.md
@@ -0,0 +1,61 @@
# CSpell Julia Dictionary

Julia dictionary for cspell.

This is a pre-built dictionary for use with CSpell.

## Installation

Global Install and add to CSpell global settings.

```sh
npm install -g @cspell/dict-julia
cspell link add @cspell/dict-julia
```

## Uninstall from CSpell

```sh
cspell link remove @cspell/dict-julia
```

## Manual Installation

Manual installation is useful if you want to include this dictionary as part of your CI/CD lint process.

```
npm i @cspell/dict-julia
```

The `cspell-ext.json` file in this package should be added to the import section in your `cspell.json` file.

```javascript
{
//
"import": ["@cspell/dict-julia/cspell-ext.json"],
//
}
```

# Dictionary Development

See: [How to Create a New Dictionary](https://github.com/streetsidesoftware/cspell-dicts#how-to-create-a-new-dictionary)

## Script to export all relevant Base functions

```julia
base_functions = names(Base) .|> string
# We get rid of operators like +, - etc...
filter!(f -> !isnothing(match(r"\w+", f)), base_functions)
open("./src/julia.txt", "w") do io
println.(io, base_functions)
end;
```

## License

MIT

> Some packages may have other licenses included.
<!--- @@inject: ../../static/footer.md --->
3 changes: 3 additions & 0 deletions dictionaries/julia/checksum.txt
@@ -0,0 +1,3 @@
4c913d628db4407b852f9af1ce1f178d5794d3ee dict/julia.txt
ea9e153c7f0d9b19107115d05e79ef99925cfdc2 src/julia-keywords.txt
478f3c56a02670d3fe864387e2577f287c9a92fe src/julia.txt
44 changes: 44 additions & 0 deletions dictionaries/julia/cspell-ext.json
@@ -0,0 +1,44 @@
// cSpell Settings
{
"id": "julia",
"version": "0.2",
"name": "Julia Dictionary",
"description": "Julia function and keyword dictionary",
"readonly": true,
// List of dictionary files to add to the global list of dictionaries
"dictionaryDefinitions": [
{
"name": "julia",
"path": "./dict/julia.txt",
"description": "Julia Dictionary"
}
],
// Dictionaries to always be used.
// Generally left empty
"dictionaries": [],
// Language Rules to apply to matching files.
// Files are matched on `languageId` and `locale`
"languageSettings": [
{
// VSCode languageId. i.e. typescript, java, go, cpp, javascript, markdown, latex
// * will match against any file type.
"languageId": "julia",
// Language locale. i.e. en-US, de-AT, or ru. * will match all locales.
// Multiple locales can be specified like: "en, en-US" to match both English and English US.
"locale": "*",
// By default the whole text of a file is included for spell checking
// Adding patterns to the "includeRegExpList" to only include matching patterns
"includeRegExpList": [],
// To exclude patterns, add them to "ignoreRegExpList"
"ignoreRegExpList": [],
// regex patterns than can be used with ignoreRegExpList or includeRegExpList
// Example: "pattern": [{ "name": "mdash", "pattern": "&mdash;" }]
// This could be included in "ignoreRegExpList": ["mdash"]
"patterns": [],
// List of dictionaries to enable by name in `dictionaryDefinitions`
"dictionaries": ["julia"],
// Dictionary definitions can also be supplied here. They are only used iff "languageId" and "locale" match.
"dictionaryDefinitions": []
}
]
}
13 changes: 13 additions & 0 deletions dictionaries/julia/cspell-tools.config.yaml
@@ -0,0 +1,13 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/streetsidesoftware/cspell/main/packages/cspell-tools/cspell-tools.config.schema.json

targets:
- name: 'julia'
sources:
- filename: 'src/julia.txt'
- filename: 'src/julia-keywords.txt'
split: true
format: 'plaintext'
targetDirectory: './dict'
generateNonStrict: false
compress: false
checksumFile: true
12 changes: 12 additions & 0 deletions dictionaries/julia/cspell.json
@@ -0,0 +1,12 @@
{
"version": "0.2",
"files": [
"**/*.{md,txt}"
],
"dictionaries": [
"julia"
],
"import": [
"./cspell-ext.json"
]
}
3 changes: 3 additions & 0 deletions dictionaries/julia/dict/README.md
@@ -0,0 +1,3 @@
# Dict Directory

NOTE: This directory contains generated content. Please edit [src](../src/README.md) files.

0 comments on commit bb18baf

Please sign in to comment.