Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcoroth/stimulus-lsp
Intelligent Stimulus tooling for Visual Studio Code and Neovim
https://github.com/marcoroth/stimulus-lsp
hacktoberfest hotwire language-server language-server-protocol lsp stimulus stimulusjs
Last synced: 20 days ago
JSON representation
Intelligent Stimulus tooling for Visual Studio Code and Neovim
- Host: GitHub
- URL: https://github.com/marcoroth/stimulus-lsp
- Owner: marcoroth
- License: mit
- Created: 2021-06-23T08:44:22.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-22T18:02:23.000Z (6 months ago)
- Last Synced: 2024-05-22T18:35:35.487Z (6 months ago)
- Topics: hacktoberfest, hotwire, language-server, language-server-protocol, lsp, stimulus, stimulusjs
- Language: TypeScript
- Homepage: https://hotwire.io/ecosystem/tooling/stimulus-lsp
- Size: 2.19 MB
- Stars: 189
- Watchers: 3
- Forks: 10
- Open Issues: 74
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-hotwire - stimulus-lsp - Language Server Protocol for Stimulus, enhancing development experience. (**Awesome Hotwire** [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) / Stimulus)
- awesome-hotwire - stimulus-lsp - Language Server Protocol for Stimulus, enhancing development experience. (**Awesome Hotwire** [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) / Stimulus)
README
# Stimulus LSP
Intelligent Stimulus tooling for Visual Studio Code
![](/assets/stimulus-lsp.png)
## Functionality
Currently, this Language Server only works for HTML, though its utility extends to various file types such as ERB, PHP, or Blade files.
### Completions
* Data Attributes
* Completions for controller identifiers
* Completions for controller actions
* Completions for controller targets
* Completions for controller values
* Completions for controller classes### Diagnostics
#### HTML Files
* Missing controllers (`stimulus.controller.invalid`)
* Missing controller actions (`stimulus.action.invalid`)
* Missing controller targets (`stimulus.controller.target.missing`)
* Missing controller values (`stimulus.controller.value.missing`)
* Invalid action descriptors (`stimulus.action.invalid`)
* Data attributes format mismatches (`stimulus.attribute.mismatch`)
* Controller values type mismatches (`stimulus.controller.value.type_mismatch`)#### JavaScript Files/Stimulus Controller Files
* Controller value definition default value type mismatch (`stimulus.controller.value_definition.default_value.type_mismatch`)
* Unknown value definition type (`stimulus.controller.value_definition.unknown_type`)
* Controller parsing errors (`stimulus.controller.parse_error`)
* Import from deprecated packages (`stimulus.package.deprecated.import`)### Quick-Fixes
* Create a controller with the given identifier (`stimulus.controller.create`)
* Update controller identifier with did you mean suggestion (`stimulus.controller.update`)
* Register a controller definition from your project or a NPM package (`stimulus.controller.register`)
* Update controller action name with did you mean suggestion (`stimulus.controller.action.update`)
* Implement a missing controller action on controller (`stimulus.controller.action.implement`)
* Create a default config file at `.stimulus-lsp/config.json` (`stimulus.config.create`)
* Ignore diagnostics for a HTML attribute by adding it to the `ignoredAttributes` config (`stimulus.config.attribute.ignore`)
* Ignore diagnostics for a Stimulus controller identifier by adding it to the `ignoredControllerIdentifiers` config (`stimulus.config.controller.ignore`)## Structure
```
.
├── package.json // The extension manifest.
|
├── client // Language Client
│ └── src
│ └── extension.ts // Language Client entry point
|
└── server // Language Server
└── src
└── server.ts // Language Server entry point
```## Running the extension locally
- Run `yarn install` in this folder. This installs all necessary npm modules in both the client and server folder
- Open VS Code on this folder.
- Press Ctrl+Shift+B to compile the client and server.
- Switch to the Debug viewlet.
- Select `Launch Client` from the drop down.
- Run the launch config.
- If you want to debug the server as well use the launch configuration `Attach to Server`
- In the [Extension Development Host] instance of VSCode, open a HTML file.
- Type ``, place your cursor where the `|` is, hit Ctrl+Space and you should see completions.## Install instructions: Neovim
[Install instructions can be found at nvim-lspconfig](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#stimulus_ls)