Skip to content

Commit

Permalink
Merge branch 'release/0.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
kenkangxgwe committed Aug 2, 2020
2 parents 34bfee1 + 78a8523 commit a2ccaf1
Show file tree
Hide file tree
Showing 21 changed files with 2,170 additions and 1,132 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop

env:
WOLFRAM_ID: ${{ secrets.WOLFRAM_ID }}
WOLFRAM_PW: ${{ secrets.WOLFRAM_PW }}

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
name: "Run lsp-wl tests"
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Install Wolfram Engine
run: |
wget https://account.wolfram.com/download/public/wolfram-engine/desktop/LINUX
sudo bash LINUX -- -auto -verbose
rm LINUX
- name: Activate Wolfram Engine
run: |
/usr/bin/wolframscript -authenticate $WOLFRAM_ID $WOLFRAM_PW
/usr/bin/wolframscript -activate
- name: Install Paclets
run: |
/usr/bin/wolframscript -code 'PacletInstall["CodeParser"];PacletInstall["CodeInspector"];Exit[]'
- name: Run Tests
run: |
/usr/bin/wolframscript -file init.wls --test
24 changes: 22 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,34 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.2] - 2020-08-01 🐱‍🏍

### Added

- SignatureHelp is available for functions when `[` and `,` is input.

### Changed

- Change the dependencies from `AST` and `Lint` to `CodeParser` and
`CodeInspector`.
- The alias completion has been improved by reducing the number of
`completionItem`s, and returning `\`-prefixed aliases when triggered twice.

### Fixed

- `triggerCharacters` should be a list (thanks to
[@dalanicolai](https://github.com/dalanicolai)).
- The `duplicate requests`
error will not popup in Output window in VSCode (reported by
[@GiovanniBordiga](https://github.com/GiovanniBordiga)).
- MessageName should be shown when hovered

## [0.2.1] - 2020-01-24 🏮🐀

### Added

- Definition / References are available to show in scopes / the whole file.

- DocumentHighlight is available to show the scoped variables.

- DocumentColor / ColorRepresentation are available to show the color names and models.

### Changed
Expand Down
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,21 @@ client would certainly work too.
git clone https://github.com/kenkangxgwe/lsp-wl.git
```

2. Install the dependent paclets with the correct versions (currently 0.15)
2. Install the dependent paclets with the correct versions (currently 1.0)
from the Wolfram kernel / Mathematica.
(_This will cost some time for the first time_) :
``` mathematica
PacletInstall["AST", "UpdateSites" -> True]
PacletInstall["Lint", "UpdateSites" -> True]
PacletInstall["CodeParser"]
PacletInstall["CodeInspector"]
```

