wasp/waspc/test
Craig McIlwrath 76d9fc4213
[waspls] Add code actions for scaffolding external code (#1316)
When an external import tries to import a symbol from a TypeScript/JavaScript file, waspls now offers quickfix code actions to scaffold a function in that file.

It uses the surrounding context of the external import to determine what code to write for the code action. See [`ScaffoldTsSymbol.hs`](457911d5e9/waspc/waspls/src/Wasp/LSP/Commands/ScaffoldTsSymbol.hs) for a detailed description of how it works. At a high level, there is a `templateForFile` function in `Wasp.LSP.Commands.ScaffoldTsSymbol` that selects the correct template from `data/lsp/templates/ts`. For example, `action.fn.ts` contains a template for scaffolding an `action` function in a TypeScript file and would be used when a code action is requested with the cursor at the location marked by `|`:

```wasp
action createTask {
  fn: import { createTask } from "@server/actions.js"|
}
```

The scaffold action runs as a [LSP command](https://microsoft.github.io/language-server-protocol/specifications/specification-3-16/#workspace_executeCommand). To prepare for wanting to define more commands in waspls in the future, this PR also introduces the concept of `Commands` (`Wasp.LSP.Commands.Command`) that define some properties about each command waspls wants to handle.
2023-07-26 08:00:16 -04:00
..
Analyzer [waspls] Add code actions for scaffolding external code (#1316) 2023-07-26 08:00:16 -04:00
AppSpec Adds WebSocket support (#1203) 2023-06-19 10:49:57 +02:00
FilePath Replaced couple of last usages of Path with StrongPath. 2021-07-05 17:47:28 +02:00
Generator Adds WebSocket support (#1203) 2023-06-19 10:49:57 +02:00
Psl Renames auth method EmailAndPassword to UsernameAndPassword (#696) 2022-08-24 10:32:46 -04:00
Test Formatted whole codebase with ormolu. 2021-04-28 17:44:00 +02:00
Util Adds support for a client public folder (#1229) 2023-06-15 15:17:10 +02:00
AnalyzerTest.hs Add support for Prisma preview features (#1315) 2023-07-12 17:08:57 +02:00
ErrorTest.hs Replace Wasp with AppSpec and Parser with Analyzer. (#423) 2022-01-20 11:45:14 +01:00
Fixtures.hs Replace Wasp with AppSpec and Parser with Analyzer. (#423) 2022-01-20 11:45:14 +01:00
JsImportTest.hs Generate all JS import statements in Haskell (#956) 2023-02-13 16:57:31 +01:00
SemanticVersionTest.hs Make SemanticVersion module more expressive 2022-08-26 16:46:55 +02:00
TastyDiscoverDriver.hs Moved all code into waspc directory. 2020-02-20 12:30:58 +01:00
UtilTest.hs Add support for kebab-case in project name (#590) (#700) 2022-09-02 11:54:25 +02:00
WaspignoreFileTest.hs Implemented wasp start db (managed dev db) (#1044) 2023-03-21 16:37:20 +01:00