Skip to content

Commit

Permalink
adding go lsp
Browse files Browse the repository at this point in the history
  • Loading branch information
clpi committed Dec 18, 2024
1 parent 41705a6 commit 88cd826
Show file tree
Hide file tree
Showing 36 changed files with 566 additions and 466 deletions.
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
**.after/
**.vscode/
**.down/
**/*.down
./lib/
./down-lsp
./down
down-lsp
down
down-lsp.sh
downls
**.DS_Store
**.lapce/
**.idea/
**node_modules
**ext/c
Expand Down
5 changes: 3 additions & 2 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
-- std = "lua51+nvim"

cache = true
codes = true
self = false

read_globals = {
"vim",
}
-- Global objects
globals = {
"_",
"word",
"down",
"vim",
"log",
}
Expand Down
6 changes: 6 additions & 0 deletions .luarc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"workspace.checkThirdParty": false,
"runtime.version": "LuaJIT",
"workspace.library": [
"$VIMRUNTIME",
"lua",
"${3rd]/luv/library"
],
"semantic.annotation": true,
"semantic.keyword": true,
"semantic.variable": true,
Expand Down
22 changes: 20 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,41 @@
#
# nvimf="--headless -u ./test/config/minit.lua --noplugin -c ''"

lint:
@printf "\nLuacheck\n"
luacheck --config .luacheckrc ./lua ./test
@printf "\nSelene\n"
selene --display-style=quiet lua/* test/*
@printf "\nStylua\n"
stylua --check .

w:
./scripts/bin/down

wl:
./scripts/bin/downls
./scripts/bin/down-lsp

wsl:
./scripts/bin/down-lsp.sh

lnw:
rm -rf ./down
ln -s ./scripts/bin/down ./down
lnwl:
rm -rf ./down-lsp
ln -s ./scripts/bin/down-lsp ./down-lsp
lnwls:
rm -rf ./down-lsp.sh
ln -s ./scripts/bin/down-lsp.sh ./down-lsp.sh

iw: lnw
cp -r ./scripts/bin/down ${HOME}/.local/bin/
iwl: lnwl
cp -r ./scripts/bin/down-lsp ${HOME}/.local/bin/
iwls: lnwls
cp -r ./scripts/bin/down-lsp.sh ${HOME}/.local/bin/

i: iw iwl
i: iw iwl iwls

clean:
fd --no-ignore --glob "*-E" -x "rm" ./
Expand All @@ -28,6 +45,7 @@ v:
nvim -u ./test/config/minit.lua # -c 'Lazy install'



# books:
# cd book && mdbook serve

Expand Down
102 changes: 102 additions & 0 deletions assets/helix/languages.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
[language-server.down]
command = "down-lsp.sh"
args = ["--stdio"]
timeout = 20

[language-server.down.config]
documentFormatting = true

[language-server.down.config.workspaces]
default = "~/home",
notes = "~/notes",
wiki = "~/wiki"
index = "index",
notes = "notes",

[language-server.down.config.down]
rootMarkers = [".git/"],
filetypes = ["down"]
debug = false

[language-server.down.environment]
DOWN_LSP_PATH = "$HOME/.local/bin/down-lsp.sh"
DOWN_BIN_PATH = "$HOME/.local/bin/down.sh"

[[language]]
name = "markdown"
language-servers = [
{
name = "down",
only-features = [
"hover",
"completion",
"workspace-command",
"workspace-symbols",
"goto-reference",
"rename-symbol",
"document-symbols",
"diagnostics",
"goto-definition",
"signature-help",
"code-action",
"inlay-hint",
"document-highlight",
"format",
"goto-declaration",
"goto-implementation",
"goto-type-definition",
]
}
]

[[language]]
name = "down"
language-id = "down"
shebangs = ["down", "down-lsp", "dwn"]
auto-format = true
file-types = ["down", "dw"]
comment-tokens = ["--", "-!"]
roots = [
".git/", ".down/", ".downrc", ".downignore", "*.down"
]
text-width = 100
block-comment-tokens = [
{ start = "-/", end = "/-"}
{ start = "--!", end = "!--"}
]
scope = "source.down"
soft-wrap = true
workspace-lsp-root
indent = { tab-width = 2, unit = " " }
language-servers = [
{
name = "down",
only-features = [
"hover",
"completion",
"workspace-command",
"workspace-symbols",
"goto-reference",
"rename-symbol",
"document-symbols",
"diagnostics",
"goto-definition",
"signature-help",
"code-action",
"inlay-hint",
"document-highlight",
"format",
"goto-declaration",
"goto-implementation",
"goto-type-definition",
]
}
]

[[grammar]]
name = "down"
file-types = ["down", "dw"]
comment-tokens = ["--", "-/", "/-", "-!"]
scope = "source.down"
indent = { tab-width = 2, style = "space" }
language-servers
Empty file added assets/shell/nu/down.nu
Empty file.
Empty file added assets/shell/zsh/down.zsh
Empty file.
2 changes: 1 addition & 1 deletion book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Welcome -- to the `down.lua` book. I hope this helps!
- [Intro](./intro.md)
- [About](./about/index.md)

- [Philosophy](./philosophy.md)
- [Philosophy](./about/philosophy.md)
- [Compare](./about/compare.md)

- [Configuring](./config/index.md)
Expand Down
4 changes: 4 additions & 0 deletions book/src/about/philosophy.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# Philosophy

## Why?

I started `down.lua` primarily due to my conflicting captivation and frustration with existing solutions like [org-mode](#) and, more recently in the burgeoning `Neovim` ecosystem, [neorg](https://github.com/nvim-neorg/neorg).
20 changes: 0 additions & 20 deletions ext/dlsp/.cargo/config.toml

This file was deleted.

24 changes: 0 additions & 24 deletions ext/dlsp/Cargo.toml

This file was deleted.

21 changes: 0 additions & 21 deletions ext/dlsp/LICENSE

This file was deleted.

Loading

0 comments on commit 88cd826

Please sign in to comment.