Skip to content

Commit

Permalink
Replaced repo with contents from svermeulen/tea-leaves as per issue #16
Browse files Browse the repository at this point in the history
  • Loading branch information
svermeulen committed Aug 27, 2024
1 parent 67b5d7c commit 35cc30a
Show file tree
Hide file tree
Showing 84 changed files with 11,698 additions and 2,001 deletions.
14 changes: 0 additions & 14 deletions .editorconfig

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

name: test

on: [push, pull_request]

jobs:
test:
strategy:
fail-fast: false
matrix:
luaVersion: ["5.1", "5.2", "5.3", "5.4" ]

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@main

- name: Install Lua
uses: leafo/[email protected]
with:
luaVersion: ${{ matrix.luaVersion }}

- name: Install LuaRocks
uses: leafo/[email protected]

- name: Build
run: scripts/setup_local_luarocks.sh

- name: Lint
run: scripts/lint_teal.sh

- name: Check for untracked or modified files
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Error: Untracked or modified files found."
git status
exit 1
else
echo "No untracked or modified files."
fi
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
teal-language-server.log
/luarocks
/lua
/lua_modules
/.luarocks
/luarocks.bat
/lua.bat
/luarocks_tree
/*.src.rock

# install dirs on CI machine
/.install
/.lua
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Steve Vermeulen

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.
57 changes: 39 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,54 @@
# WIP and Currently (Very) Unstable
This is very much a work in progress. Work is being done in the Teal compiler itself to make development of this easier and the cli is undergoing changes as well to help with the project management tools that a language server expects to have (such as being able to properly load `tlconfig.lua`).

Check out the Teal gitter if you would like to contribute
# Tea Leaves

[![Join the chat at https://gitter.im/dotnet/coreclr](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/teal-language/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
A language server for the [Teal language](https://github.com/teal-language/tl)

```
luarocks install --dev teal-language-server
```
[![test](https://github.com/svermeulen/tea-leaves/actions/workflows/test.yml/badge.svg)](https://github.com/svermeulen/tea-leaves/actions/workflows/test.yml)

# Installation

### From luarocks

# teal-language-server
* `luarocks install tea-leaves`
* `tea-leaves`

Currently the server only implements:
- `textDocument/didOpen`
- `textDocument/didSave`
- `textDocument/didClose`
- `textDocument/hover`
Tested on Windows, Linux and MacOS

And just runs a simple type check
### From source

# Setup
* Clone repo
* From repo root:
* `scripts/setup_local_luarocks`
* `./lua_modules/bin/tea-leaves`

If you can get this working with your editor, please open an issue/pr to add it here!
# Features

### Neovim 0.7
* Go to definition (`textDocument/definition`)
* Linting (`textDocument/publishDiagnostics`)
* Intellisense (`textDocument/completion`)
* Hover (`textDocument/hover`)

# Editor Setup

### Neovim

Install the [lspconfig plugin](https://github.com/neovim/nvim-lspconfig) and put the following in your `init.vim` or `init.lua`

```lua
local lspconfig = require("lspconfig")

lspconfig.teal_ls.setup {}
lspconfig.tea_leaves.setup {}
```

# Usage

```
tea-leaves [--verbose=true] [--log-mode=none|by_proj_path|by_date]
```

Note:

* All args are optional
* By default, logging is 'none' which disables logging completely
* When logging is set to by_proj_path or by_date, the log is output to `[User Home Directory]/.cache/tea-leaves`

2 changes: 2 additions & 0 deletions bin/tea-leaves
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env lua
require('tea_leaves.main')
2 changes: 0 additions & 2 deletions bin/teal-language-server

This file was deleted.

Loading

0 comments on commit 35cc30a

Please sign in to comment.