Skip to content

Commit

Permalink
docs: Upstream.docs branch (#23) for snippets/*.json files
Browse files Browse the repository at this point in the history
* feat: added src/utils/snippets.ts and snippets/*.json files

* chore: added test-data/snippets.test.ts

* chore: added config.ts and many other files for building snippets/*.json

* feat: changes to project config (good refactors, but still WIP)

- `fish-lsp complete` removed bare command
- updated configHandlers to use zod
- updataed fish_lsp_* env variables

* feat: added cli support for env variables for lsp

- added flags '-c'/'--create' && '-s'/'--show'

* chore: added 'snippets/*.{input,py}' and 'snippets/inputs' to .gitignore

* chore: minor changes + `config` moved to global scope

* docs: updated manpage

* chore: removed show&tell discussion from README

* docs: added mermaid to readme

* Docs: Add @ndonfris as a contributor

* chore: updated README w/ contributors

* chore: REMOVED EXECUTABLE PRIVILEGES. Updated snippets, and jest files.

- removed executable privileges from files that don't need to be
  executed ('src/**.ts', and 'scripts/*.fish')
    - `chmod -x src/**.ts && chmod -x scripts/*.fish`
- snippets had major changes (BOTH 'snippets/*.json',
  'test-data/snippets.test.ts' & 'src/utils/snippets.ts')
    - src/utils/snipptes.ts now has a map for storing prebuilt
      documentation
    - test-data/snippets.test.ts now tests the new prebuilt
      documentation
    - snippets/*.json had deprecated files removed
    - snippets/*.json had formatting fixes
- jest.config.js
    - Removed commented out code in
    - Added 'use strict;' in jest.config.js

* feat: added simple diagnostics back for variables built by snippets/*.json
- needs testing before included in master
- uses snippets/*.json and needs improving in src/server.ts

* feat: added fish_lsp_{enable,disable}_handler support in src/server.ts

* docs: README.md formatting & structure changes

* feat: workspaces working with config

* feat: added modifiable workspaces to workspace handler

* chore: fixed MAN_FILE.md and docs/man/fish-lsp.1

* feat: fixed non startupCache function resolver documentation

- now matches startupCache function markdown/documentation better

* docs: updated README.md, docs/{CONTRIBUTING,ROADMAP}.md

* fix: update {tsconfig,package}.json with additional directories and files

Why: The package.json file needed to be updated to include additional directories and files for better organization and functionality.
     Error become known from .github/workflow/eslint.yml failure

Changes:
- Added directories key with man and bin paths
- Added files key with src, snippets, package.json paths
- src/features/fix-all.ts had some ssall changes that probably need to
  be reverted, although fix-all & code-actions are not currently
  attached to the server.ts file

* breaking: new actions

* fix: snippets moved to src/snippets
  • Loading branch information
ndonfris authored May 23, 2024
1 parent 8742d07 commit 2c12a11
Show file tree
Hide file tree
Showing 127 changed files with 2,731 additions and 1,237 deletions.
34 changes: 31 additions & 3 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,40 @@
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"./docs/CONTRIBUTING.md"
"README.md"
],
"imageSize": 25,
"imageSize": 50,
"commit": false,
"commitConvention": "eslint",
"contributors": [],
"contributors": [
{
"login": "ndonfris",
"name": "nick",
"avatar_url": "https://avatars.githubusercontent.com/u/49458459?v=4",
"profile": "https://github.com/ndonfris",
"contributions": [
"code"
]
},
{
"login": "mimikun",
"name": "mimikun",
"avatar_url": "https://avatars.githubusercontent.com/u/13450321?v=4",
"profile": "https://github.com/mimikun",
"contributions": [
"code"
]
},
{
"login": "jpaju",
"name": "Jaakko Paju",
"avatar_url": "https://avatars.githubusercontent.com/u/36770267?v=4",
"profile": "https://github.com/jpaju",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
"linkToUsage": false
}
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ github: ndonfris # Replace with up to 4 GitHub Sponsors-enabled usernames e.g.,
# issuehunt: # Replace with a single IssueHunt username
# lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
# polar: # Replace with a single Polar username
buy_me_a_coffee: donfrisn # Replace with a single Buy Me a Coffee username
buy_me_a_coffee: ndonfris # Replace with a single Buy Me a Coffee username
# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: TypeScript Node CI

on:
pull_request:
branches:
- master

jobs:
ci:
name: Lint Codebase
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Install Fish Shell
uses: fish-actions/install-fish@v1.1.0

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 21.7.1

- name: Install Yarn
run: npm install -g yarn@1.22.22

- name: Install Dependencies
run: yarn install

- name: Run Lint
run: yarn lint
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ wikis
out.png
.vim
test-data/staging
build
build
!snippets/*.json
snippets/*
375 changes: 248 additions & 127 deletions README.md

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ Documenting notable changes across project verisions

## Current

## \[1.0.4\] - 2024-06-22 ([PR #23](https://github.com/unclechu/node-deep-extend/pull/23))

- added `./src/snippets/*.json`
- included new [user config](../src/config.ts) options from `.env`
- removed `fish-lsp bare` support
- added `fish-lsp env` support
- major changes to documentation
- added [mermaid](https://github.com/ndonfris/fish-lsp/tree/upstream.docs#how-does-it-work) docs to readme
- added contributors to [readme](https://github.com/ndonfris/fish-lsp/tree/upstream.docs#contributors)
- added new github actions
- adds __hover__ support for `pipes` & `status numbers`
- adds __signature__ handler for specific important shell variables

### [PR #21](https://github.com/unclechu/node-deep-extend/pull/21) -- 2024-05-03

- converted `scripts/*.sh` to `scripts/*.fish`
Expand Down Expand Up @@ -41,4 +54,4 @@ Documenting notable changes across project verisions

## \[1.0.0\] - Initial Release

- Main project files
- Main project files
101 changes: 75 additions & 26 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

The [fish-lsp](https://fish-lsp.dev) aims to create an experience that aligns with the [fish](https://fishshell.com) language goals.

In short, the project hopes to create a development environment that is as
In a quick overview, the project hopes to create a development environment that is as
_friendly_ as possible.

_Thanks for the interest in contributing to the project_ 🙏


---

There are many ways to contribute to the project:
Expand All @@ -18,37 +21,80 @@ There are many ways to contribute to the project:

## Getting started

Working on the project, will require you to __build it from source__.
1. Begin by forking the project, then [build your local fork](../README.md#installation) :card_file_box:.

2. Once you have installed the local fork of the project (_i.e.,_ you have a successfully
compiled `fish-lsp` executable, and have a working [client configuration](https://github.com/ndonfris/fish-lsp-language-clients)),
you can then begin testing locally :memo:.

You will then be required to `link` the project to your global environment.
3. Upon completing a change, submit a [PR](https://github.com/ndonfris/fish-lsp/pulls) :tada:.

Once these steps are complete, you can then begin testing locally. __Forking__ _the
project is encouraged._
## Places to start

Upon completing a change, submit a [PR](https://github.com/ndonfris/fish-lsp/pulls).
- [ROADMAP](./ROADMAP.md) - _future ideas to support_
- [Issues and discussions](https://github.com/ndonfris/fish-lsp/discussions) - _get ideas from others_
- [Sources](https://github.com/ndonfris/fish-lsp/wiki/sources) - _helpful insight about potential features you want to adapt_

## Recommended workflow & Helpful Insight
## Workflows

### TDD Workflow

Since stdin/stdout are reserved for the protocol to communicate, a generally
successful method to achieve quick results, is through TDD (Test Driven
Development). Many tree-sitter helper functions have already been written, to
aid in providing useful functionality further down the release cycle.

[Currying](https://en.wikipedia.org/wiki/Currying) is a useful design pattern,
that makes iterating through the [Abstract Syntax Trees (ASTs)](https://en.wikipedia.org/wiki/Abstract_syntax_tree) significantly
less error prone. Earlier language server protocol versions required the Nodes
in our tree items, to be stored as a flat list. Due to this reason, there has
been the need for a significant rewrite of previously working features
(diagnostics, etc...). __This would be a great place to start__, as many of

### Integration Testing Workflow

Test directly in the client of your choosing. This is more difficult to setup,
but could be helpful if you are testing specific behaviors like the interacting
with fish-lsp's environment variables, configuration options, handler testing or
other more specific tasks.

<!---
- watch compilation on changes
```fish
cd $(fish-lsp info --repo | tail -n1)
yarn watch
```
- abbr helpful for continuosly running editor for testing
```fish
abbr -a wht --set-cursor --position command "$(string join \n -- 'while true;' '%' 'end;')"
# while true
# $EDITOR ~/.config/fish/config.fish
# sleep 1s
# source ~/.config/fish/config.fish # don't forget to source any 'fish_lsp_*' variables you are testing
#end
```
- display logs
```fish
tail -f $(fish-lsp info --logs-file)
```
--->

## Helpful Topics and Concepts

[Currying](https://en.wikipedia.org/wiki/Currying) is a useful design pattern, that makes iterating through the
[Abstract Syntax Trees (ASTs)](https://en.wikipedia.org/wiki/Abstract_syntax_tree) significantly less error prone. Earlier language server
protocol versions required the Nodes in our tree items, to be stored as a flat list.
Due to this reason, there has been the need for a significant rewrite of previously
working features (diagnostics, etc...). __This would be a great place to start__, as many of
[server](../src/server.ts) providers are implemented using range based location
calculation's to abide to their prior protocol use.

Features that receive bumps in support will eventually be supported as an opt in
design through the application config _(also needs a rewrite)_. This will allow
experimental feautures to the user's who understand what they are testing. I
have included [zod](https://github.com/colinhacks/zod), as a dependency for reading in `process.env` variables to the user's configuration.
[Child process](https://nodejs.org/api/child_process.html) execution via sub-shells. Sub-shell environment's
are extensively relied on throughout the code base.

> Until this is completed, I am sorry for any unintended bugs.
[Markdown formatting syntax](https://www.markdownguide.org/basic-syntax/), and nested language support via triple backticks.

[Asynchronous processes](https://en.wikipedia.org/wiki/Asynchronous_I/O) and [race conditions](https://en.wikipedia.org/wiki/Race_condition). Especially during [src/server.ts](../src/server.ts) startup.

Prefetching relevant information and [caching](https://en.wikipedia.org/wiki/Cache_(computing)) it for global use.

## Important Tooling Provided

Expand All @@ -57,7 +103,7 @@ have included [zod](https://github.com/colinhacks/zod), as a dependency for read
- [knip](https://github.com/webpro/knip) - used for tree-shaking and checking unused dependcies
- [commander.js](https://github.com/tj/commander.js) - used for [src/cli.ts](../src/cli.ts) and other tooling to start the server

Becoming framiliar with using the tree-sitter code, is signficantly easier while
Becoming familiar with using the tree-sitter code, is significantly easier while
using the previously mentioned __TDD__. Although, another helpful method is
avaliable for any neovim devlepers via the `:InspectEdit` command. This will
allow you to visualize the AST that tree-sitter parsed from fish input.
Expand All @@ -70,12 +116,15 @@ settings, as seen in the [JSON](../README.md#client-usage) example, is only for

Adding new client configurations, to the [fish-lsp-client's](https://github.com/ndonfris/fish-lsp-language-clients/) repo, is greatly appreciated!

## Contributors
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
## Add helpful scripts

[Show & tell](https://github.com/ndonfris/fish-lsp/discussions) is a helpful place to document your useful configurations for working on the fish-lsp.

Displaying demos, features and other cool discoveries is also welcomed.

<!---
## Reminders while testing
<!-- ALL-CONTRIBUTORS-LIST:END -->
- If you are testing the shell environment variables
--->
72 changes: 55 additions & 17 deletions docs/MAN_FILE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,60 +14,98 @@ It requires a client that supports the Language Server Protocol (LSP). For examp

### OPTIONS

`-v` or `--version`
Show version information and exit.

`-h` or `--help`
Show help message and exit.

`-v` or `--version`
Show version information and exit.
`--help-all`
show all the help information

`--help-short`
show shortened help message

`--help-man`
show manpage output

### SUBCOMMANDS

`start`
Start the language server.

`min` or `bare`
Start the language server without any language-specific features.
`--enable` enable the language server features
`--disable` disable the language server features
`--dump` dump the json ouput of the language server features enabled after startup

`env`
show the environment variables available to the lsp

`-c`, `--create` create the environment variable
`-s`, `--show` show the environment variables

`logger`
Access the logger

`-s`, `--show` show the logger and don't edit it
`-c`, `--clear` clear the logger
`-d`, `--date` write the date
`-q`, `--quiet` silence logging
`--config` show the logger config

`info`
show the build info of fish-lsp

`--bin` show the path of the fish-lsp executable
`--repo` show the path of the entire fish-lsp repo
`--time` show the path of the entire fish-lsp repo
`--env` show the env variables used
`--lsp-version` show the lsp version
`--capabilities` show the lsp capabilities
`--man-file` show the man file path
`--logs-file` show the logs.txt file path
`--more` show the build time of the fish-lsp executable

`url`
show a helpful url related to the fish-lsp

`--repo`, `--git` show the github repo
`--npm` show the npm package url
`--homepage` show the homepage
`--contributions` show the contributions url
`--wiki` show the github wiki
`--issues`, `--report` show the issues page
`--discussions` show the discussions page
`--clients-repo` show the clients configuration repo
`--sources` show a list of helpful sources

`complete`
Provide completions for the `fish-lsp`

`help`
Show help message and exit.
`--names` show the feature names of the completions
`--toggles` show the feature names of the completions
`--fish` show fish script
`--features` show features

## EXAMPLES

Start the `fish-lsp` language server, with the default configuration:
- Start the `fish-lsp` language server, with the default configuration:

```fish
>_ fish-lsp start
```

• Start the `fish-lsp` language server, with the bare minimum configuration:

```fish
>_ fish-lsp bare --enable hover
```

• Show the path to the `fish-lsp` language server binary:
- Show the path to the `fish-lsp` language server binary:

```fish
>_ fish-lsp complete > ~/.config/fish/completions/fish-lsp.fish
```

## SEE ALSO

__website:__ _https://fish-lsp.dev/_
__repo:__ _https://github.com/ndonfris/fish-lsp_
__fish website:__ _https://fishshell.com/_
- __website:__ _https://fish-lsp.dev/_
- __repo:__ _https://github.com/ndonfris/fish-lsp_
- __fish website:__ _https://fishshell.com/_

## AUTHOR

Expand Down
Loading

0 comments on commit 2c12a11

Please sign in to comment.