Skip to content

Commit

Permalink
namma-dsl-lsp first cut
Browse files Browse the repository at this point in the history
  • Loading branch information
ErasedSoul committed Jan 8, 2024
1 parent 8d076f0 commit c98613b
Show file tree
Hide file tree
Showing 23 changed files with 3,067 additions and 3 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ cabal.sandbox.config
*.aux
*.hp
*.eventlog
.vscode/
*.vim
cabal.project.local
cabal.project.local~
Expand Down
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"haskell.haskell",
"bbenoist.nix",
"jnoortheen.nix-ide",
"mkhl.direnv"
"mkhl.direnv",
"dbaeumer.vscode-eslint"
]
}
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "extensionHost",
"request": "launch",
"name": "Launch Namma DSL Client",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
"outFiles": [
"${workspaceRoot}/lsp/client/out/**/*.js",
"${workspaceRoot}/lsp/server/out/**/*.js"
],
"autoAttachChildProcesses": true,
"preLaunchTask": {
"type": "npm",
"script": "watch"
}
}
]
}
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@
// "editor.formatOnType": true,
// "editor.formatOnSave": true,
"haskell.formattingProvider": "ormolu",
"haskell.manageHLS": "PATH"
"haskell.manageHLS": "PATH",
"editor.insertSpaces": false,
"typescript.tsc.autoDetect": "off",
"typescript.preferences.quoteStyle": "single",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
}
33 changes: 33 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "compile",
"group": "build",
"presentation": {
"panel": "dedicated",
"reveal": "never"
},
"problemMatcher": [
"$tsc"
]
},
{
"type": "npm",
"script": "watch",
"isBackground": true,
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"panel": "dedicated",
"reveal": "never"
},
"problemMatcher": [
"$tsc-watch"
]
}
]
}
3 changes: 3 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
packages.default = self'.packages.namma-dsl;
devShells.default = pkgs.mkShell {
# cf. https://haskell.flake.page/devshell#composing-devshells
buildInputs = [
pkgs.nodejs-18_x
];
inputsFrom = [
config.haskellProjects.default.outputs.devShell
config.pre-commit.devShell
Expand Down
5 changes: 5 additions & 0 deletions lsp/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/**
client/node_modules/**
client/out/**
server/node_modules/**
server/out/**
20 changes: 20 additions & 0 deletions lsp/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**@type {import('eslint').Linter.Config} */
// eslint-disable-next-line no-undef
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
rules: {
'semi': [2, "always"],
'@typescript-eslint/no-unused-vars': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/no-non-null-assertion': 0,
}
};
3 changes: 3 additions & 0 deletions lsp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
out
node_modules
client/server
15 changes: 15 additions & 0 deletions lsp/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.vscode/**
**/*.ts
**/*.map
.gitignore
**/tsconfig.json
**/tsconfig.base.json
contributing.md
.travis.yml
client/node_modules/**
!client/node_modules/vscode-jsonrpc/**
!client/node_modules/vscode-languageclient/**
!client/node_modules/vscode-languageserver-protocol/**
!client/node_modules/vscode-languageserver-types/**
!client/node_modules/{minimatch,brace-expansion,concat-map,balanced-match}/**
!client/node_modules/{semver,lru-cache,yallist}/**
16 changes: 16 additions & 0 deletions lsp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# NAMMA DSL LSP

Namma DSL vscode Extension

## To install
- Search `lsp-namma-dsl` in vscode extensions

## For Running Locally and Testing

- Run `npm install` inside lsp folder
- Open vscode in the lsp folder
- Run `npm run compile` to compile
- Switch to the Run and Debug View in the Sidebar Command+Shift+D
- Select `Launch Namma DSL Client` from the drop down
- Press ▷ to run the launch config (F5).
- Open a .yaml to file to trigger the extension in the new vscode window
Loading

0 comments on commit c98613b

Please sign in to comment.