Skip to content

Commit

Permalink
Merge pull request #2 from jabraham17/ux-improvements
Browse files Browse the repository at this point in the history
User experience improvements
  • Loading branch information
jabraham17 authored Feb 26, 2024
2 parents 38c7931 + fe42a01 commit 043d49a
Show file tree
Hide file tree
Showing 7 changed files with 680 additions and 263 deletions.
18 changes: 18 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@ After installing the extension, follow these steps to make sure VSCode is setup

### From an existing Chapel build

These directions assume you already have Chapel built from source and know what your `CHPL_HOME` is:
The extension can auto-detect your `CHPL_HOME`, just open a Chapel file. The extension will prompt you to select an existing Chapel install to configure your editor. If you don't see your value of `CHPL_HOME` or don't know the right one, run `chpl --print-chpl-home` to get the right value. If the automatic installation fails, you can explicitly set your `CHPL_HOME` in your VSCode settings.json as `"chapel.CHPL_HOME": "/path/to/your/chapel/home"`.

1. Execute the following command to build the python tools `(cd $CHPL_HOME && make chapel-py-venv)`
2. Set your `CHPL_HOME` in your VSCode settings.json as `"chapel.CHPL_HOME": "/path/to/your/chapel/home"`.
The extension can also auto-build the Chapel language tools and will prompt you to do so if they are missing. If you prefer to build them manually, run the following: `(export CHPL_HOME=/path/to/your/chapel/home && cd $CHPL_HOME && make chpl-language-server && make chplcheck)`

### Without an existing Chapel build

1. Obtain a copy of latest Chapel source release from <https://chapel-lang.org/download.html>
2. After downloading the tar, extract the source tree with `tar xzf chapel-VERSION.tar.gz`
3. Build the python tools with ``(cd chapel-VERSION && CHPL_HOME=`pwd` make chapel-py-venv && echo "Your CHPL_HOME is '`pwd`'")``
4. The above command will tell you what your `CHPL_HOME` is, add it to your VSCode settings.json as `"chapel.CHPL_HOME": "/path/to/your/chapel/home"`.
3. After unpacking the tar, you can treat this as your `CHPL_HOME` (`"/path/to/unpacked/source/chapel-VERSION"`) and follow the steps for an existing Chapel build.

## Linter options

Expand Down
39 changes: 27 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,21 @@
},
{
"language": "chapel-ast",
"scopeName": "source.ast",
"scopeName": "source.chapelAst",
"path": "./syntaxes/chapel-ast.tmLanguage.json"
}
],
"commands": [
{
"command": "chapel.findChpl",
"title": "Find Chapel",
"category": "chapel"
},
{
"command": "chapel.buildTools",
"title": "Build chpl-language-server and chplcheck",
"category": "chapel"
},
{
"command": "chplcheck.restart",
"title": "Restart chplcheck",
Expand All @@ -87,6 +97,10 @@
"category": "chapel"
}
],
"activationEvents": [
"onLanguage:chapel",
"onLanguage:chapel-ast"
],
"configuration": [
{
"type": "object",
Expand All @@ -103,11 +117,6 @@
"default": false,
"description": "CHPL_DEVELOPER"
},
"chapel.chplcheck.path": {
"scope": "window",
"type": "string",
"description": "path for chplcheck"
},
"chapel.chplcheck.enable": {
"scope": "window",
"type": "boolean",
Expand All @@ -123,17 +132,18 @@
"default": [],
"description": "Extra arguments to pass to chplcheck"
},
"chapel.chpl-language-server.path": {
"scope": "window",
"type": "string",
"description": "path for chpl-language-server"
},
"chapel.chpl-language-server.enable": {
"scope": "window",
"type": "boolean",
"default": true,
"description": "Enable chpl-language-server"
},
"chapel.chpl-language-server.resolver": {
"scope": "window",
"type": "boolean",
"default": false,
"description": "Enable the dyno resover"
},
"chapel.chpl-language-server.args": {
"scope": "window",
"type": "array",
Expand All @@ -144,7 +154,12 @@
}
}
}
]
],
"configurationDefaults": {
"[chapel]": {
"editor.semanticHighlighting.enabled": true
}
}
},
"scripts": {
"vscode:prepublish": "npm run compile",
Expand Down
Loading

0 comments on commit 043d49a

Please sign in to comment.