wasp/waspc/test/Analyzer
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
..
Evaluation [Analyzer] Reverse the order of Wasp error messages (#500) 2022-03-23 13:18:43 +01:00
Parser [waspls] Add code actions for scaffolding external code (#1316) 2023-07-26 08:00:16 -04:00
ParserTest/parseStatementsTests Show multiple parse errors from Wasp Analyzer (#1298) 2023-06-29 12:34:31 +02:00
TypeChecker Stop weakening the AST (#628) 2023-02-14 10:09:21 +01:00
EvaluatorTest.hs Separate user code into client, server, shared (#753) 2022-11-11 17:20:49 +01:00
ParserTest.hs Fix incorrect parsing of escaped strings in Wasp (#699) 2022-08-23 14:01:00 +02:00
TestUtil.hs Integrate new error resilient parser into waspc (#684) 2022-08-11 12:26:12 -04:00
TypeCheckerTest.hs Stop weakening the AST (#628) 2023-02-14 10:09:21 +01:00