3. Install the client. Currently, we provide the VS Code extension on [Visual
Studio Marketplace: Wolfram Language Server](https://marketplace.visualstudio.com/items?itemName=lsp-wl.lsp-wl-client)

4. You may also want to install
[GitLink](https://github.com/WolframResearch/GitLink) packet in order to
check for updates.

## Run the Server

Clients can start the server by running the `init.wls` file from Wolfram
Expand Down Expand Up @@ -130,9 +134,10 @@ This is a good way to see the results from the unit tests.
![completion](images/completion.png)
- **Diagnostics:** Syntax error would be underlined. This feature is powered by
Brenton's `AST` and `Lint` paclets, thank you
[@bostick](https://github.com/bostick).
- **Diagnostics:** Syntax error would be underlined. This feature is powered
by [CodeParser](https://github.com/WolframResearch/codeparser) and
[CodeInspector](https://github.com/WolframResearch/codeinspector) paclets,
thank you [@bostick](https://github.com/bostick).
![diagnostics](images/diagnostics.png)
Expand Down Expand Up @@ -191,10 +196,11 @@ It will be nice if you want to make a contribution to the following topic.
create a pull request to add the clients in README.md once your client is
released.
* Thanks to Brenton's `AST` and `Lint` paclets, we are able to parse the code
and extract useful information. If you have an idea about how to use these
fantastic syntax tools to help the language server add more features, please
send us issues or pull requests.
* Thanks to [CodeParser](https://github.com/WolframResearch/codeparser) and
[CodeInspector](https://github.com/WolframResearch/codeinspector) paclets,
we are able to parse the code and extract useful information. If you have
an idea about how to use these fantastic syntax tools to help the language
server add more features, please send us issues or pull requests.
If you want to help us with this project, feel free to fork and create a pull
request. Do not forget to add unit tests if possible.
Expand Down
10 changes: 10 additions & 0 deletions external/Matypetica/src/DataType.wl
Original file line number Diff line number Diff line change
Expand Up @@ -339,4 +339,14 @@ TypeUsage[typename_Symbol, usage_String] := (
End[]


Begin["`Test`"]


AssociationSameQ::usage = "AssociationSameQ[assoc1_Association, assoc2_Association] returns True if two associations are same except for key order."
AssociationSameQ = DataType`Private`AssociationSameQ


End[]


EndPackage[]
8 changes: 4 additions & 4 deletions external/Matypetica/test/DataTypeTest.wl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Needs[TestingContext]
{

VerificationTest[
AssociationSameQ @@@ {
DataType`Test`AssociationSameQ @@@ {
{<|"a" -> 1, "b" -> 2|>, <|"b" -> 2, "a" -> 1 |>},
{<|"a" -> 1, "b" -> 2|>, <|"b" -> 1, "a" -> 2 |>},
{<|"a" -> 1, "b" -> 2|>, <|"a" -> 2 |>},
Expand Down Expand Up @@ -155,7 +155,7 @@ VerificationTest[
stu1["courses"],
<|1-> "ECON101", 2->"COMP202", 3->"PHYS201"|>,
TestID -> "Replace Association",
SameTest -> AssociationSameQ
SameTest -> DataType`Test`AssociationSameQ
],

VerificationTest[
Expand All @@ -178,7 +178,7 @@ VerificationTest[
stu1["courses"],
<|1-> "ECON101", 2->"COMP202", 3->"PHYS201"|>,
TestID -> "Replace Association",
SameTest -> AssociationSameQ
SameTest -> DataType`Test`AssociationSameQ
],

VerificationTest[
Expand Down Expand Up @@ -250,7 +250,7 @@ VerificationTest[
TestID -> "Type usage 2"
]

} // Map@Curry[Sow]@CurrentContext
} // Map[Sow[#, CurrentContext]&]


End[]
Expand Down
25 changes: 12 additions & 13 deletions init.wls
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Please see the help info below.

*)

(* For windows, this should be set for Print to correctly format outputs. *)
SetOptions[$Output, FormatType -> OutputForm]

(* ::Subsection:: *)
(*RootDirectory*)
Expand Down Expand Up @@ -113,7 +115,7 @@ Options:
(*Version*)


WolframLanguageServer`Version = "0.2.1";
WolframLanguageServer`Version = "0.2.2"
If[MemberQ[WolframLanguageServer`CommandLine, "-v" | "--version"],
Print["
Wolfram Language Server " <> WolframLanguageServer`Version <> " running on
Expand All @@ -127,14 +129,16 @@ Wolfram Language " <> $Version <> "\n"];


If[MemberQ[WolframLanguageServer`CommandLine, "-t" | "--test"],
Print["
Running tests for all.
"];
Print["\nRunning tests for all.\n"];

Off[General::shdw];
<< RunTest`;
Print[RunTest`TestRunAll[]];
Quit[];
];
RunTest`TestRunAll[]
// Replace[{testAllPass_, testResult_} :> (
Print[testResult];
Exit[If[testAllPass, 0, 1]]
)]
]


(* ::Subsection:: *)
Expand All @@ -143,12 +147,6 @@ Running tests for all.

Needs["WolframLanguageServer`Logger`"];

If[$VersionNumber < 11.3,
(* load myCurry *)
Needs["MyCurry`"];
System`Curry = MyCurry`MyCurry
]

Module[
{
stream, loglevel, logstreams, clientPid, port, pipe,
Expand Down Expand Up @@ -212,6 +210,7 @@ Module[
DeclarePackage["WolframLanguageServer`Server`", {"WLServerStart", "WLServerVersion", "WLServerDebug"}];
*)
<< WolframLanguageServer`Server`;
WolframLanguageServer`CheckReturnTypeQ = True;
LogDebug @ WolframLanguageServer`Server`WLServerStart[
"Stream" -> stream,
"ClientPid" -> clientPid,
Expand Down
52 changes: 0 additions & 52 deletions src/MyCurry.wl

This file was deleted.

Loading

0 comments on commit a2ccaf1

Please sign in to comment.